X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Futils%2Femuhelper.cpp;h=a816accd2e1beebb37ea9d197aa064c9fb0e07ff;hb=1f652abbee008f6130a6fec4df6839de583ac27a;hp=6642a40a045e71fb0e031bb685696939424fe22d;hpb=97d97d84592a5b65202892c5e6db216ec665c80a;p=emufront diff --git a/src/utils/emuhelper.cpp b/src/utils/emuhelper.cpp index 6642a40..a816acc 100644 --- a/src/utils/emuhelper.cpp +++ b/src/utils/emuhelper.cpp @@ -112,26 +112,27 @@ void EmuHelper::launch(const Executable * ex, QList micLi waitForFinished(-1); try { - QDir ftmp(tmp); - if (!ftmp.exists()) { - throw EmuFrontException(tr("Trying to remove temporary files. " - "Directory %s doesn't exist!").arg(tmp)); - } - // clean the temp dir - foreach(EmuFrontObject *ob, miList) { - if (!ftmp.exists(ob->getName())) { - qDebug() << "File " << ob->getName() << " doesn't exist in " << tmp; - continue; - } - QString fp = ftmp.filePath(ob->getName()); - QFile f(fp); - if (!f.exists()) { - qDebug() << "File " << fp << " doesn't exist!"; + QDir ftmp(tmp); + if (!ftmp.exists()) { + throw EmuFrontException(tr("Trying to remove temporary files. " + "Directory %s doesn't exist!").arg(tmp)); } - if (!f.remove()) { - qDebug() << "Removing " << fp << " failed."; + // clean the temp dir + // TODO: if selected archive with multiple items, the files are not removed! + foreach(EmuFrontObject *ob, miList) { + if (!ftmp.exists(ob->getName())) { + qDebug() << "File " << ob->getName() << " doesn't exist in " << tmp; + continue; + } + QString fp = ftmp.filePath(ob->getName()); + QFile f(fp); + if (!f.exists()) { + qDebug() << "File " << fp << " doesn't exist!"; + } + if (!f.remove()) { + qDebug() << "Removing " << fp << " failed."; + } } - } } catch (EmuFrontException e) { qDebug() << e.what(); }