ukui-search/libsearch/common.h

63 lines
1.9 KiB
C
Raw Normal View History

2022-10-26 18:01:40 +08:00
#pragma once
#include <QMap>
#include <QString>
#include <QDir>
2022-10-26 18:01:40 +08:00
namespace UkuiSearch {
2022-04-25 11:16:25 +08:00
#define CONTENT_DATABASE_PATH_SLOT 1
#define CONTENT_DATABASE_SUFFIX_SLOT 2
static const int LABEL_MAX_WIDTH = 320;
static const QString HOME_PATH = QDir::homePath();
static const QString INDEX_PATH = HOME_PATH + QStringLiteral("/.config/org.ukui/ukui-search/index_data");
static const QString CONTENT_INDEX_PATH = HOME_PATH + QStringLiteral("/.config/org.ukui/ukui-search/content_index_data");
static const QString OCR_CONTENT_INDEX_PATH = HOME_PATH + QStringLiteral("/.config/org.ukui/ukui-search/ocr_content_index_data");
static const QString FILE_SEARCH_VALUE = QStringLiteral("0");
static const QString DIR_SEARCH_VALUE = QStringLiteral("1");
static const QString INDEX_SEM = QStringLiteral("ukui-search-index-sem");
2022-04-13 13:46:30 +08:00
static const int OCR_MIN_SIZE = 200;
2022-04-14 11:16:26 +08:00
static const QByteArray UKUI_SEARCH_SCHEMAS = QByteArrayLiteral("org.ukui.search.settings");
static const QString SEARCH_METHOD_KEY = QStringLiteral("fileIndexEnable");
/**
* changelog 1.0.1 term中被截断的问题
*/
static const QString INDEX_DATABASE_VERSION = QStringLiteral("1.0.1");
/**
* changelog 1.1.0 value
*/
static const QString CONTENT_DATABASE_VERSION = QStringLiteral("1.1.0");
static const QString OCR_CONTENT_DATABASE_VERSION = QStringLiteral("1.0.0");
static const QStringList allAppPath = {
{HOME_PATH + "/.local/share/applications/"},
{"/usr/share/applications/"}
};
//TODO Put things that needed to be put here here.
2022-10-26 18:01:40 +08:00
/**
* @brief The DataBaseType enum
* Basic
* Content
*/
enum class DataBaseType {
Basic = 0,
Content = 1,
OcrContent = 2
2022-10-26 18:01:40 +08:00
};
2022-10-26 18:01:40 +08:00
/**
* @brief The IndexType enum
* Index type, notice:OCR index is part of Content index.
*/
enum class IndexType {
Basic,
Contents,
OCR
};
}