diff --git a/shell/projectcontroller.cpp b/shell/projectcontroller.cpp --- a/shell/projectcontroller.cpp +++ b/shell/projectcontroller.cpp @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -486,6 +487,11 @@ } if (writeProjectConfigToFile) { + Path projectConfigDir = Path(projectFileUrl); + projectConfigDir.setLastPathSegment(QStringLiteral(".kdev4")); + auto delJob = KIO::del(projectConfigDir.toUrl()); + delJob->exec(); + if (!writeProjectSettingsToConfigFile(projectFileUrl, &dlg)) { KMessageBox::error(d->m_core->uiControllerInternal()->defaultMainWindow(), i18n("Unable to create configuration file %1", projectFileUrl.url()));