D9344: [KDevelop] : consistent use of the project name (WIP)

Milian Wolff noreply at phabricator.kde.org
Tue Apr 3 20:00:03 UTC 2018


mwolff requested changes to this revision.
mwolff added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> openprojectdialog.cpp:312
> +        // TODO: do an additional replace of QDir::separator() with "@"?
> +        QString safeName = m_projectName.replace(QRegExp("[\\\\/]"), QStringLiteral("@"));
> +        url.setPath(url.path() + '/' + safeName + '.' + ShellExtension::getInstance()->projectFileExtension());

use QRegularExpression, wrap pattern in QStringLiteral

> openprojectdialog.cpp:313
> +        QString safeName = m_projectName.replace(QRegExp("[\\\\/]"), QStringLiteral("@"));
> +        url.setPath(url.path() + '/' + safeName + '.' + ShellExtension::getInstance()->projectFileExtension());
> +        m_urlIsDirectory = false;

use QLatin1Char

> projectcontroller.cpp:443
>          // check whether config is equal
> -        bool shouldAsk = true;
> -        if( projectFileUrl == dlg->selectedUrl() )
> +        bool isKDevProject = QFileInfo(projectFileUrl.url()).completeSuffix() == QStringLiteral("kdev4");
> +        bool shouldAsk = !isKDevProject;

I don't get this change, can you explain? the old code checks whether the profileFileUrl (which should *always* ends on `.kdev4`, no?) exists. In that case, we want to ask the user if he wants to override, except if the project file is equal to what we'd write out anyways.

your change seems to completely break this, as isKDevProject should always be true, and then shouldAsk always false?

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D9344

To: rjvbb, #kdevelop, mwolff
Cc: mwolff, kdevelop-devel, antismap, iodelay, vbspam, njensen, geetamc, Pilzschaf, akshaydeo, surgenight, arrowdodger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180403/6ef28f0b/attachment.html>


More information about the KDevelop-devel mailing list