PluginAssistantEric.py

changeset 63
f8acb1de2200
parent 61
b88fd1352be6
child 65
71f50b4cc169
diff -r 1b0491135c52 -r f8acb1de2200 PluginAssistantEric.py
--- a/PluginAssistantEric.py	Fri Sep 28 18:01:37 2012 +0200
+++ b/PluginAssistantEric.py	Tue Nov 06 17:43:14 2012 +0100
@@ -88,14 +88,15 @@
     """
     Module function to prepare for an uninstallation.
     """
-    assistant = AssistantEricPlugin(None)
-    assistant.prepareUninstall()
+    Preferences.Prefs.settings.remove(AssistantEricPlugin.PreferencesKey)
     
 
 class AssistantEricPlugin(QObject):
     """
     Class implementing the Eric assistant plugin.
     """
+    PreferencesKey = "AssistantEric"
+    
     def __init__(self, ui):
         """
         Constructor
@@ -225,10 +226,10 @@
                    "CalltipsEnabled", "CallTipsContextShown",
                    "CallTipsFollowHierarchy"]:
             return Preferences.toBool(Preferences.Prefs.settings.value(
-                "AssistantEric/" + key, self.__defaults[key]))
+                self.PreferencesKey + "/" + key, self.__defaults[key]))
         else:
-            return int(Preferences.Prefs.settings.value("AssistantEric/" + key,
-                self.__defaults[key]))
+            return int(Preferences.Prefs.settings.value(
+                self.PreferencesKey + "/" + key, self.__defaults[key]))
     
     def setPreferences(self, key, value):
         """
@@ -238,13 +239,7 @@
         @param value the value to be set
         @param prefClass preferences class used as the storage area
         """
-        Preferences.Prefs.settings.setValue("AssistantEric/" + key, value)
+        Preferences.Prefs.settings.setValue(self.PreferencesKey + "/" + key, value)
         
         if key in ["AutoCompletionEnabled", "CalltipsEnabled"]:
             self.__object.setEnabled(key, value)
-    
-    def prepareUninstall(self):
-        """
-        Public method to prepare for an uninstallation.
-        """
-        Preferences.Prefs.settings.remove("AssistantEric")

eric ide

mercurial