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 | connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, &m_fileIndexScheduler, &FileIndexScheduler::halt); | 47 | connect(QCoreApplication::instance(), &QCoreApplication::aboutToQuit, &m_fileIndexScheduler, &FileIndexScheduler::halt); | ||
48 | 48 | | |||
49 | MainAdaptor* main = new MainAdaptor(this); | 49 | MainAdaptor* main = new MainAdaptor(this); | ||
50 | Q_UNUSED(main) | 50 | Q_UNUSED(main) | ||
51 | 51 | | |||
52 | QDBusConnection bus = QDBusConnection::sessionBus(); | 52 | QDBusConnection bus = QDBusConnection::sessionBus(); | ||
53 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | 53 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | ||
54 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | 54 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | ||
55 | 55 | | |||
56 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | 56 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | void MainHub::quit() const | 59 | void MainHub::quit() const | ||
60 | { | 60 | { | ||
61 | QCoreApplication::instance()->quit(); | 61 | QCoreApplication::instance()->quit(); | ||
62 | } | 62 | } | ||
63 | 63 | | |||
64 | void MainHub::updateConfig() | 64 | void MainHub::updateConfig() | ||
65 | { | 65 | { | ||
66 | m_fileIndexScheduler.halt(); | 66 | m_fileIndexScheduler.halt(); | ||
67 | 67 | | |||
68 | m_config->forceConfigUpdate(); | 68 | m_config->forceConfigUpdate(); | ||
69 | // FIXME!! | | |||
70 | //m_fileIndexer.updateConfig(); | | |||
71 | m_fileWatcher.updateIndexedFoldersWatches(); | 69 | m_fileWatcher.updateIndexedFoldersWatches(); | ||
72 | } | 70 | } | ||
73 | 71 | | |||
74 | void MainHub::registerBalooWatcher(const QString &service) | 72 | void MainHub::registerBalooWatcher(const QString &service) | ||
75 | { | 73 | { | ||
76 | m_fileWatcher.registerBalooWatcher(service); | 74 | m_fileWatcher.registerBalooWatcher(service); | ||
77 | } | 75 | } |