Fixed an issue introduced by the last change.

Wed, 22 Dec 2010 13:37:53 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 22 Dec 2010 13:37:53 +0100
changeset 22
a47afbacaeb5
parent 21
0e54b870314c
child 23
5a8744a77f78

Fixed an issue introduced by the last change.

AssistantEric/APIsManager.py file | annotate | diff | comparison | revisions
AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html file | annotate | diff | comparison | revisions
PluginAssistantEric.py file | annotate | diff | comparison | revisions
PluginAssistantEric.zip file | annotate | diff | comparison | revisions
--- a/AssistantEric/APIsManager.py	Wed Dec 22 10:31:26 2010 +0100
+++ b/AssistantEric/APIsManager.py	Wed Dec 22 13:37:53 2010 +0100
@@ -55,7 +55,7 @@
         DELETE FROM file WHERE id = :id
     """
     
-    def __init__(self, proxy, language, apiFiles, projectPath = ""):
+    def __init__(self, proxy, language, apiFiles, projectPath = "", refresh = False):
         """
         Constructor
         
@@ -64,6 +64,7 @@
         @param apiFiles list of API files to process (list of strings)
         @param projectPath path of the project. Only needed, if the APIs
             are extracted out of the sources of a project. (string)
+        @param refresh flag indicating a refresh of the APIs of one file (boolean)
         """
         QThread.__init__(self)
         
@@ -83,6 +84,7 @@
         self.__apiFiles = apiFiles[:]
         self.__aborted = False
         self.__projectPath = projectPath
+        self.__refresh = refresh
     
     def __autoCompletionWordSeparators(self, language):
         """
@@ -307,10 +309,11 @@
         db = QSqlDatabase.database(self.__language)
         if db.isValid() and db.isOpen():
             # step 1: remove API files not wanted any longer
-            loadedApiFiles = self.__proxy.getApiFiles()
-            for apiFile in loadedApiFiles:
-                if not self.__aborted and apiFile not in self.__apiFiles:
-                    self.__deleteApiFile(apiFile)
+            if not self.__refresh:
+                loadedApiFiles = self.__proxy.getApiFiles()
+                for apiFile in loadedApiFiles:
+                    if not self.__aborted and apiFile not in self.__apiFiles:
+                        self.__deleteApiFile(apiFile)
             
             # step 2: (re-)load api files
             for apiFile in self.__apiFiles:
@@ -747,7 +750,8 @@
                 apiFiles = [apiFiles[0].replace(projectPath + os.sep, "")]
             else:
                 projectPath = ""
-            self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath)
+            self.__worker = DbAPIsWorker(self, self.__language, apiFiles, projectPath, 
+                                         refresh = True)
             self.__worker.start()
     
     def getLexer(self):
--- a/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html	Wed Dec 22 10:31:26 2010 +0100
+++ b/AssistantEric/Documentation/source/Plugin_Assistant_Eric.AssistantEric.APIsManager.html	Wed Dec 22 13:37:53 2010 +0100
@@ -140,7 +140,7 @@
 QObject
 <h3>Class Attributes</h3>
 <table>
-<tr><td>DB_VERSION</td></tr><tr><td>ac_context_stmt</td></tr><tr><td>ac_stmt</td></tr><tr><td>apiPreparationCancelled</td></tr><tr><td>apiPreparationFinished</td></tr><tr><td>apiPreparationStarted</td></tr><tr><td>api_files_stmt</td></tr><tr><td>create_acWord_idx</td></tr><tr><td>create_api_stmt</td></tr><tr><td>create_context_idx</td></tr><tr><td>create_file_idx</td></tr><tr><td>create_file_stmt</td></tr><tr><td>create_fullContext_idx</td></tr><tr><td>create_mgmt_stmt</td></tr><tr><td>ct_context_stmt</td></tr><tr><td>ct_fullContext_stmt</td></tr><tr><td>ct_stmt</td></tr><tr><td>drop_acWord_idx</td></tr><tr><td>drop_api_stmt</td></tr><tr><td>drop_context_idx</td></tr><tr><td>drop_file_idx</td></tr><tr><td>drop_file_stmt</td></tr><tr><td>drop_fullContext_idx</td></tr><tr><td>drop_mgmt_stmt</td></tr><tr><td>format_select_stmt</td></tr><tr><td>mgmt_insert_stmt</td></tr>
+<tr><td>DB_VERSION</td></tr><tr><td>ac_context_stmt</td></tr><tr><td>ac_stmt</td></tr><tr><td>api_files_stmt</td></tr><tr><td>create_acWord_idx</td></tr><tr><td>create_api_stmt</td></tr><tr><td>create_context_idx</td></tr><tr><td>create_file_idx</td></tr><tr><td>create_file_stmt</td></tr><tr><td>create_fullContext_idx</td></tr><tr><td>create_mgmt_stmt</td></tr><tr><td>ct_context_stmt</td></tr><tr><td>ct_fullContext_stmt</td></tr><tr><td>ct_stmt</td></tr><tr><td>drop_acWord_idx</td></tr><tr><td>drop_api_stmt</td></tr><tr><td>drop_context_idx</td></tr><tr><td>drop_file_idx</td></tr><tr><td>drop_file_stmt</td></tr><tr><td>drop_fullContext_idx</td></tr><tr><td>drop_mgmt_stmt</td></tr><tr><td>format_select_stmt</td></tr><tr><td>mgmt_insert_stmt</td></tr>
 </table>
 <h3>Methods</h3>
 <table>
@@ -467,7 +467,7 @@
 </table>
 <a NAME="DbAPIsWorker.__init__" ID="DbAPIsWorker.__init__"></a>
 <h4>DbAPIsWorker (Constructor)</h4>
-<b>DbAPIsWorker</b>(<i>proxy, language, apiFiles, projectPath = ""</i>)
+<b>DbAPIsWorker</b>(<i>proxy, language, apiFiles, projectPath = "", refresh = False</i>)
 <p>
         Constructor
 </p><dl>
@@ -484,6 +484,9 @@
 <dd>
 path of the project. Only needed, if the APIs
             are extracted out of the sources of a project. (string)
+</dd><dt><i>refresh</i></dt>
+<dd>
+flag indicating a refresh of the APIs of one file (boolean)
 </dd>
 </dl><a NAME="DbAPIsWorker.__autoCompletionWordSeparators" ID="DbAPIsWorker.__autoCompletionWordSeparators"></a>
 <h4>DbAPIsWorker.__autoCompletionWordSeparators</h4>
--- a/PluginAssistantEric.py	Wed Dec 22 10:31:26 2010 +0100
+++ b/PluginAssistantEric.py	Wed Dec 22 13:37:53 2010 +0100
@@ -23,7 +23,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "2.1.0"
+version = "2.1.1"
 className = "AssistantEricPlugin"
 packageName = "AssistantEric"
 shortDescription = "Alternative autocompletion and calltips provider."
Binary file PluginAssistantEric.zip has changed

eric ide

mercurial