Changeset View
Changeset View
Standalone View
Standalone View
shell/projectcontroller.cpp
Show All 32 Lines | |||||
33 | #include <QPushButton> | 33 | #include <QPushButton> | ||
34 | #include <QRadioButton> | 34 | #include <QRadioButton> | ||
35 | #include <QSet> | 35 | #include <QSet> | ||
36 | #include <QTemporaryFile> | 36 | #include <QTemporaryFile> | ||
37 | #include <QVBoxLayout> | 37 | #include <QVBoxLayout> | ||
38 | 38 | | |||
39 | #include <KActionCollection> | 39 | #include <KActionCollection> | ||
40 | #include <KConfigGroup> | 40 | #include <KConfigGroup> | ||
41 | #include <KIO/DeleteJob> | ||||
41 | #include <KIO/FileCopyJob> | 42 | #include <KIO/FileCopyJob> | ||
42 | #include <KIO/ListJob> | 43 | #include <KIO/ListJob> | ||
43 | #include <KIO/StatJob> | 44 | #include <KIO/StatJob> | ||
44 | #include <KJobWidgets> | 45 | #include <KJobWidgets> | ||
45 | #include <KLocalizedString> | 46 | #include <KLocalizedString> | ||
46 | #include <KMessageBox> | 47 | #include <KMessageBox> | ||
47 | #include <KPassivePopup> | 48 | #include <KPassivePopup> | ||
48 | #include <KRecentFilesAction> | 49 | #include <KRecentFilesAction> | ||
▲ Show 20 Lines • Show All 432 Lines • ▼ Show 20 Line(s) | 481 | { | |||
481 | return QUrl(); | 482 | return QUrl(); | ||
482 | } // else fall through and write new file | 483 | } // else fall through and write new file | ||
483 | } else { | 484 | } else { | ||
484 | writeProjectConfigToFile = false; | 485 | writeProjectConfigToFile = false; | ||
485 | } | 486 | } | ||
486 | } | 487 | } | ||
487 | 488 | | |||
488 | if (writeProjectConfigToFile) { | 489 | if (writeProjectConfigToFile) { | ||
490 | Path projectConfigDir = Path(projectFileUrl); | ||||
mwolff: `Path(projectFileUrl).setLastPathSegment(QStringLiteral(".kdev4)).toUrl()`
Does this work too? | |||||
kfunk: ... or simply `Path projectConfigDir(projectFileUrl);` | |||||
491 | projectConfigDir.setLastPathSegment(QStringLiteral(".kdev4")); | ||||
492 | auto delJob = KIO::del(projectConfigDir.toUrl()); | ||||
493 | delJob->exec(); | ||||
494 | | ||||
489 | if (!writeProjectSettingsToConfigFile(projectFileUrl, &dlg)) { | 495 | if (!writeProjectSettingsToConfigFile(projectFileUrl, &dlg)) { | ||
490 | KMessageBox::error(d->m_core->uiControllerInternal()->defaultMainWindow(), | 496 | KMessageBox::error(d->m_core->uiControllerInternal()->defaultMainWindow(), | ||
491 | i18n("Unable to create configuration file %1", projectFileUrl.url())); | 497 | i18n("Unable to create configuration file %1", projectFileUrl.url())); | ||
492 | return QUrl(); | 498 | return QUrl(); | ||
493 | } | 499 | } | ||
494 | } | 500 | } | ||
495 | return projectFileUrl; | 501 | return projectFileUrl; | ||
496 | } | 502 | } | ||
▲ Show 20 Lines • Show All 739 Lines • Show Last 20 Lines |
Path(projectFileUrl).setLastPathSegment(QStringLiteral(".kdev4)).toUrl()
Does this work too? I personally find that easier to understand.