| 314 | } |
| 315 | |
| 316 | int main( int argc, char *argv[] ) |
| 317 | { |
| 318 | QElapsedTimer timer; |
| 319 | timer.start(); |
| 320 | |
| 321 | // Useful for valgrind runs, just `export KDEV_DISABLE_JIT=1` |
| 322 | if (qEnvironmentVariableIsSet("KDEV_DISABLE_JIT")) { |
| 323 | qputenv("QT_ENABLE_REGEXP_JIT", "0"); |
| 324 | } |
| 325 | |
| 326 | #ifdef Q_OS_MAC |
| 327 | CFBundleRef mainBundle = CFBundleGetMainBundle(); |
| 328 | if (mainBundle) { |
| 329 | // get the application's Info Dictionary. For app bundles this would live in the bundle's Info.plist, |
| 330 | // for regular executables it is obtained in another way. |
| 331 | CFMutableDictionaryRef infoDict = (CFMutableDictionaryRef) CFBundleGetInfoDictionary(mainBundle); |
| 332 | if (infoDict) { |
| 333 | // Try to prevent App Nap on OS X. This can be tricky in practice, at least in 10.9 . |
| 334 | CFDictionarySetValue(infoDict, CFSTR("NSAppSleepDisabled"), kCFBooleanTrue); |
| 335 | CFDictionarySetValue(infoDict, CFSTR("NSSupportsAutomaticTermination"), kCFBooleanFalse); |
| 336 | } |
| 337 | } |
| 338 | #endif |
| 339 | |
| 340 | #if KICONTHEMES_VERSION >= QT_VERSION_CHECK(6, 3, 0) |
| 341 | KIconTheme::initTheme(); |
| 342 | #endif |
| 343 | |
| 344 | //we can't use KCmdLineArgs as it doesn't allow arguments for the debugee |
| 345 | //so lookup the --debug switch and eat everything behind by decrementing argc |
| 346 | //debugArgs is filled with args after --debug <debuger> |
| 347 | QStringList debugArgs; |
| 348 | QString debugeeName; |
| 349 | { |
| 350 | bool debugFound = false; |
| 351 | int c = argc; |
| 352 | for (int i=0; i < c; ++i) { |
| 353 | if (debugFound) { |
| 354 | debugArgs << QString::fromUtf8(argv[i]); |
| 355 | } else if ((qstrcmp(argv[i], "--debug") == 0) || (qstrcmp(argv[i], "-d") == 0)) { |
| 356 | if (argc > (i + 1)) { |
| 357 | i++; |
| 358 | } |
| 359 | argc = i + 1; |
| 360 | debugFound = true; |
| 361 | } else if (QByteArray(argv[i]).startsWith("--debug=")) { |
| 362 | argc = i + 1; |
| 363 | debugFound = true; |
| 364 | } |
| 365 | } |
| 366 | } |
| 367 | |
| 368 | KDevelopApplication app(argc, argv); |
| 369 | // Prevent SIGPIPE, then "ICE default IO error handler doing an exit(), pid = <PID>, errno = 32" |
| 370 | // crash when the first event loop starts at least 60 seconds after KDevelop launch. This can |
| 371 | // happen during a Debug Launch of KDevelop from KDevelop, especially if a breakpoint is hit |
| 372 | // before any event loop is entered. |
| 373 | QCoreApplication::processEvents(); |
nothing calls this directly
no test coverage detected