Commit 481a323d authored by André Wöbbeking's avatar André Wöbbeking
Browse files

changed ProtocolView::jobFinished(bool success) to

jobFinished(bool normalExit, int exitStatus). Need this for CVS as
exitStatus == 1 only means that there're conflicts.

svn path=/trunk/kdesdk/cervisia/; revision=198991
parent af4371a3
...@@ -742,8 +742,8 @@ void CervisiaPart::slotStatus() ...@@ -742,8 +742,8 @@ void CervisiaPart::slotStatus()
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(receivedLine(QString)), update, SLOT(processUpdateLine(QString)) ); connect( protocol, SIGNAL(receivedLine(QString)), update, SLOT(processUpdateLine(QString)) );
connect( protocol, SIGNAL(jobFinished(bool)), update, SLOT(finishJob(bool)) ); connect( protocol, SIGNAL(jobFinished(bool, int)), update, SLOT(finishJob(bool, int)) );
connect( protocol, SIGNAL(jobFinished(bool)), this, SLOT(slotJobFinished(bool)) ); connect( protocol, SIGNAL(jobFinished(bool, int)), this, SLOT(slotJobFinished()) );
} }
} }
...@@ -857,8 +857,8 @@ void CervisiaPart::updateSandbox(const QString &extraopt) ...@@ -857,8 +857,8 @@ void CervisiaPart::updateSandbox(const QString &extraopt)
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(receivedLine(QString)), update, SLOT(processUpdateLine(QString)) ); connect( protocol, SIGNAL(receivedLine(QString)), update, SLOT(processUpdateLine(QString)) );
connect( protocol, SIGNAL(jobFinished(bool)), update, SLOT(finishJob(bool)) ); connect( protocol, SIGNAL(jobFinished(bool, int)), update, SLOT(finishJob(bool, int)) );
connect( protocol, SIGNAL(jobFinished(bool)), this, SLOT(slotJobFinished(bool)) ); connect( protocol, SIGNAL(jobFinished(bool, int)), this, SLOT(slotJobFinished()) );
} }
} }
...@@ -935,10 +935,10 @@ void CervisiaPart::commitOrAddOrRemove(CommitDialog::ActionType action) ...@@ -935,10 +935,10 @@ void CervisiaPart::commitOrAddOrRemove(CommitDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
update, SLOT(finishJob(bool)) ); update, SLOT(finishJob(bool, int)) );
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1055,8 +1055,8 @@ void CervisiaPart::addOrRemoveWatch(WatchDialog::ActionType action) ...@@ -1055,8 +1055,8 @@ void CervisiaPart::addOrRemoveWatch(WatchDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1077,8 +1077,8 @@ void CervisiaPart::slotShowWatchers() ...@@ -1077,8 +1077,8 @@ void CervisiaPart::slotShowWatchers()
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1096,8 +1096,8 @@ void CervisiaPart::slotEdit() ...@@ -1096,8 +1096,8 @@ void CervisiaPart::slotEdit()
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1116,8 +1116,8 @@ void CervisiaPart::slotUnedit() ...@@ -1116,8 +1116,8 @@ void CervisiaPart::slotUnedit()
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1135,8 +1135,8 @@ void CervisiaPart::slotLock() ...@@ -1135,8 +1135,8 @@ void CervisiaPart::slotLock()
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1154,8 +1154,8 @@ void CervisiaPart::slotUnlock() ...@@ -1154,8 +1154,8 @@ void CervisiaPart::slotUnlock()
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1173,8 +1173,8 @@ void CervisiaPart::slotShowEditors() ...@@ -1173,8 +1173,8 @@ void CervisiaPart::slotShowEditors()
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1270,8 +1270,8 @@ void CervisiaPart::importOrCheckout(CheckoutDialog::ActionType action) ...@@ -1270,8 +1270,8 @@ void CervisiaPart::importOrCheckout(CheckoutDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1323,8 +1323,8 @@ void CervisiaPart::createOrDeleteTag(TagDialog::ActionType action) ...@@ -1323,8 +1323,8 @@ void CervisiaPart::createOrDeleteTag(TagDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline)) if (protocol->startJob(sandbox, repository, cmdline))
{ {
showJobStart(cmdline); showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)), connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished(bool)) ); this, SLOT(slotJobFinished()) );
} }
} }
...@@ -1485,7 +1485,7 @@ void CervisiaPart::showJobStart(const QString &cmdline) ...@@ -1485,7 +1485,7 @@ void CervisiaPart::showJobStart(const QString &cmdline)
} }
void CervisiaPart::slotJobFinished(bool) void CervisiaPart::slotJobFinished()
{ {
actionCollection()->action( "stop_job" )->setEnabled( false ); actionCollection()->action( "stop_job" )->setEnabled( false );
hasRunningJob = false; hasRunningJob = false;
......
...@@ -127,7 +127,7 @@ public slots: ...@@ -127,7 +127,7 @@ public slots:
void slotCVSInfo(); void slotCVSInfo();
protected slots: protected slots:
void slotJobFinished(bool /*success*/); void slotJobFinished();
private slots: private slots:
// called by menu action "Open Sandbox..." // called by menu action "Open Sandbox..."
......
...@@ -103,7 +103,7 @@ bool ProtocolView::startJob(const QString &sandbox, const QString &repository, ...@@ -103,7 +103,7 @@ bool ProtocolView::startJob(const QString &sandbox, const QString &repository,
SLOT(receivedOutput(KProcess *, char *, int)) ); SLOT(receivedOutput(KProcess *, char *, int)) );
disconnect( SIGNAL(receivedLine(QString)) ); disconnect( SIGNAL(receivedLine(QString)) );
disconnect( SIGNAL(jobFinished(bool)) ); disconnect( SIGNAL(jobFinished(bool, int)) );
return childproc->start(KProcess::NotifyOnExit, return childproc->start(KProcess::NotifyOnExit,
KProcess::Communication(KProcess::Stdout|KProcess::Stderr)); KProcess::Communication(KProcess::Stdout|KProcess::Stderr));
...@@ -120,8 +120,8 @@ bool ProtocolView::startJob() ...@@ -120,8 +120,8 @@ bool ProtocolView::startJob()
// disconnect 3rd party slots from our signals // disconnect 3rd party slots from our signals
disconnect( SIGNAL(receivedLine(QString)) ); disconnect( SIGNAL(receivedLine(QString)) );
disconnect( SIGNAL(jobFinished(bool)) ); disconnect( SIGNAL(jobFinished(bool, int)) );
return job->execute(); return job->execute();
} }
...@@ -156,7 +156,7 @@ void ProtocolView::childExited() ...@@ -156,7 +156,7 @@ void ProtocolView::childExited()
buf += '\n'; buf += '\n';
buf += s; buf += s;
processOutput(); processOutput();
emit jobFinished(childproc->normalExit() && !childproc->exitStatus()); emit jobFinished(childproc->normalExit(), childproc->exitStatus());
delete childproc; delete childproc;
childproc = 0; childproc = 0;
} }
...@@ -169,14 +169,14 @@ void ProtocolView::slotReceivedOutput(QString buffer) ...@@ -169,14 +169,14 @@ void ProtocolView::slotReceivedOutput(QString buffer)
} }
void ProtocolView::slotJobExited(bool normalExit, int status) void ProtocolView::slotJobExited(bool normalExit, int exitStatus)
{ {
QString msg; QString msg;
if( normalExit ) if( normalExit )
{ {
if( status ) if( exitStatus )
msg = i18n("[Exited with status %1]\n").arg(status); msg = i18n("[Exited with status %1]\n").arg(exitStatus);
else else
msg = i18n("[Finished]\n"); msg = i18n("[Finished]\n");
} }
...@@ -187,7 +187,7 @@ void ProtocolView::slotJobExited(bool normalExit, int status) ...@@ -187,7 +187,7 @@ void ProtocolView::slotJobExited(bool normalExit, int status)
buf += msg; buf += msg;
processOutput(); processOutput();
emit jobFinished(normalExit && !status); emit jobFinished(normalExit, exitStatus);
} }
......
...@@ -38,11 +38,11 @@ public: ...@@ -38,11 +38,11 @@ public:
k_dcop: k_dcop:
void slotReceivedOutput(QString buffer); void slotReceivedOutput(QString buffer);
void slotJobExited(bool normalExit, int status); void slotJobExited(bool normalExit, int exitStatus);
signals: signals:
void receivedLine(QString line); void receivedLine(QString line);
void jobFinished(bool success); void jobFinished(bool normalExit, int exitStatus);
protected: protected:
void mousePressEvent(QMouseEvent *e); void mousePressEvent(QMouseEvent *e);
......
...@@ -968,8 +968,10 @@ void UpdateView::prepareJob(bool recursive, Action action) ...@@ -968,8 +968,10 @@ void UpdateView::prepareJob(bool recursive, Action action)
* Finishes a job. What we do depends a bit on * Finishes a job. What we do depends a bit on
* whether the command was successful or not. * whether the command was successful or not.
*/ */
void UpdateView::finishJob(bool success) void UpdateView::finishJob(bool normalExit, int exitStatus)
{ {
// cvs exitStatus == 1 only means that there're conflicts
const bool success(normalExit && (exitStatus == 0 || exitStatus == 1));
if (act != Add) if (act != Add)
markUpdated(true, success); markUpdated(true, success);
syncSelection(); syncSelection();
......
...@@ -66,7 +66,7 @@ signals: ...@@ -66,7 +66,7 @@ signals:
public slots: public slots:
void unfoldTree(); void unfoldTree();
void foldTree(); void foldTree();
void finishJob(bool success); void finishJob(bool normalExit, int exitStatus);
void processUpdateLine(QString line); void processUpdateLine(QString line);
protected: protected:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment