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

Method executable

plugins/execute/executeplugin.cpp:113–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111
112
113QUrl ExecutePlugin::executable( KDevelop::ILaunchConfiguration* cfg, QString& err ) const
114{
115 QUrl executable;
116 if( !cfg )
117 {
118 return executable;
119 }
120 KConfigGroup grp = cfg->config();
121 if( grp.readEntry(ExecutePlugin::isExecutableEntry, false ) )
122 {
123 executable = grp.readEntry( ExecutePlugin::executableEntry, QUrl() );
124 } else
125 {
126 QStringList prjitem = grp.readEntry( ExecutePlugin::projectTargetEntry, QStringList() );
127 KDevelop::ProjectModel* model = KDevelop::ICore::self()->projectController()->projectModel();
128 KDevelop::ProjectBaseItem* item = model->itemFromIndex( model->pathToIndex(prjitem) );
129 if( item && item->executable() )
130 {
131 // TODO: Need an option in the gui to choose between installed and builddir url here, currently cmake only supports builddir url
132 executable = item->executable()->builtUrl();
133 }
134 }
135
136 // Do not pass err to splitLocalFileLaunchConfigurationEntry(), because it may be nonempty from the beginning.
137 QString initiallyEmptyErrorMessage;
138 splitLocalFileLaunchConfigurationEntry(
139 *cfg, executable,
140 LaunchConfigurationEntryName{"executable path", i18nc("path to an executable", "executable path")},
141 initiallyEmptyErrorMessage);
142 if (initiallyEmptyErrorMessage.isEmpty()) {
143 return executable;
144 }
145
146 err = std::move(initiallyEmptyErrorMessage);
147 return {};
148}
149
150
151bool ExecutePlugin::useTerminal( KDevelop::ILaunchConfiguration* cfg ) const

Callers 8

canLaunchMethod · 0.45
launcherSuggestionsMethod · 0.45
NativeAppJobMethod · 0.45
startDebuggingMethod · 0.45
initializeStartupInfoMethod · 0.45
JobMethod · 0.45

Calls 11

QStringListClass · 0.85
readEntryMethod · 0.80
projectControllerMethod · 0.80
pathToIndexMethod · 0.80
QUrlClass · 0.70
configMethod · 0.45
projectModelMethod · 0.45
itemFromIndexMethod · 0.45
builtUrlMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected