Changeset View
Changeset View
Standalone View
Standalone View
app/main.cpp
Show First 20 Lines • Show All 422 Lines • ▼ Show 20 Line(s) | 309 | #endif | |||
---|---|---|---|---|---|
423 | parser.addOption(QCommandLineOption{QStringList{"rm", "remove-session"}, i18n("Delete the given session.\n" | 423 | parser.addOption(QCommandLineOption{QStringList{"rm", "remove-session"}, i18n("Delete the given session.\n" | ||
424 | "You can pass either hash or the name of the session." ), "session"}); | 424 | "You can pass either hash or the name of the session." ), "session"}); | ||
425 | parser.addOption(QCommandLineOption{QStringList{"ps", "pick-session"}, i18n("Shows all available sessions and lets you select one to open.")}); | 425 | parser.addOption(QCommandLineOption{QStringList{"ps", "pick-session"}, i18n("Shows all available sessions and lets you select one to open.")}); | ||
426 | parser.addOption(QCommandLineOption{QStringList{"pss", "pick-session-shell"}, i18n("List all available sessions on shell and lets you select one to open.")}); | 426 | parser.addOption(QCommandLineOption{QStringList{"pss", "pick-session-shell"}, i18n("List all available sessions on shell and lets you select one to open.")}); | ||
427 | parser.addOption(QCommandLineOption{QStringList{"l", "list-sessions"}, i18n("List available sessions and quit.")}); | 427 | parser.addOption(QCommandLineOption{QStringList{"l", "list-sessions"}, i18n("List available sessions and quit.")}); | ||
428 | parser.addOption(QCommandLineOption{QStringList{"p", "project"}, i18n("Open KDevelop and load the given project."), "project"}); | 428 | parser.addOption(QCommandLineOption{QStringList{"p", "project"}, i18n("Open KDevelop and load the given project."), "project"}); | ||
429 | parser.addOption(QCommandLineOption{QStringList{"d", "debug"}, | 429 | parser.addOption(QCommandLineOption{QStringList{"d", "debug"}, | ||
430 | i18n("Start debugging an application in KDevelop with the given debugger.\n" | 430 | i18n("Start debugging an application in KDevelop with the given debugger.\n" | ||
431 | "The binary that should be debugged must follow - including arguments.\n" | 431 | "The executable that should be debugged must follow - including arguments.\n" | ||
432 | "Example: kdevelop --debug gdb myapp --foo bar"), "debugger"}); | 432 | "Example: kdevelop --debug gdb myapp --foo bar"), "debugger"}); | ||
433 | 433 | | |||
434 | // this is used by the 'kdevelop!' script to retrieve the pid of a KDEVELOP | 434 | // this is used by the 'kdevelop!' script to retrieve the pid of a KDEVELOP | ||
435 | // instance. When this is called, then we should just print the PID on the | 435 | // instance. When this is called, then we should just print the PID on the | ||
436 | // standard-output. If a session is specified through open-session, then | 436 | // standard-output. If a session is specified through open-session, then | ||
437 | // we should return the PID of that session. Otherwise, if only a single | 437 | // we should return the PID of that session. Otherwise, if only a single | ||
438 | // session is running, then we should just return the PID of that session. | 438 | // session is running, then we should just return the PID of that session. | ||
439 | // Otherwise, we should print a command-line session-chooser dialog ("--pss"), | 439 | // Otherwise, we should print a command-line session-chooser dialog ("--pss"), | ||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 551 | { | |||
553 | session = KDevelop::SessionController::showSessionChooserDialog(i18n("Select the session you would like to use"), onlyRunning); | 553 | session = KDevelop::SessionController::showSessionChooserDialog(i18n("Select the session you would like to use"), onlyRunning); | ||
554 | if(session.isEmpty()) | 554 | if(session.isEmpty()) | ||
555 | return 1; | 555 | return 1; | ||
556 | } | 556 | } | ||
557 | 557 | | |||
558 | if ( parser.isSet("debug") ) { | 558 | if ( parser.isSet("debug") ) { | ||
559 | if ( debugArgs.isEmpty() ) { | 559 | if ( debugArgs.isEmpty() ) { | ||
560 | QTextStream qerr(stderr); | 560 | QTextStream qerr(stderr); | ||
561 | qerr << endl << i18nc("@info:shell", "Specify the binary you want to debug.") << endl; | 561 | qerr << endl << i18nc("@info:shell", "Specify the executable you want to debug.") << endl; | ||
562 | return 1; | 562 | return 1; | ||
563 | } | 563 | } | ||
564 | 564 | | |||
565 | QFileInfo binaryInfo(debugArgs.first()); | 565 | QFileInfo executableFileInfo(debugArgs.first()); | ||
566 | if (!binaryInfo.exists()) { | 566 | if (!executableFileInfo.exists()) { | ||
567 | binaryInfo = QStandardPaths::findExecutable(debugArgs.first()); | 567 | executableFileInfo = QStandardPaths::findExecutable(debugArgs.first()); | ||
568 | if (!binaryInfo.exists()) { | 568 | if (!executableFileInfo.exists()) { | ||
569 | QTextStream qerr(stderr); | 569 | QTextStream qerr(stderr); | ||
570 | qerr << endl << i18nc("@info:shell", "Specified binary does not exist.") << endl; | 570 | qerr << endl << i18nc("@info:shell", "Specified executable does not exist.") << endl; | ||
571 | return 1; | 571 | return 1; | ||
572 | } | 572 | } | ||
573 | } | 573 | } | ||
574 | 574 | | |||
575 | debugArgs.first() = binaryInfo.absoluteFilePath(); | 575 | debugArgs.first() = executableFileInfo.absoluteFilePath(); | ||
576 | debugeeName = i18n("Debug %1", binaryInfo.fileName()); | 576 | debugeeName = i18n("Debug %1", executableFileInfo.fileName()); | ||
577 | session = debugeeName; | 577 | session = debugeeName; | ||
578 | } else if ( parser.isSet("new-session") ) | 578 | } else if ( parser.isSet("new-session") ) | ||
579 | { | 579 | { | ||
580 | session = parser.value("new-session"); | 580 | session = parser.value("new-session"); | ||
581 | foreach(const KDevelop::SessionInfo& si, availableSessionInfos) | 581 | foreach(const KDevelop::SessionInfo& si, availableSessionInfos) | ||
582 | { | 582 | { | ||
583 | if ( session == si.name ) { | 583 | if ( session == si.name ) { | ||
584 | QTextStream qerr(stderr); | 584 | QTextStream qerr(stderr); | ||
▲ Show 20 Lines • Show All 173 Lines • Show Last 20 Lines |