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 | | |||
134 | if (libphase > 1) { | ||||
135 | libphase = 1; | ||||
136 | } | ||||
137 | | ||||
davidedmundson: can you add
if (libphase > 1 )
libphase = 1
just in case of some hypothetical 3rd party… | |||||
134 | if( phase != -1 && libphase != phase ) | 138 | if( phase != -1 && libphase != phase ) | ||
135 | continue; | 139 | continue; | ||
136 | 140 | | |||
137 | // try to load the library | 141 | // try to load the library | ||
138 | if (!m_alreadyInitialized.contains(library)) { | 142 | if (!m_alreadyInitialized.contains(library)) { | ||
139 | runModule(library, service); | 143 | runModule(library, service); | ||
140 | m_alreadyInitialized.insert(library); | 144 | m_alreadyInitialized.insert(library); | ||
141 | } | 145 | } | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 184 | if( startup ) { | |||
188 | QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage); | 192 | QDBusConnection::sessionBus().asyncCall(ksplashProgressMessage); | ||
189 | 193 | | |||
190 | sendReady(); | 194 | sendReady(); | ||
191 | QTimer::singleShot( 300 * 1000, qApp, &QCoreApplication::quit); // just in case | 195 | QTimer::singleShot( 300 * 1000, qApp, &QCoreApplication::quit); // just in case | ||
192 | 196 | | |||
193 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/kcminit"), this, QDBusConnection::ExportScriptableContents); | 197 | QDBusConnection::sessionBus().registerObject(QStringLiteral("/kcminit"), this, QDBusConnection::ExportScriptableContents); | ||
194 | QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kcminit")); | 198 | QDBusConnection::sessionBus().registerService(QStringLiteral("org.kde.kcminit")); | ||
195 | 199 | | |||
196 | qApp->exec(); // wait for runPhase1() and runPhase2() | 200 | qApp->exec(); // wait for runPhase1() | ||
197 | } | 201 | } | ||
198 | else | 202 | else | ||
199 | runModules( -1 ); // all phases | 203 | runModules( -1 ); // all phases | ||
200 | } | 204 | } | ||
201 | 205 | | |||
202 | KCMInit::~KCMInit() | 206 | KCMInit::~KCMInit() | ||
203 | { | 207 | { | ||
204 | sendReady(); | 208 | sendReady(); | ||
205 | } | 209 | } | ||
206 | 210 | | |||
207 | void KCMInit::runPhase1() | 211 | void KCMInit::runPhase1() | ||
208 | { | 212 | { | ||
209 | runModules( 1 ); | 213 | runModules( 1 ); | ||
210 | } | | |||
211 | | ||||
212 | void KCMInit::runPhase2() | | |||
213 | { | | |||
214 | runModules( 2 ); | | |||
215 | qApp->exit( 0 ); | 214 | qApp->exit(0); | ||
216 | } | 215 | } | ||
217 | 216 | | |||
218 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[]) | 217 | extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[]) | ||
219 | { | 218 | { | ||
220 | // kdeinit waits for kcminit to finish, but during KDE startup | 219 | // kdeinit waits for kcminit to finish, but during KDE startup | ||
221 | // only important kcm's are started very early in the login process, | 220 | // 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 | 221 | // the rest is delayed, so fork and make parent return after the initial phase | ||
223 | pipe( ready ); | 222 | pipe( ready ); | ||
Show All 29 Lines |
can you add
if (libphase > 1 )
libphase = 1
just in case of some hypothetical 3rd party out there