Fixed an issue with the task viewer causing empty files being created.

Sat, 26 Aug 2017 19:41:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 26 Aug 2017 19:41:18 +0200
changeset 5851
8f8b264e5d5f
parent 5850
7fae79975686
child 5852
3aad40446c29

Fixed an issue with the task viewer causing empty files being created.

Documentation/Help/source.qch file | annotate | diff | comparison | revisions
Documentation/Help/source.qhp file | annotate | diff | comparison | revisions
Documentation/Source/eric6.Tasks.TaskViewer.html file | annotate | diff | comparison | revisions
Documentation/Source/index-eric6.Debugger.html file | annotate | diff | comparison | revisions
Tasks/TaskViewer.py file | annotate | diff | comparison | revisions
Binary file Documentation/Help/source.qch has changed
--- a/Documentation/Help/source.qhp	Sat Aug 26 19:26:07 2017 +0200
+++ b/Documentation/Help/source.qhp	Sat Aug 26 19:41:18 2017 +0200
@@ -55,7 +55,6 @@
             <section title="eric6.Debugger.DebugViewer" ref="eric6.Debugger.DebugViewer.html" />
             <section title="eric6.Debugger.DebuggerInterfaceNone" ref="eric6.Debugger.DebuggerInterfaceNone.html" />
             <section title="eric6.Debugger.DebuggerInterfacePython" ref="eric6.Debugger.DebuggerInterfacePython.html" />
-            <section title="eric6.Debugger.DebuggerInterfacePython2" ref="eric6.Debugger.DebuggerInterfacePython2.html" />
             <section title="eric6.Debugger.EditBreakpointDialog" ref="eric6.Debugger.EditBreakpointDialog.html" />
             <section title="eric6.Debugger.EditWatchpointDialog" ref="eric6.Debugger.EditWatchpointDialog.html" />
             <section title="eric6.Debugger.ExceptionLogger" ref="eric6.Debugger.ExceptionLogger.html" />
@@ -3732,7 +3731,6 @@
       <keyword name="DebuggerInterfacePython.shutdown" id="DebuggerInterfacePython.shutdown" ref="eric6.Debugger.DebuggerInterfacePython.html#DebuggerInterfacePython.shutdown" />
       <keyword name="DebuggerInterfacePython.startRemote" id="DebuggerInterfacePython.startRemote" ref="eric6.Debugger.DebuggerInterfacePython.html#DebuggerInterfacePython.startRemote" />
       <keyword name="DebuggerInterfacePython.startRemoteForProject" id="DebuggerInterfacePython.startRemoteForProject" ref="eric6.Debugger.DebuggerInterfacePython.html#DebuggerInterfacePython.startRemoteForProject" />
-      <keyword name="DebuggerInterfacePython2 (Module)" id="DebuggerInterfacePython2 (Module)" ref="eric6.Debugger.DebuggerInterfacePython2.html" />
       <keyword name="DebuggerPropertiesDialog" id="DebuggerPropertiesDialog" ref="eric6.Project.DebuggerPropertiesDialog.html#DebuggerPropertiesDialog" />
       <keyword name="DebuggerPropertiesDialog (Constructor)" id="DebuggerPropertiesDialog (Constructor)" ref="eric6.Project.DebuggerPropertiesDialog.html#DebuggerPropertiesDialog.__init__" />
       <keyword name="DebuggerPropertiesDialog (Module)" id="DebuggerPropertiesDialog (Module)" ref="eric6.Project.DebuggerPropertiesDialog.html" />
--- a/Documentation/Source/eric6.Tasks.TaskViewer.html	Sat Aug 26 19:26:07 2017 +0200
+++ b/Documentation/Source/eric6.Tasks.TaskViewer.html	Sat Aug 26 19:41:18 2017 +0200
@@ -177,7 +177,7 @@
 <td>Private method to delete all sub-tasks.</td>
 </tr><tr>
 <td><a href="#TaskViewer.__deleteTask">__deleteTask</a></td>
-<td>Private slot to handle the "Delete Task" context menu entry.</td>
+<td>Private slot to delete a task.</td>
 </tr><tr>
 <td><a href="#TaskViewer.__editTaskProperties">__editTaskProperties</a></td>
 <td>Private slot to handle the "Properties" context menu entry.</td>
@@ -327,10 +327,15 @@
 </dd>
 </dl><a NAME="TaskViewer.__deleteTask" ID="TaskViewer.__deleteTask"></a>
 <h4>TaskViewer.__deleteTask</h4>
-<b>__deleteTask</b>(<i></i>)
+<b>__deleteTask</b>(<i>task=None</i>)
 <p>
-        Private slot to handle the "Delete Task" context menu entry.
-</p><a NAME="TaskViewer.__editTaskProperties" ID="TaskViewer.__editTaskProperties"></a>
+        Private slot to delete a task.
+</p><dl>
+<dt><i>task</i> (Task)</dt>
+<dd>
+task to be deleted
+</dd>
+</dl><a NAME="TaskViewer.__editTaskProperties" ID="TaskViewer.__editTaskProperties"></a>
 <h4>TaskViewer.__editTaskProperties</h4>
 <b>__editTaskProperties</b>(<i></i>)
 <p>
--- a/Documentation/Source/index-eric6.Debugger.html	Sat Aug 26 19:26:07 2017 +0200
+++ b/Documentation/Source/index-eric6.Debugger.html	Sat Aug 26 19:41:18 2017 +0200
@@ -64,9 +64,6 @@
 <td><a href="eric6.Debugger.DebuggerInterfacePython.html">DebuggerInterfacePython</a></td>
 <td>Module implementing the Python3 debugger interface for the debug server.</td>
 </tr><tr>
-<td><a href="eric6.Debugger.DebuggerInterfacePython2.html">DebuggerInterfacePython2</a></td>
-<td></td>
-</tr><tr>
 <td><a href="eric6.Debugger.EditBreakpointDialog.html">EditBreakpointDialog</a></td>
 <td>Module implementing a dialog to edit breakpoint properties.</td>
 </tr><tr>
--- a/Tasks/TaskViewer.py	Sat Aug 26 19:26:07 2017 +0200
+++ b/Tasks/TaskViewer.py	Sat Aug 26 19:41:18 2017 +0200
@@ -253,7 +253,11 @@
             self.__activating = True
             fn = itm.getFilename()
             if fn:
-                self.displayFile.emit(fn, itm.getLineno())
+                if os.path.exists(fn):
+                    self.displayFile.emit(fn, itm.getLineno())
+                else:
+                    if itm.isProjectTask():
+                        self.__deleteTask(itm)
             else:
                 self.__editTaskProperties()
             self.__activating = False
@@ -578,12 +582,18 @@
                 self.__deleteSubTasks(subtask)
             self.tasks.remove(subtask)
     
-    def __deleteTask(self):
+    def __deleteTask(self, task=None):
         """
-        Private slot to handle the "Delete Task" context menu entry.
+        Private slot to delete a task.
+        
+        @param task task to be deleted
+        @type Task
         """
-        task = self.currentItem()
-        if self.copyTask == task:
+        if task is None:
+            # called via "Delete Task" context menu entry
+            task = self.currentItem()
+        
+        if self.copyTask is task:
             self.copyTask = None
         if task.childCount() > 0:
             self.__deleteSubTasks(task)

eric ide

mercurial