forked from openkylin/ukui-search
Merge pull request #236 from iaom/0512-dev
Fix: Block list conf won't work.
This commit is contained in:
commit
987611efe5
|
@ -37,6 +37,14 @@ GlobalSettings::GlobalSettings(QObject *parent) : QObject(parent) {
|
|||
// m_settings->setAtomicSyncRequired(false);
|
||||
m_block_dirs_settings = new QSettings(BLOCK_DIRS, QSettings::IniFormat, this);
|
||||
m_block_dirs_settings->setIniCodec(QTextCodec::codecForName("UTF-8"));
|
||||
m_block_dirs_settings->setValue("These_are_block_dirs_conf_for_ukui_search","0");
|
||||
m_block_dirs_settings->sync();
|
||||
m_confWatcher = new QFileSystemWatcher(this);
|
||||
m_confWatcher->addPath(BLOCK_DIRS);
|
||||
connect(m_confWatcher, &QFileSystemWatcher::fileChanged, this, [ & ]() {
|
||||
m_block_dirs_settings->sync();
|
||||
m_confWatcher->addPath(BLOCK_DIRS);
|
||||
});
|
||||
|
||||
m_search_record_settings = new QSettings(SEARCH_HISTORY, QSettings::IniFormat, this);
|
||||
m_search_record_settings->setIniCodec(QTextCodec::codecForName("UTF-8"));
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include <QMutex>
|
||||
#include <QVector>
|
||||
#include <QDir>
|
||||
#include <QFileSystemWatcher>
|
||||
//#include <QGSettings>
|
||||
//If use pkg_config, it wont build succes,why?????????
|
||||
//My demo can build access yet.
|
||||
|
@ -102,6 +103,7 @@ private:
|
|||
QSettings *m_search_record_settings;
|
||||
QMap<QString, QVariant> m_cache;
|
||||
QStringList m_history;
|
||||
QFileSystemWatcher *m_confWatcher;
|
||||
|
||||
QMutex m_mutex;
|
||||
// size_t test = 0;
|
||||
|
|
Loading…
Reference in New Issue