Changeset View
Changeset View
Standalone View
Standalone View
src/file/mainhub.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 35 | { | |||
---|---|---|---|---|---|
46 | MainAdaptor* main = new MainAdaptor(this); | 46 | MainAdaptor* main = new MainAdaptor(this); | ||
47 | Q_UNUSED(main) | 47 | Q_UNUSED(main) | ||
48 | 48 | | |||
49 | QDBusConnection bus = QDBusConnection::sessionBus(); | 49 | QDBusConnection bus = QDBusConnection::sessionBus(); | ||
50 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | 50 | bus.registerObject(QStringLiteral("/"), this, QDBusConnection::ExportAllSlots | | ||
51 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | 51 | QDBusConnection::ExportScriptableSignals | QDBusConnection::ExportAdaptors); | ||
52 | 52 | | |||
53 | if (!m_config->isInitialRun()) { | 53 | if (!m_config->isInitialRun()) { | ||
54 | m_fileIndexScheduler.scheduleCheckUnindexedFiles(); | 54 | // Delay these checks so we don't end up consuming excessive resources on login | ||
55 | m_fileIndexScheduler.scheduleCheckStaleIndexEntries(); | 55 | QTimer::singleShot(5000, this, [this] { | ||
56 | m_fileIndexScheduler.checkUnindexedFiles(); | ||||
57 | m_fileIndexScheduler.checkStaleIndexEntries(); | ||||
58 | }); | ||||
56 | } | 59 | } | ||
57 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | 60 | QTimer::singleShot(0, &m_fileWatcher, &FileWatch::watchIndexedFolders); | ||
58 | } | 61 | } | ||
59 | 62 | | |||
60 | void MainHub::quit() const | 63 | void MainHub::quit() const | ||
61 | { | 64 | { | ||
62 | QCoreApplication::instance()->quit(); | 65 | QCoreApplication::instance()->quit(); | ||
63 | } | 66 | } | ||
Show All 12 Lines |