MCPcopy Create free account
hub / github.com/KDE/kdevelop / loadFromConfiguration

Method loadFromConfiguration

plugins/execute/nativeappconfig.cpp:74–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72//TODO: Make sure to auto-add the executable target to the dependencies when its used.
73
74void 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
116NativeAppConfigPage::NativeAppConfigPage( QWidget* parent )
117 : LaunchConfigurationPage( parent )

Callers

nothing calls this directly

Calls 15

QStringListClass · 0.85
stringToQVariantFunction · 0.85
setCurrentItemPathMethod · 0.80
readEntryMethod · 0.80
projectControllerMethod · 0.80
projectsMethod · 0.80
setDependenciesMethod · 0.80
setCurrentIndexMethod · 0.80
QUrlClass · 0.70
QStringClass · 0.50
setBaseItemMethod · 0.45
projectItemMethod · 0.45

Tested by

no test coverage detected