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

Proposed by Carlos Jose Mazieri on 2015-11-02
Status: Merged
Approved by: Arto Jalkanen on 2015-11-03
Approved revision: 494
Merged at revision: 495
Proposed branch: lp:~carlos-mazieri/ubuntu-filemanager-app/open-remote-files-02
Merge into: lp:ubuntu-filemanager-app
Prerequisite: lp:~carlos-mazieri/ubuntu-filemanager-app/open-remote-files-01
Diff against target: 20 lines (+8/-1)
1 file modified
src/plugin/folderlistmodel/disk/disklocation.cpp (+8/-1)
To merge this branch: bzr merge lp:~carlos-mazieri/ubuntu-filemanager-app/open-remote-files-02
Reviewer Review Type Date Requested Status
Arto Jalkanen 2015-11-02 Approve on 2015-11-03
Jenkins Bot continuous-integration Approve on 2015-11-02
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve on 2015-11-02
Review via email: mp+276445@code.launchpad.net

Commit message

improved DiskLocation::isThereDiskSpace() to work for files even they do not exist.

Description of the change

improved DiskLocation::isThereDiskSpace() to work for files even they do not exist.

To post a comment you must log in.
review: Approve (continuous-integration)
review: Approve (continuous-integration)
Arto Jalkanen (ajalkane) wrote :

One small improvement suggestion in comments.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/plugin/folderlistmodel/disk/disklocation.cpp'
2--- src/plugin/folderlistmodel/disk/disklocation.cpp 2015-07-15 17:42:37 +0000
3+++ src/plugin/folderlistmodel/disk/disklocation.cpp 2015-11-02 19:17:36 +0000
4@@ -216,8 +216,15 @@
5 {
6 bool ret = true;
7 #if defined(Q_OS_UNIX)
8+ QFileInfo info(pathname);
9+ bool pathExists = info.exists();
10+ while (!pathExists && info.absoluteFilePath() != QDir::rootPath())
11+ {
12+ info.setFile(info.absolutePath());
13+ pathExists = info.exists();
14+ }
15 struct statvfs vfs;
16- if ( ::statvfs( QFile::encodeName(pathname).constData(), &vfs) == 0 )
17+ if ( ::statvfs( QFile::encodeName(info.absoluteFilePath()).constData(), &vfs) == 0 )
18 {
19 qint64 free = vfs.f_bsize * vfs.f_bfree;
20 ret = free > requiredSize;

Subscribers

People subscribed via source and target branches