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
=== 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 @@
216{216{
217 bool ret = true;217 bool ret = true;
218#if defined(Q_OS_UNIX)218#if defined(Q_OS_UNIX)
219 QFileInfo info(pathname);
220 bool pathExists = info.exists();
221 while (!pathExists && info.absoluteFilePath() != QDir::rootPath())
222 {
223 info.setFile(info.absolutePath());
224 pathExists = info.exists();
225 }
219 struct statvfs vfs;226 struct statvfs vfs;
220 if ( ::statvfs( QFile::encodeName(pathname).constData(), &vfs) == 0 )227 if ( ::statvfs( QFile::encodeName(info.absoluteFilePath()).constData(), &vfs) == 0 )
221 {228 {
222 qint64 free = vfs.f_bsize * vfs.f_bfree;229 qint64 free = vfs.f_bsize * vfs.f_bfree;
223 ret = free > requiredSize;230 ret = free > requiredSize;

Subscribers

People subscribed via source and target branches