← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~carlos-mazieri/ubuntu-filemanager-app/open-remote-files-02 into lp:ubuntu-filemanager-app

 

Review: Approve

One small improvement suggestion in comments.

Diff comments:

> === modified file 'src/plugin/folderlistmodel/disk/disklocation.cpp'
> --- src/plugin/folderlistmodel/disk/disklocation.cpp	2015-07-15 17:42:37 +0000
> +++ src/plugin/folderlistmodel/disk/disklocation.cpp	2015-11-02 19:17:36 +0000
> @@ -216,8 +216,15 @@
>  {
>      bool ret = true;
>  #if defined(Q_OS_UNIX)
> +    QFileInfo info(pathname);
> +    bool   pathExists = info.exists();

Since this variable is never used outside the scope of the while, perhaps it would be clearer to just simplify the while loop to be:

while (!info.exists && info.absoluteFilePath() != QDir::rootPath())

and remove pathExists variable altogether.

> +    while (!pathExists && info.absoluteFilePath() != QDir::rootPath())
> +    {
> +        info.setFile(info.absolutePath());
> +        pathExists = info.exists();
> +    }
>      struct statvfs  vfs;
> -    if ( ::statvfs( QFile::encodeName(pathname).constData(), &vfs) == 0 )
> +    if ( ::statvfs( QFile::encodeName(info.absoluteFilePath()).constData(), &vfs) == 0 )
>      {
>          qint64 free =  vfs.f_bsize * vfs.f_bfree;
>          ret = free > requiredSize;


-- 
https://code.launchpad.net/~carlos-mazieri/ubuntu-filemanager-app/open-remote-files-02/+merge/276445
Your team Ubuntu File Manager Developers is subscribed to branch lp:ubuntu-filemanager-app.