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

Proposed by Carlos Jose Mazieri
Status: Merged
Approved by: Arto Jalkanen
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 Approve
Jenkins Bot continuous-integration Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
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.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
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