Fixed an issue occurring spuriously when uninstalling the plug-in.

Tue, 27 Aug 2013 19:16:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 27 Aug 2013 19:16:11 +0200
changeset 39
82593471100f
parent 38
dbe25d151ec5
child 40
beac7072f393

Fixed an issue occurring spuriously when uninstalling the plug-in.

PluginTimeTracker.zip file | annotate | diff | comparison | revisions
TimeTracker/TimeTrackerWidget.py file | annotate | diff | comparison | revisions
Binary file PluginTimeTracker.zip has changed
--- a/TimeTracker/TimeTrackerWidget.py	Tue Aug 27 19:09:25 2013 +0200
+++ b/TimeTracker/TimeTrackerWidget.py	Tue Aug 27 19:16:11 2013 +0200
@@ -50,11 +50,13 @@
         @param txt new task description (string)
         """
         itm = self.entriesList.topLevelItem(0)
-        itm.setText(self.TaskColumn, txt)
-        self.entriesList.resizeColumnToContents(self.TaskColumn)
+        if itm:
+            itm.setText(self.TaskColumn, txt)
+            self.entriesList.resizeColumnToContents(self.TaskColumn)
         
         entry = self.__tracker.getCurrentEntry()
-        entry.setTask(txt)
+        if entry:
+            entry.setTask(txt)
     
     @pyqtSlot(str)
     def on_commentCombo_editTextChanged(self, txt):
@@ -64,11 +66,13 @@
         @param txt new comment (string)
         """
         itm = self.entriesList.topLevelItem(0)
-        itm.setText(self.CommentColumn, txt)
-        self.entriesList.resizeColumnToContents(self.CommentColumn)
+        if itm:
+            itm.setText(self.CommentColumn, txt)
+            self.entriesList.resizeColumnToContents(self.CommentColumn)
         
         entry = self.__tracker.getCurrentEntry()
-        entry.setComment(txt)
+        if entry:
+            entry.setComment(txt)
     
     @pyqtSlot(bool)
     def on_pauseButton_toggled(self, checked):

eric ide

mercurial