diff options
Diffstat (limited to 'rbutil/rbutilqt/base/uninstall.cpp')
-rw-r--r-- | rbutil/rbutilqt/base/uninstall.cpp | 34 |
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) | |||
26 | m_mountpoint = mountpoint; | 26 | m_mountpoint = mountpoint; |
27 | } | 27 | } |
28 | 28 | ||
29 | void Uninstaller::deleteAll(ProgressloggerInterface* dp) | 29 | void Uninstaller::deleteAll(void) |
30 | { | 30 | { |
31 | m_dp = dp; | ||
32 | QString rbdir(m_mountpoint + ".rockbox/"); | 31 | QString rbdir(m_mountpoint + ".rockbox/"); |
33 | m_dp->addItem(tr("Starting Uninstallation"),LOGINFO); | 32 | emit logItem(tr("Starting Uninstallation"), LOGINFO); |
34 | m_dp->setProgressMax(0); | 33 | emit logProgress(0, 0); |
35 | Utils::recursiveRmdir(rbdir); | 34 | Utils::recursiveRmdir(rbdir); |
36 | m_dp->setProgressMax(1); | 35 | emit logProgress(1, 1); |
37 | m_dp->setProgressValue(1); | 36 | emit logItem(tr("Finished Uninstallation"), LOGOK); |
38 | m_dp->addItem(tr("Finished Uninstallation"),LOGOK); | 37 | emit logFinished(); |
39 | m_dp->setFinished(); | ||
40 | } | 38 | } |
41 | 39 | ||
42 | void Uninstaller::uninstall(ProgressloggerInterface* dp) | 40 | void Uninstaller::uninstall(void) |
43 | { | 41 | { |
44 | m_dp = dp; | 42 | emit logProgress(0, 0); |
45 | m_dp->setProgressMax(0); | 43 | emit logItem(tr("Starting Uninstallation"), LOGINFO); |
46 | m_dp->addItem(tr("Starting Uninstallation"),LOGINFO); | ||
47 | 44 | ||
48 | QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, this); | 45 | QSettings installlog(m_mountpoint + "/.rockbox/rbutil.log", QSettings::IniFormat, this); |
49 | 46 | ||
50 | for(int i=0; i< uninstallSections.size() ; i++) | 47 | for(int i=0; i< uninstallSections.size() ; i++) |
51 | { | 48 | { |
52 | m_dp->addItem(tr("Uninstalling %1...").arg(uninstallSections.at(i)), LOGINFO); | 49 | emit logItem(tr("Uninstalling %1...").arg(uninstallSections.at(i)), LOGINFO); |
53 | QCoreApplication::processEvents(); | 50 | QCoreApplication::processEvents(); |
54 | // create list of all other install sections | 51 | // create list of all other install sections |
55 | QStringList sections = installlog.childGroups(); | 52 | QStringList sections = installlog.childGroups(); |
@@ -80,8 +77,8 @@ void Uninstaller::uninstall(ProgressloggerInterface* dp) | |||
80 | if(toDelete.isFile()) // if it is a file remove it | 77 | if(toDelete.isFile()) // if it is a file remove it |
81 | { | 78 | { |
82 | if(deleteFile && !QFile::remove(toDelete.filePath())) | 79 | if(deleteFile && !QFile::remove(toDelete.filePath())) |
83 | m_dp->addItem(tr("Could not delete %1") | 80 | emit logItem(tr("Could not delete %1") |
84 | .arg(toDelete.filePath()),LOGWARNING); | 81 | .arg(toDelete.filePath()), LOGWARNING); |
85 | installlog.remove(toDeleteList.at(j)); | 82 | installlog.remove(toDeleteList.at(j)); |
86 | qDebug() << "deleted: " << toDelete.filePath() ; | 83 | qDebug() << "deleted: " << toDelete.filePath() ; |
87 | } | 84 | } |
@@ -108,10 +105,9 @@ void Uninstaller::uninstall(ProgressloggerInterface* dp) | |||
108 | } | 105 | } |
109 | uninstallSections.clear(); | 106 | uninstallSections.clear(); |
110 | installlog.sync(); | 107 | installlog.sync(); |
111 | m_dp->setProgressMax(1); | 108 | emit logProgress(1, 1); |
112 | m_dp->setProgressValue(1); | 109 | emit logItem(tr("Uninstallation finished"), LOGOK); |
113 | m_dp->addItem(tr("Uninstallation finished"),LOGOK); | 110 | emit logFinished(); |
114 | m_dp->setFinished(); | ||
115 | } | 111 | } |
116 | 112 | ||
117 | QStringList Uninstaller::getAllSections() | 113 | QStringList Uninstaller::getAllSections() |