D5754: Make it possible to open directories from the command line

Kevin Funk noreply at phabricator.kde.org
Mon May 8 08:01:08 UTC 2017


kfunk added subscribers: cullmann, kfunk.
kfunk added a comment.


  LGTM to me in general.
  
  That's something @cullmann wanted to have for KDevelop, btw. Maybe he's interested in testing? :)

INLINE COMMENTS

> main.cpp:143
> +            QVector<UrlInfo> files, directories;
> +            for(const auto &info: infos)
> +                if (info.isDirectory())

Style: `for (const auto& info : ...)`

> main.cpp:150
>              openFiles(infos);
> +            for(const auto &urlinfo: infos)
> +                ICore::self()->projectController()->openProjectForUrl(urlinfo.url);

Consistency: `info`

> main.cpp:508
>      foreach (const QString &file, parser.positionalArguments()) {
> -        initialFiles.append(UrlInfo(file));
> +        UrlInfo uinfo(file);
> +        if (uinfo.isDirectory()) {

`uinfo` -> `urlInfo` or `info`

> main.cpp:773
> +
> +        for(const auto &urlinfo: initialDirectories)
> +            core->projectController()->openProjectForUrl(urlinfo.url);

Style & naming: `for (const auto& initialDirectory : ...`

> urlinfo.h:91
> +    {
> +        return url.isLocalFile() && QDir(url.toLocalFile()).exists() && !cursor.isValid();
> +    }

Rather: `QFileInfo(...).isDir()`? More lightweight I think.

REPOSITORY
  R32 KDevelop

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

To: apol, #kdevelop, vhanda
Cc: kfunk, cullmann, zhigalin, kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170508/e0aeba03/attachment-0001.html>


More information about the KDevelop-devel mailing list