Changeset View
Changeset View
Standalone View
Standalone View
startkde/kcminit/main.cpp
Show First 20 Lines • Show All 124 Lines • ▼ Show 20 Line(s) | 108 | for (const KService::Ptr & service : qAsConst(m_list)) { | |||
---|---|---|---|---|---|
125 | } | 125 | } | ||
126 | 126 | | |||
127 | // see ksmserver's README for the description of the phases | 127 | // see ksmserver's README for the description of the phases | ||
128 | const QVariant vphase = service->property(QStringLiteral("X-KDE-Init-Phase"), QVariant::Int ); | 128 | const QVariant vphase = service->property(QStringLiteral("X-KDE-Init-Phase"), QVariant::Int ); | ||
129 | 129 | | |||
130 | int libphase = 1; | 130 | int libphase = 1; | ||
131 | if( vphase.isValid() ) | 131 | if( vphase.isValid() ) | ||
132 | libphase = vphase.toInt(); | 132 | libphase = vphase.toInt(); | ||
133 | 133 | | |||
davidedmundson: can you add
if (libphase > 1 )
libphase = 1
just in case of some hypothetical 3rd party… | |||||
134 | if( phase != -1 && libphase != phase ) | 134 | if( phase != -1 && libphase != phase ) | ||
135 | continue; | 135 | continue; | ||
136 | 136 | | |||
137 | // try to load the library | 137 | // try to load the library | ||
138 | if (!m_alreadyInitialized.contains(library)) { | 138 | if (!m_alreadyInitialized.contains(library)) { | ||
139 | runModule(library, service); | 139 | runModule(library, service); | ||
140 | m_alreadyInitialized.insert(library); | 140 | m_alreadyInitialized.insert(library); | ||
141 | } | 141 | } | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 180 | if( startup ) { | |||
188 | QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage); | 188 | QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage); | ||
189 | 189 | | |||
190 | sendReady(); | 190 | sendReady(); | ||
191 | QTimer::singleShot( 300 * 1000, qApp, &QCoreApplication::quit); // just in case | 191 | QTimer::singleShot( 300 * 1000, qApp, &QCoreApplication::quit); // just in case | ||
192 | 192 | | |||
193 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/kcminit"), this, QDBusConnection::ExportScriptableContents); | 193 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/kcminit"), this, QDBusConnection::ExportScriptableContents); | ||
194 | QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kcminit")); | 194 | QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kcminit")); | ||
195 | 195 | | |||
196 | qApp->exec(); // wait for runPhase1() and runPhase2() | 196 | qApp->exec(); // wait for runPhase1() | ||
197 | } | 197 | } | ||
198 | else | 198 | else | ||
199 | runModules( -1 ); // all phases | 199 | runModules( -1 ); // all phases | ||
200 | } | 200 | } | ||
201 | 201 | | |||
202 | KCMInit::~KCMInit() | 202 | KCMInit::~KCMInit() | ||
203 | { | 203 | { | ||
204 | sendReady(); | 204 | sendReady(); | ||
205 | } | 205 | } | ||
206 | 206 | | |||
207 | void KCMInit::runPhase1() | 207 | void KCMInit::runPhase1() | ||
208 | { | 208 | { | ||
209 | runModules( 1 ); | 209 | runModules( 1 ); | ||
210 | } | | |||
211 | | ||||
212 | void KCMInit::runPhase2() | | |||
213 | { | | |||
214 | runModules( 2 ); | | |||
215 | qApp->exit( 0 ); | 210 | qApp->exit(0); | ||
216 | } | 211 | } | ||
217 | 212 | | |||
218 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[]) | 213 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[]) | ||
219 | { | 214 | { | ||
220 | // kdeinit waits for kcminit to finish, but during KDE startup | 215 | // kdeinit waits for kcminit to finish, but during KDE startup | ||
221 | // only important kcm's are started very early in the login process, | 216 | // only important kcm's are started very early in the login process, | ||
222 | // the rest is delayed, so fork and make parent return after the initial phase | 217 | // the rest is delayed, so fork and make parent return after the initial phase | ||
223 | pipe( ready ); | 218 | pipe( ready ); | ||
Show All 29 Lines |
can you add
if (libphase > 1 )
libphase = 1
just in case of some hypothetical 3rd party out there