Hier noch mal der komplette Code der Bereiche, die wohl die Schwierigkeiten machen.
Das gestern war aus dem Kopf und daher wohl etwas wenig aussagekräftig
Code:
void Kwickcdcopy::execute_process(QStringList my_processargs)
{
mle_log->clear();
my_process->setArguments(my_processargs);
connect( my_process , SIGNAL( readyReadStdout() ), this, SLOT ( readFromStdout() ) );
connect( my_process , SIGNAL( readyReadStderr() ), this, SLOT ( readFromStderr()) );
connect( my_process , SIGNAL( processExited() ), this, SLOT( process_end()) );
pb_copy->setEnabled(false);
if ( !my_process->start() ) KMessageBox::error(this, i18n("Ooops ! Process could not be started!\n\nThis shouldn't happen!"));
}
//////////////////////////////////////////
void Kwickcdcopy::readFromStderr()
{
mle_log->append(my_process->readStderr() );
}
/////////////////////////////////
void Kwickcdcopy::readFromStdout()
{
mle_log->append(my_process->readStdout() );
}
/////////////////////////////////////////
void Kwickcdcopy::process_end()
{
if (mle_log->find("finished successfully",true,true,true))
KMessageBox::information(this, i18n("CD successfully burned ! \n\nSee Log Tab for details ! \n"));
if (mle_log->find("ERROR: Unit not ready, giving up.",true,true,true))
KMessageBox::error(this, i18n("Unit not ready !\nProbably no Disc inserted. \n\nSee Log Tab for details ! \n"));
if (mle_log->find("ERROR",true,true,true))
KMessageBox::error(this, i18n("Ooops...\n\n... it seems an error has occured !\n\nSee Log Tab for details ! \n"));
pb_copy->setEnabled(true);
}
Wie gesagt, das Problem besteht darin, dass mit jedem Aufruf von execute_process(QStringList my_processargs)
die entsprechende KMessageBox aus process_end() einmal mehr angezeigt wird
und zwar immer dei richtige (also nicht etwa alle hintereinander)
Ich fürchte, es ist irgend ein ganz dummer kleiner Fehler, den ich aber nicht sehe.
Hoffe, ihr könnt helfen.
Gruß
Lesezeichen