From: Peter Penz Date: Tue, 10 Nov 2009 18:36:13 +0000 (+0000) Subject: never report a success if there was none: check the exit code + status X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/a47dc8edae84ae571ff364351d493cec0be9d3f3 never report a success if there was none: check the exit code + status svn path=/trunk/KDE/kdebase/apps/; revision=1047233 --- diff --git a/src/versioncontrol/fileviewsvnplugin.cpp b/src/versioncontrol/fileviewsvnplugin.cpp index 7e56c724c..91a37a878 100644 --- a/src/versioncontrol/fileviewsvnplugin.cpp +++ b/src/versioncontrol/fileviewsvnplugin.cpp @@ -309,9 +309,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 +346,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())); diff --git a/src/versioncontrol/fileviewsvnplugin.h b/src/versioncontrol/fileviewsvnplugin.h index 4804971c0..e908afba8 100644 --- a/src/versioncontrol/fileviewsvnplugin.h +++ b/src/versioncontrol/fileviewsvnplugin.h @@ -23,6 +23,7 @@ #include #include #include +#include #include // TODO: This class will be moved to kdevplatform as soon as kdevplatform will @@ -49,7 +50,7 @@ private slots: void addFiles(); void removeFiles(); - void slotOperationCompleted(); + void slotOperationCompleted(int exitCode, QProcess::ExitStatus exitStatus); void slotOperationError(); private: