Changeset View
Changeset View
Standalone View
Standalone View
src/mainwindow.cpp
Show First 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | 126 | if (navigatorToolBar) { | |||
---|---|---|---|---|---|
131 | } | 131 | } | ||
132 | Q_ASSERT(navigatorToolBar->sizeHint().isValid()); | 132 | Q_ASSERT(navigatorToolBar->sizeHint().isValid()); | ||
133 | navigatorToolBar->setMinimumWidth(navigatorToolBar->sizeHint().width()); | 133 | navigatorToolBar->setMinimumWidth(navigatorToolBar->sizeHint().width()); | ||
134 | } else { | 134 | } else { | ||
135 | qCritical() << "Unable to find navigatorToolBar, probably kontactui.rc is missing"; | 135 | qCritical() << "Unable to find navigatorToolBar, probably kontactui.rc is missing"; | ||
136 | } | 136 | } | ||
137 | } | 137 | } | ||
138 | 138 | | |||
139 | void MainWindow::waitForKSycoca() | | |||
140 | { | | |||
141 | int i = 0; | | |||
142 | while (i < KSYCOCA_WAIT_TIMEOUT) { | | |||
143 | if (KSycoca::isAvailable()) { | | |||
144 | return; | | |||
145 | } | | |||
146 | // When KSycoca is not available that usually means Kontact | | |||
147 | // was started before kded is done with it's first run | | |||
148 | // we want to block Kontact execution to | | |||
149 | // give Kded time to initialize and create the | | |||
150 | // System Configuration database necessary for further | | |||
151 | // Kontact startup | | |||
152 | qCDebug(KONTACT_LOG) << "Waiting for KSycoca"; | | |||
153 | #ifdef WIN32 | | |||
154 | Sleep(1000); | | |||
155 | #else | | |||
156 | sleep(1); | | |||
157 | #endif | | |||
158 | | ||||
159 | ++i; | | |||
160 | } | | |||
161 | // This should only happen if the distribution is broken | | |||
162 | qFatal("KSycoca unavailable. Kontact will be unable to find plugins."); | | |||
163 | } | | |||
164 | | ||||
165 | void MainWindow::initObject() | 139 | void MainWindow::initObject() | ||
166 | { | 140 | { | ||
167 | if (!KSycoca::isAvailable()) { | 141 | if (!KSycoca::isAvailable()) { | ||
168 | waitForKSycoca(); | 142 | qDebug() << "Trying to create ksycoca..."; | ||
mlaurent: qCDebug(...) ? | |||||
It's a rare case, which I think should actually print the debug line in debugging mode. Not much point in categorized logging for a single and rare startup debug message. dfaure: It's a rare case, which I think should actually print the debug line in debugging mode. Not… | |||||
143 | KSycoca::self()->ensureCacheValid(); | ||||
144 | if (!KSycoca::isAvailable()) { | ||||
145 | // This should only happen if the distribution is broken, or the disk full | ||||
146 | qFatal("KSycoca unavailable. Kontact will be unable to find plugins."); | ||||
147 | } | ||||
169 | } | 148 | } | ||
170 | KService::List offers = KServiceTypeTrader::self()->query( | 149 | KService::List offers = KServiceTypeTrader::self()->query( | ||
171 | QStringLiteral("Kontact/Plugin"), | 150 | QStringLiteral("Kontact/Plugin"), | ||
172 | QStringLiteral("[X-KDE-KontactPluginVersion] == %1").arg(KONTACT_PLUGIN_VERSION)); | 151 | QStringLiteral("[X-KDE-KontactPluginVersion] == %1").arg(KONTACT_PLUGIN_VERSION)); | ||
173 | mPluginInfos = KPluginInfo::fromServices( | 152 | mPluginInfos = KPluginInfo::fromServices( | ||
174 | offers, KConfigGroup(Prefs::self()->config(), "Plugins")); | 153 | offers, KConfigGroup(Prefs::self()->config(), "Plugins")); | ||
175 | 154 | | |||
176 | const KPluginInfo::List::Iterator end(mPluginInfos.end()); | 155 | const KPluginInfo::List::Iterator end(mPluginInfos.end()); | ||
▲ Show 20 Lines • Show All 922 Lines • Show Last 20 Lines |
qCDebug(...) ?