summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/uninstall.cpp
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-06-11 17:14:00 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-06-11 17:14:00 +0000
commita1209350d4c54767d374bc8ae6035050ef99155e (patch)
treee634cb009e0aeb62f9a4688b8a31fc645ae0a596 /rbutil/rbutilqt/base/uninstall.cpp
parentf2e048493e59ec824d99fb9b3b077b42daa128c6 (diff)
downloadrockbox-a1209350d4c54767d374bc8ae6035050ef99155e.tar.gz
rockbox-a1209350d4c54767d374bc8ae6035050ef99155e.tar.bz2
rockbox-a1209350d4c54767d374bc8ae6035050ef99155e.zip
Convert uninstallation to use signals / slots for logging.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26782 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/rbutilqt/base/uninstall.cpp')
-rw-r--r--rbutil/rbutilqt/base/uninstall.cpp34
1 files changed, 15 insertions, 19 deletions
diff --git a/rbutil/rbutilqt/base/uninstall.cpp b/rbutil/rbutilqt/base/uninstall.cpp
index 2f3b3c767f..14674837d9 100644
--- a/rbutil/rbutilqt/base/uninstall.cpp
+++ b/rbutil/rbutilqt/base/uninstall.cpp
@@ -26,30 +26,27 @@ Uninstaller::Uninstaller(QObject* parent,QString mountpoint): QObject(parent)
m_mountpoint = mountpoint;
}
-void Uninstaller::deleteAll(ProgressloggerInterface* dp)
+void Uninstaller::deleteAll(void)
{
- m_dp = dp;
QString rbdir(m_mountpoint + ".rockbox/");
- m_dp->addItem(tr("Starting Uninstallation"),LOGINFO);
- m_dp->setProgressMax(0);
+ emit logItem(tr("Starting Uninstallation"), LOGINFO);
+ emit logProgress(0, 0);
Utils::recursiveRmdir(rbdir);
- m_dp->setProgressMax(1);
- m_dp->setProgressValue(1);
- m_dp->addItem(tr("Finished Uninstallation"),LOGOK);
- m_dp->setFinished();
+ emit logProgress(1, 1);
+ emit logItem(tr("Finished Uninstallation"), LOGOK);
+ emit logFinished();
}
-void Uninstaller::uninstall(ProgressloggerInterface* dp)
+void Uninstaller::uninstall(void)
{
- m_dp = dp;
- m_dp->setProgressMax(0);
- m_dp->addItem(tr("Starting Uninstallation"),LOGINFO);
+ emit logProgress(0, 0);
+ emit logItem(tr("Starting Uninstallation"), LOGINFO);
QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, this);
for(int i=0; i< uninstallSections.size() ; i++)
{
- m_dp->addItem(tr("Uninstalling %1...").arg(uninstallSections.at(i)), LOGINFO);
+ emit logItem(tr("Uninstalling %1...").arg(uninstallSections.at(i)), LOGINFO);
QCoreApplication::processEvents();
// create list of all other install sections
QStringList sections = installlog.childGroups();
@@ -80,8 +77,8 @@ void Uninstaller::uninstall(ProgressloggerInterface* dp)
if(toDelete.isFile()) // if it is a file remove it
{
if(deleteFile && !QFile::remove(toDelete.filePath()))
- m_dp->addItem(tr("Could not delete %1")
- .arg(toDelete.filePath()),LOGWARNING);
+ emit logItem(tr("Could not delete %1")
+ .arg(toDelete.filePath()), LOGWARNING);
installlog.remove(toDeleteList.at(j));
qDebug() << "deleted: " << toDelete.filePath() ;
}
@@ -108,10 +105,9 @@ void Uninstaller::uninstall(ProgressloggerInterface* dp)
}
uninstallSections.clear();
installlog.sync();
- m_dp->setProgressMax(1);
- m_dp->setProgressValue(1);
- m_dp->addItem(tr("Uninstallation finished"),LOGOK);
- m_dp->setFinished();
+ emit logProgress(1, 1);
+ emit logItem(tr("Uninstallation finished"), LOGOK);
+ emit logFinished();
}
QStringList Uninstaller::getAllSections()