Fixed a bug connecting/disconnecting the "editorSaved" signal of an editor. eric7 release-10.3.1

Sat, 07 Oct 2023 17:37:40 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 07 Oct 2023 17:37:40 +0200
branch
eric7
changeset 208
5c77d52e97cd
parent 207
e9742998c5d9
child 209
54d0a4770a76

Fixed a bug connecting/disconnecting the "editorSaved" signal of an editor.

AssistantEric/Assistant.py file | annotate | diff | comparison | revisions
ChangeLog file | annotate | diff | comparison | revisions
PluginAssistantEric.py file | annotate | diff | comparison | revisions
PluginAssistantEric.zip file | annotate | diff | comparison | revisions
--- a/AssistantEric/Assistant.py	Wed Aug 30 11:39:07 2023 +0200
+++ b/AssistantEric/Assistant.py	Sat Oct 07 17:37:40 2023 +0200
@@ -121,9 +121,8 @@
             self.__setAutoCompletionHook(editor)
         if self.__plugin.getPreferences("CalltipsEnabled"):
             self.__setCalltipsHook(editor)
-        editor.editorSaved.connect(
-            self.__apisManager.getAPIs(ApisNameProject).editorSaved
-        )
+        if (api := self.__apisManager.getAPIs(ApisNameProject)) is not None:
+            editor.editorSaved.connect(api.editorSaved)
         self.__editors.append(editor)
 
         # preload the api to give the manager a chance to prepare the database
@@ -140,9 +139,8 @@
         @type Editor
         """
         if editor in self.__editors:
-            editor.editorSaved.disconnect(
-                self.__apisManager.getAPIs(ApisNameProject).editorSaved
-            )
+            if (api := self.__apisManager.getAPIs(ApisNameProject)) is not None:
+                editor.editorSaved.disconnect(api.editorSaved)
             self.__editors.remove(editor)
             if editor.getCompletionListHook("Assistant"):
                 self.__unsetAutoCompletionHook(editor)
--- a/ChangeLog	Wed Aug 30 11:39:07 2023 +0200
+++ b/ChangeLog	Sat Oct 07 17:37:40 2023 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 10.3.1:
+- bug fixes
+
 Version 10.3.0:
 - bug fixes
 - prepared code for Python 3.12
--- a/PluginAssistantEric.py	Wed Aug 30 11:39:07 2023 +0200
+++ b/PluginAssistantEric.py	Sat Oct 07 17:37:40 2023 +0200
@@ -20,7 +20,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "10.3.0"
+version = "10.3.1"
 className = "AssistantEricPlugin"
 packageName = "AssistantEric"
 shortDescription = "Alternative autocompletion and calltips provider."
Binary file PluginAssistantEric.zip has changed

eric ide

mercurial