[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/knewstuff/knewstuff2
From:       Jeremy Paul Whiting <jeremy () scitools ! com>
Date:       2007-12-31 20:45:54
Message-ID: 1199133954.958081.28756.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 755261 by whiting:

take componentname from basename of config file, rather than from whole filename \
passed in (fixes registry issues in marble which puts knsrc file in non config \
location), also check uninstallation and show a warning, dont mark as removed, etc \
when it fails

 M  +8 -4      core/coreengine.cpp  
 M  +5 -4      ui/kdxsbutton.cpp  


--- trunk/KDE/kdelibs/knewstuff/knewstuff2/core/coreengine.cpp #755260:755261
@@ -96,7 +96,7 @@
     KConfigGroup group = conf.group("KNewStuff2");
     m_providersurl = group.readEntry("ProvidersUrl", QString());
     //m_componentname = group.readEntry("ComponentName", QString());
-    m_componentname = configfile.section(".", 0, 0) + ":";
+    m_componentname = QFileInfo(KStandardDirs::locate("config", \
configfile)).baseName() + ":";  
     // FIXME: add support for several categories later on
     // FIXME: read out only when actually installing as a performance improvement?
@@ -517,9 +517,9 @@
 {
     KStandardDirs d;
 
-    //kDebug(550) << "Loading registry in all directories named \
'knewstuff2-entries.registry'."; +    //kDebug(550) << "Loading registry of files for \
the component: " << m_componentname;  
-    QString realAppName = KGlobal::activeComponent().aboutData()->appName();
+    QString realAppName = m_componentname.split(":")[0];
 
     // this must be same as in registerEntry()
     QStringList dirs = d.findDirs("data", "knewstuff2-entries.registry");
@@ -1390,7 +1390,11 @@
     entry->setStatus(Entry::Deleted);
 
     foreach(QString file, entry->installedFiles()) {
-        QFile::remove(file);
+        bool worked = QFile::remove(file);
+        if (!worked) {
+            kWarning(550) << "unable to delete file " << file;
+            return false;
+        }
     }
     entry->setInstalledFiles(QStringList());
 
--- trunk/KDE/kdelibs/knewstuff/knewstuff2/ui/kdxsbutton.cpp #755260:755261
@@ -480,10 +480,11 @@
 	}
 	if(action == action_uninstall)
 	{
-		m_engine->uninstall(m_entry);
-		setText(i18n("Install"));
-		action_uninstall->setVisible(false);
-		action_install->setVisible(true);
+		if (m_engine->uninstall(m_entry)) {
+			setText(i18n("Install"));
+			action_uninstall->setVisible(false);
+			action_install->setVisible(true);
+		}
 	}
 	if(action == action_install)
 	{


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic