Changeset View
Changeset View
Standalone View
Standalone View
src/file/mainhub.cpp
Show All 36 Lines | 36 | { | |||
---|---|---|---|---|---|
37 | Q_ASSERT(db); | 37 | Q_ASSERT(db); | ||
38 | Q_ASSERT(config); | 38 | Q_ASSERT(config); | ||
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::checkUnindexedFiles); | ||
46 | 46 | | |||
47 | MainAdaptor* main = new MainAdaptor(this); | 47 | MainAdaptor* main = new MainAdaptor(this); | ||
48 | Q_UNUSED(main) | 48 | Q_UNUSED(main) | ||
49 | 49 | | |||
50 | QDBusConnection bus = QDBusConnection::sessionBus(); | 50 | QDBusConnection bus = QDBusConnection::sessionBus(); | ||
51 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | 51 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | ||
52 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | 52 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | ||
53 | 53 | | |||
54 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | 54 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | ||
55 | } | 55 | } | ||
56 | 56 | | |||
57 | void MainHub::quit() const | 57 | void MainHub::quit() const | ||
58 | { | 58 | { | ||
59 | QCoreApplication::instance()->quit(); | 59 | QCoreApplication::instance()->quit(); | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | void MainHub::updateConfig() | 62 | void MainHub::updateConfig() | ||
63 | { | 63 | { | ||
64 | m_fileIndexScheduler.halt(); | ||||
65 | | ||||
64 | m_config->forceConfigUpdate(); | 66 | m_config->forceConfigUpdate(); | ||
65 | // FIXME!! | | |||
66 | //m_fileIndexer.updateConfig(); | | |||
67 | m_fileWatcher.updateIndexedFoldersWatches(); | 67 | m_fileWatcher.updateIndexedFoldersWatches(); | ||
68 | } | 68 | } | ||
69 | 69 | | |||
70 | void MainHub::registerBalooWatcher(const QString &service) | 70 | void MainHub::registerBalooWatcher(const QString &service) | ||
71 | { | 71 | { | ||
72 | m_fileWatcher.registerBalooWatcher(service); | 72 | m_fileWatcher.registerBalooWatcher(service); | ||
73 | } | 73 | } |