Commit d0e44d17 authored by Raphael Kubo da Costa's avatar Raphael Kubo da Costa
Browse files

Finally fix the problem with Ark never quitting when not using the GUI.

We don't need startApplication; a simple correct connection to
KJob::result seems to work well.

svn path=/trunk/KDE/kdeutils/ark/; revision=982336
parent 5f7fdd08
......@@ -104,11 +104,7 @@ int main(int argc, char **argv)
KCmdLineArgs::addCmdLineOptions(option);
KCmdLineArgs::addTempFileOption();
// We call application.exec() only when not using batch creation/extraction
bool startApplication = true;
KApplication application;
application.setQuitOnLastWindowClosed(false);
//session restoring
......@@ -132,9 +128,8 @@ int main(int argc, char **argv)
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
if (args->isSet("add") || args->isSet("add-to")) {
startApplication = false;
AddToArchive *addToArchiveJob = new AddToArchive();
AddToArchive *addToArchiveJob = new AddToArchive;
application.connect(addToArchiveJob, SIGNAL(result(KJob*)), SLOT(quit()));
if (args->isSet("changetofirstpath")) {
addToArchiveJob->setChangeToFirstPath(true);
......@@ -161,11 +156,10 @@ int main(int argc, char **argv)
addToArchiveJob->start();
} else if (args->isSet("batch")) {
startApplication = false;
//once the job has been started this interface can be safely
//deleted
BatchExtract *batchJob = new BatchExtract();
BatchExtract *batchJob = new BatchExtract;
application.connect(batchJob, SIGNAL(result(KJob*)), SLOT(quit()));
for (int i = 0; i < args->count(); ++i) {
batchJob->addInput(args->url(i));
......@@ -217,10 +211,6 @@ int main(int argc, char **argv)
}
}
if (startApplication) {
kDebug(1601) << "Entering application loop";
return application.exec();
}
return 0;
kDebug(1601) << "Entering application loop";
return application.exec();
}
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