| 72 | //TODO: Make sure to auto-add the executable target to the dependencies when its used. |
| 73 | |
| 74 | void NativeAppConfigPage::loadFromConfiguration(const KConfigGroup& cfg, KDevelop::IProject* project ) |
| 75 | { |
| 76 | QSignalBlocker blocker(this); |
| 77 | projectTarget->setBaseItem( project ? project->projectItem() : nullptr, true); |
| 78 | projectTarget->setCurrentItemPath( cfg.readEntry( ExecutePlugin::projectTargetEntry, QStringList() ) ); |
| 79 | |
| 80 | QUrl exe = cfg.readEntry( ExecutePlugin::executableEntry, QUrl()); |
| 81 | if( !exe.isEmpty() || project ){ |
| 82 | executablePath->setUrl( !exe.isEmpty() ? exe : project->path().toUrl() ); |
| 83 | }else{ |
| 84 | KDevelop::IProjectController* pc = KDevelop::ICore::self()->projectController(); |
| 85 | if( pc ){ |
| 86 | executablePath->setUrl( pc->projects().isEmpty() ? QUrl() : pc->projects().at(0)->path().toUrl() ); |
| 87 | } |
| 88 | } |
| 89 | dependencies->setSuggestion(project); |
| 90 | |
| 91 | //executablePath->setFilter("application/x-executable"); |
| 92 | |
| 93 | executableRadio->setChecked( true ); |
| 94 | if ( !cfg.readEntry( ExecutePlugin::isExecutableEntry, false ) && projectTarget->count() ){ |
| 95 | projectTargetRadio->setChecked( true ); |
| 96 | } |
| 97 | |
| 98 | arguments->setClearButtonEnabled( true ); |
| 99 | arguments->setText( cfg.readEntry( ExecutePlugin::argumentsEntry, "" ) ); |
| 100 | workingDirectory->setUrl( cfg.readEntry( ExecutePlugin::workingDirEntry, QUrl() ) ); |
| 101 | environment->setCurrentProfile(cfg.readEntry(ExecutePlugin::environmentProfileEntry, QString())); |
| 102 | runInTerminal->setChecked( cfg.readEntry( ExecutePlugin::useTerminalEntry, false ) ); |
| 103 | terminal->setEditText( cfg.readEntry( ExecutePlugin::terminalEntry, terminal->itemText(0) ) ); |
| 104 | dependencies->setDependencies(KDevelop::stringToQVariant( cfg.readEntry( ExecutePlugin::dependencyEntry, QString() ) ).toList()); |
| 105 | |
| 106 | dependencyAction->setCurrentIndex( dependencyAction->findData( cfg.readEntry( ExecutePlugin::dependencyActionEntry, "Nothing" ) ) ); |
| 107 | |
| 108 | if (cfg.readEntry<bool>(ExecutePlugin::configuredByCTest, false)) { |
| 109 | killBeforeStartingAgain->setCurrentIndex(killBeforeStartingAgain->findData(NativeAppJob::startAnother)); |
| 110 | killBeforeStartingAgain->setDisabled(true); |
| 111 | } else { |
| 112 | killBeforeStartingAgain->setCurrentIndex(killBeforeStartingAgain->findData(cfg.readEntry<int>(ExecutePlugin::killBeforeExecutingAgain, NativeAppJob::askIfRunning))); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | NativeAppConfigPage::NativeAppConfigPage( QWidget* parent ) |
| 117 | : LaunchConfigurationPage( parent ) |
nothing calls this directly
no test coverage detected