Changeset View
Changeset View
Standalone View
Standalone View
app/main.cpp
Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Line(s) | 204 | if ( ! result.value() ) { | |||
---|---|---|---|---|---|
206 | err << i18n("Could not open file %1.", file.url.toDisplayString(QUrl::PreferLocalFile)) << "\n"; | 206 | err << i18n("Could not open file %1.", file.url.toDisplayString(QUrl::PreferLocalFile)) << "\n"; | ||
207 | errors_occured = true; | 207 | errors_occured = true; | ||
208 | } | 208 | } | ||
209 | } | 209 | } | ||
210 | // make the window visible | 210 | // make the window visible | ||
211 | QDBusMessage makeVisible = QDBusMessage::createMethodCall( service, "/kdevelop/MainWindow", "org.kdevelop.MainWindow", | 211 | QDBusMessage makeVisible = QDBusMessage::createMethodCall( service, "/kdevelop/MainWindow", "org.kdevelop.MainWindow", | ||
212 | "ensureVisible" ); | 212 | "ensureVisible" ); | ||
213 | QDBusConnection::sessionBus().asyncCall( makeVisible ); | 213 | QDBusConnection::sessionBus().asyncCall( makeVisible ); | ||
214 | return errors_occured ? 1 : 0; | 214 | return errors_occured; | ||
215 | } | 215 | } | ||
216 | 216 | | |||
217 | /// Gets the PID of a running KDevelop instance, eventually asking the user if there is more than one. | 217 | /// Gets the PID of a running KDevelop instance, eventually asking the user if there is more than one. | ||
218 | /// Returns -1 in case there are no running sessions. | 218 | /// Returns -1 in case there are no running sessions. | ||
219 | static qint64 getRunningSessionPid() | 219 | static qint64 getRunningSessionPid() | ||
220 | { | 220 | { | ||
221 | SessionInfos candidates; | 221 | SessionInfos candidates; | ||
222 | foreach( const KDevelop::SessionInfo& si, KDevelop::SessionController::availableSessionInfos() ) { | 222 | foreach( const KDevelop::SessionInfo& si, KDevelop::SessionController::availableSessionInfos() ) { | ||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | 312 | #endif | |||
382 | QStringList debugArgs; | 382 | QStringList debugArgs; | ||
383 | QString debugeeName; | 383 | QString debugeeName; | ||
384 | { | 384 | { | ||
385 | bool debugFound = false; | 385 | bool debugFound = false; | ||
386 | int c = argc; | 386 | int c = argc; | ||
387 | for (int i=0; i < c; ++i) { | 387 | for (int i=0; i < c; ++i) { | ||
388 | if (debugFound) { | 388 | if (debugFound) { | ||
389 | debugArgs << argv[i]; | 389 | debugArgs << argv[i]; | ||
390 | } else if (qstrcmp(argv[i], "--debug") == 0 || qstrcmp(argv[i], "-d") == 0) { | 390 | } else if ((qstrcmp(argv[i], "--debug") == 0) || (qstrcmp(argv[i], "-d") == 0)) { | ||
391 | if (argc <= i+1) { | 391 | if (argc > (i + 1)) { | ||
392 | argc = i + 1; | | |||
393 | } else { | | |||
394 | i++; | 392 | i++; | ||
395 | argc = i + 1; | | |||
396 | } | 393 | } | ||
394 | argc = i + 1; | ||||
397 | debugFound = true; | 395 | debugFound = true; | ||
398 | } else if (QString(argv[i]).startsWith("--debug=")) { | 396 | } else if (QString(argv[i]).startsWith("--debug=")) { | ||
399 | argc = i + 1; | 397 | argc = i + 1; | ||
400 | debugFound = true; | 398 | debugFound = true; | ||
401 | } | 399 | } | ||
402 | } | 400 | } | ||
403 | } | 401 | } | ||
404 | 402 | | |||
▲ Show 20 Lines • Show All 360 Lines • Show Last 20 Lines |