]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/versioncontrol/fileviewsvnplugin.cpp
removed unused member variable (the dependency to DolphinMainWindow has been removed...
[dolphin.git] / src / versioncontrol / fileviewsvnplugin.cpp
index 7e56c724c3b8738aadf3b4af5ab6a4bbcebb4363..60ab8141596247a59346ec01fab0fe9e3382fb88 100644 (file)
@@ -102,6 +102,15 @@ bool FileViewSvnPlugin::beginRetrieval(const QString& directory)
 {
     Q_ASSERT(directory.endsWith('/'));
 
+    // clear all entries for this directory
+    QMutableHashIterator<QString, VersionState> it(m_versionInfoHash);
+    while (it.hasNext()) {
+        it.next();
+        if (it.key().startsWith(directory)) {
+            it.remove();
+        }
+    }
+
     QStringList arguments;
     arguments << "status" << "--show-updates" << directory;
 
@@ -309,9 +318,11 @@ void FileViewSvnPlugin::removeFiles()
                    i18nc("@info:status", "Removed files from SVN repository."));
 }
 
-void FileViewSvnPlugin::slotOperationCompleted()
+void FileViewSvnPlugin::slotOperationCompleted(int exitCode, QProcess::ExitStatus exitStatus)
 {
-    if (m_contextItems.isEmpty()) {
+    if ((exitStatus != QProcess::NormalExit) || (exitCode != 0)) {
+        emit errorMessage(m_errorMsg);
+    } else if (m_contextItems.isEmpty()) {
         emit operationCompletedMessage(m_operationCompletedMsg);
         emit versionStatesChanged();
     } else {
@@ -344,8 +355,8 @@ void FileViewSvnPlugin::execSvnCommand(const QString& svnCommand,
 void FileViewSvnPlugin::startSvnCommandProcess()
 {
     QProcess* process = new QProcess(this);
-    connect(process, SIGNAL(finished(int)),
-            this, SLOT(slotOperationCompleted()));
+    connect(process, SIGNAL(finished(int, QProcess::ExitStatus)),
+            this, SLOT(slotOperationCompleted(int, QProcess::ExitStatus)));
     connect(process, SIGNAL(error(QProcess::ProcessError)),
             this, SLOT(slotOperationError()));