Changeset View
Changeset View
Standalone View
Standalone View
src/file/mainhub.cpp
Show All 38 Lines | 36 | { | |||
---|---|---|---|---|---|
39 | 39 | | |||
40 | connect(&m_fileWatcher, &FileWatch::indexNewFile, &m_fileIndexScheduler, &FileIndexScheduler::indexNewFile); | 40 | connect(&m_fileWatcher, &FileWatch::indexNewFile, &m_fileIndexScheduler, &FileIndexScheduler::indexNewFile); | ||
41 | connect(&m_fileWatcher, &FileWatch::indexModifiedFile, &m_fileIndexScheduler, &FileIndexScheduler::indexModifiedFile); | 41 | connect(&m_fileWatcher, &FileWatch::indexModifiedFile, &m_fileIndexScheduler, &FileIndexScheduler::indexModifiedFile); | ||
42 | connect(&m_fileWatcher, &FileWatch::indexXAttr, &m_fileIndexScheduler, &FileIndexScheduler::indexXAttrFile); | 42 | connect(&m_fileWatcher, &FileWatch::indexXAttr, &m_fileIndexScheduler, &FileIndexScheduler::indexXAttrFile); | ||
43 | connect(&m_fileWatcher, &FileWatch::fileRemoved, &m_fileIndexScheduler, &FileIndexScheduler::handleFileRemoved); | 43 | connect(&m_fileWatcher, &FileWatch::fileRemoved, &m_fileIndexScheduler, &FileIndexScheduler::handleFileRemoved); | ||
44 | 44 | | |||
45 | connect(&m_fileWatcher, &FileWatch::installedWatches, &m_fileIndexScheduler, &FileIndexScheduler::scheduleIndexing); | 45 | connect(&m_fileWatcher, &FileWatch::installedWatches, &m_fileIndexScheduler, &FileIndexScheduler::scheduleIndexing); | ||
46 | 46 | | |||
47 | connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, &m_fileIndexScheduler, &FileIndexScheduler::halt); | ||||
48 | | ||||
47 | MainAdaptor* main = new MainAdaptor(this); | 49 | MainAdaptor* main = new MainAdaptor(this); | ||
48 | Q_UNUSED(main) | 50 | Q_UNUSED(main) | ||
49 | 51 | | |||
50 | QDBusConnection bus = QDBusConnection::sessionBus(); | 52 | QDBusConnection bus = QDBusConnection::sessionBus(); | ||
51 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | 53 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | ||
52 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | 54 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | ||
53 | 55 | | |||
54 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | 56 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | ||
55 | } | 57 | } | ||
56 | 58 | | |||
57 | void MainHub::quit() const | 59 | void MainHub::quit() const | ||
58 | { | 60 | { | ||
59 | QCoreApplication::instance()->quit(); | 61 | QCoreApplication::instance()->quit(); | ||
60 | } | 62 | } | ||
61 | 63 | | |||
62 | void MainHub::updateConfig() | 64 | void MainHub::updateConfig() | ||
63 | { | 65 | { | ||
66 | m_fileIndexScheduler.halt(); | ||||
67 | | ||||
64 | m_config->forceConfigUpdate(); | 68 | m_config->forceConfigUpdate(); | ||
65 | // FIXME!! | 69 | // FIXME!! | ||
bruns: Unrelated change | |||||
66 | //m_fileIndexer.updateConfig(); | 70 | //m_fileIndexer.updateConfig(); | ||
67 | m_fileWatcher.updateIndexedFoldersWatches(); | 71 | m_fileWatcher.updateIndexedFoldersWatches(); | ||
68 | } | 72 | } | ||
69 | 73 | | |||
70 | void MainHub::registerBalooWatcher(const QString &service) | 74 | void MainHub::registerBalooWatcher(const QString &service) | ||
71 | { | 75 | { | ||
72 | m_fileWatcher.registerBalooWatcher(service); | 76 | m_fileWatcher.registerBalooWatcher(service); | ||
73 | } | 77 | } |
Unrelated change