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

Function writeProjectSettingsToConfigFile

kdevplatform/shell/projectcontroller.cpp:379–399  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379bool writeProjectSettingsToConfigFile(const QUrl& projectFileUrl, OpenProjectDialog* dlg)
380{
381 if ( !projectFileUrl.isLocalFile() ) {
382 QTemporaryFile tmp;
383 if ( !tmp.open() ) {
384 return false;
385 }
386 if ( !writeNewProjectFile( tmp.fileName(), dlg->projectName(), dlg->selectedUrl().fileName(), dlg->projectManager() ) ) {
387 return false;
388 }
389 // explicitly close file before uploading it, see also: https://bugs.kde.org/show_bug.cgi?id=254519
390 tmp.close();
391
392 auto uploadJob = KIO::file_copy(QUrl::fromLocalFile(tmp.fileName()), projectFileUrl);
393 KJobWidgets::setWindow(uploadJob, Core::self()->uiControllerInternal()->defaultMainWindow());
394 return uploadJob->exec();
395 }
396 // Here and above we take .filename() part of the selectedUrl() to make it relative to the project root,
397 // thus keeping .kdev file relocatable
398 return writeNewProjectFile( projectFileUrl.toLocalFile(), dlg->projectName(), dlg->selectedUrl().fileName(), dlg->projectManager() );
399}
400
401
402bool projectFileExists( const QUrl& u )

Callers 1

Calls 12

writeNewProjectFileFunction · 0.85
isLocalFileMethod · 0.80
selectedUrlMethod · 0.80
projectManagerMethod · 0.80
defaultMainWindowMethod · 0.80
uiControllerInternalMethod · 0.80
execMethod · 0.80
toLocalFileMethod · 0.80
openMethod · 0.45
fileNameMethod · 0.45
projectNameMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected