Permalink
Browse files

Fix up the error detection for the AppCafe process manager, make sure…

… it checks return codes instead of just the process error flag.
  • Loading branch information...
1 parent f6bee85 commit dee1bcb34b1f28ffae8f477cd5369e92193ce42d Ken Moore committed Aug 22, 2013
Showing with 5 additions and 5 deletions.
  1. +1 −1 src-qt4/pc-softwaremanager/pbiBackend.h
  2. +4 −4 src-qt4/pc-softwaremanager/processManager.cpp
@@ -98,7 +98,7 @@ public slots:
//variables - processes
ProcessManager *PMAN;
QString cDownload, cInstall, cRemove, cUpdate, cDownloadFile, cOther; //currently running command/pbi
- bool sDownload, sInstall, sRemove, sUpdate; //flag that these processes were Stopped
+ bool sDownload, sInstall, sRemove, sUpdate,; //flag that these processes were Stopped
QStringList PENDINGDL, PENDINGINSTALL, PENDINGREMOVAL, PENDINGUPDATE, PENDINGOTHER;
QString lDownload, lInstall, lRemove, lUpdate; //latest string output from process
//variables - other
@@ -232,7 +232,7 @@ void ProcessManager::slotRemProcMessage(){
}
void ProcessManager::slotRemProcFinished(){
- if(remProc->exitStatus() != QProcess::NormalExit){
+ if(remProc->exitStatus() != QProcess::NormalExit || remProc->exitCode() != 0){
qDebug() << "Removal Process Error Log:\n"<<remLog.join("\n");
emit ProcessError(REMOVE, remLog);
}else{
@@ -260,7 +260,7 @@ void ProcessManager::slotDlProcMessage(){
}
void ProcessManager::slotDlProcFinished(){
- if(dlProc->exitStatus() != QProcess::NormalExit){
+ if(dlProc->exitStatus() != QProcess::NormalExit || dlProc->exitCode() != 0){
qDebug() << "Download Process Error Log:\n"<<dlLog.join("\n");
emit ProcessError(DOWNLOAD, dlLog);
}else{
@@ -281,7 +281,7 @@ void ProcessManager::slotInProcMessage(){
}
void ProcessManager::slotInProcFinished(){
- if(inProc->exitStatus() != QProcess::NormalExit){
+ if(inProc->exitStatus() != QProcess::NormalExit || inProc->exitCode() != 0){
qDebug() << "Install Process Error Log:\n"<<inLog.join("\n");
emit ProcessError(INSTALL, inLog);
}else{
@@ -297,7 +297,7 @@ void ProcessManager::slotOtProcMessage(){
}
void ProcessManager::slotOtProcFinished(){
- if(otProc->exitStatus() != QProcess::NormalExit){
+ if(otProc->exitStatus() != QProcess::NormalExit || otProc->exitCode() != 0){
QString msg = otProc->readAllStandardError();
if(msg.isEmpty()){ msg = otProc->readAllStandardOutput(); }
if(msg.isEmpty()){ msg = tr("Unknown Error"); }

0 comments on commit dee1bcb

Please sign in to comment.