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()
{
showJobStart(cmdline);
connect( protocol, SIGNAL(receivedLine(QString)), update, SLOT(processUpdateLine(QString)) );
connect( protocol, SIGNAL(jobFinished(bool)), update, SLOT(finishJob(bool)) );
connect( protocol, SIGNAL(jobFinished(bool)), this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)), update, SLOT(finishJob(bool, int)) );
connect( protocol, SIGNAL(jobFinished(bool, int)), this, SLOT(slotJobFinished()) );
}
}
......@@ -857,8 +857,8 @@ void CervisiaPart::updateSandbox(const QString &extraopt)
{
showJobStart(cmdline);
connect( protocol, SIGNAL(receivedLine(QString)), update, SLOT(processUpdateLine(QString)) );
connect( protocol, SIGNAL(jobFinished(bool)), update, SLOT(finishJob(bool)) );
connect( protocol, SIGNAL(jobFinished(bool)), this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)), update, SLOT(finishJob(bool, int)) );
connect( protocol, SIGNAL(jobFinished(bool, int)), this, SLOT(slotJobFinished()) );
}
}
......@@ -935,10 +935,10 @@ void CervisiaPart::commitOrAddOrRemove(CommitDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
update, SLOT(finishJob(bool)) );
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
update, SLOT(finishJob(bool, int)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1055,8 +1055,8 @@ void CervisiaPart::addOrRemoveWatch(WatchDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1077,8 +1077,8 @@ void CervisiaPart::slotShowWatchers()
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1096,8 +1096,8 @@ void CervisiaPart::slotEdit()
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1116,8 +1116,8 @@ void CervisiaPart::slotUnedit()
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1135,8 +1135,8 @@ void CervisiaPart::slotLock()
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1154,8 +1154,8 @@ void CervisiaPart::slotUnlock()
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1173,8 +1173,8 @@ void CervisiaPart::slotShowEditors()
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1270,8 +1270,8 @@ void CervisiaPart::importOrCheckout(CheckoutDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1323,8 +1323,8 @@ void CervisiaPart::createOrDeleteTag(TagDialog::ActionType action)
if (protocol->startJob(sandbox, repository, cmdline))
{
showJobStart(cmdline);
connect( protocol, SIGNAL(jobFinished(bool)),
this, SLOT(slotJobFinished(bool)) );
connect( protocol, SIGNAL(jobFinished(bool, int)),
this, SLOT(slotJobFinished()) );
}
}
......@@ -1485,7 +1485,7 @@ void CervisiaPart::showJobStart(const QString &cmdline)
}
void CervisiaPart::slotJobFinished(bool)
void CervisiaPart::slotJobFinished()
{
actionCollection()->action( "stop_job" )->setEnabled( false );
hasRunningJob = false;
......
......@@ -127,7 +127,7 @@ public slots:
void slotCVSInfo();
protected slots:
void slotJobFinished(bool /*success*/);
void slotJobFinished();
private slots:
// called by menu action "Open Sandbox..."
......
......@@ -103,7 +103,7 @@ bool ProtocolView::startJob(const QString &sandbox, const QString &repository,
SLOT(receivedOutput(KProcess *, char *, int)) );
disconnect( SIGNAL(receivedLine(QString)) );
disconnect( SIGNAL(jobFinished(bool)) );
disconnect( SIGNAL(jobFinished(bool, int)) );
return childproc->start(KProcess::NotifyOnExit,
KProcess::Communication(KProcess::Stdout|KProcess::Stderr));
......@@ -120,7 +120,7 @@ bool ProtocolView::startJob()
// disconnect 3rd party slots from our signals
disconnect( SIGNAL(receivedLine(QString)) );
disconnect( SIGNAL(jobFinished(bool)) );
disconnect( SIGNAL(jobFinished(bool, int)) );
return job->execute();
}
......@@ -156,7 +156,7 @@ void ProtocolView::childExited()
buf += '\n';
buf += s;
processOutput();
emit jobFinished(childproc->normalExit() && !childproc->exitStatus());
emit jobFinished(childproc->normalExit(), childproc->exitStatus());
delete childproc;
childproc = 0;
}
......@@ -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;
if( normalExit )
{
if( status )
msg = i18n("[Exited with status %1]\n").arg(status);
if( exitStatus )
msg = i18n("[Exited with status %1]\n").arg(exitStatus);
else
msg = i18n("[Finished]\n");
}
......@@ -187,7 +187,7 @@ void ProtocolView::slotJobExited(bool normalExit, int status)
buf += msg;
processOutput();
emit jobFinished(normalExit && !status);
emit jobFinished(normalExit, exitStatus);
}
......
......@@ -38,11 +38,11 @@ public:
k_dcop:
void slotReceivedOutput(QString buffer);
void slotJobExited(bool normalExit, int status);
void slotJobExited(bool normalExit, int exitStatus);
signals:
void receivedLine(QString line);
void jobFinished(bool success);
void jobFinished(bool normalExit, int exitStatus);
protected:
void mousePressEvent(QMouseEvent *e);
......
......@@ -968,8 +968,10 @@ void UpdateView::prepareJob(bool recursive, Action action)
* Finishes a job. What we do depends a bit on
* 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)
markUpdated(true, success);
syncSelection();
......
......@@ -66,7 +66,7 @@ signals:
public slots:
void unfoldTree();
void foldTree();
void finishJob(bool success);
void finishJob(bool normalExit, int exitStatus);
void processUpdateLine(QString line);
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