[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdevplatform] project: Fix deleting empty folders in git versioned project
From:       Niko Sams <niko.sams () gmail ! com>
Date:       2013-11-20 19:01:07
Message-ID: E1VjD1P-0000Cp-5k () scm ! kde ! org
[Download RAW message or body]

Git commit 7b48f259fb6e3eba081cc67df611949e4e03a719 by Niko Sams.
Committed on 20/11/2013 at 18:58.
Pushed by nsams into branch 'master'.

Fix deleting empty folders in git versioned project

I fixed this already a year ago but for some reason this got broken again.

M  +3    -2    project/helper.cpp

http://commits.kde.org/kdevplatform/7b48f259fb6e3eba081cc67df611949e4e03a719

diff --git a/project/helper.cpp b/project/helper.cpp
index fd8fa34..af30b86 100644
--- a/project/helper.cpp
+++ b/project/helper.cpp
@@ -29,6 +29,7 @@
 #include <kparts/mainwindow.h>
 =

 #include <QApplication>
+#include <QFileInfo>
 #include <interfaces/iproject.h>
 #include <vcs/interfaces/ibasicversioncontrol.h>
 #include <interfaces/iplugin.h>
@@ -59,8 +60,8 @@ bool KDevelop::removeUrl(const KDevelop::IProject* projec=
t, const KUrl& url, con
         }
     }
 =

-    //if we didn't find a VCS, we remove using KIO
-    if ( !KIO::NetAccess::del( url, window ) ) {
+    //if we didn't find a VCS, we remove using KIO (if the file still exis=
ts, the vcs plugin might have simply deleted the url without returning a job
+    if ( !KIO::NetAccess::del( url, window ) && url.isLocalFile() && (QFil=
eInfo(url.toLocalFile())).exists() ) {
         KMessageBox::error( window,
             isFolder ? i18n( "Cannot remove folder <i>%1</i>.", url.pathOr=
Url() )
                         : i18n( "Cannot remove file <i>%1</i>.", url.pathO=
rUrl() ) );
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic