Tasks/TaskViewer.py

changeset 1373
b3b3c99dba01
parent 1131
7781e396c903
child 1509
c0b5e693b0eb
diff -r cb90f71f11f5 -r b3b3c99dba01 Tasks/TaskViewer.py
--- a/Tasks/TaskViewer.py	Mon Oct 17 19:38:59 2011 +0200
+++ b/Tasks/TaskViewer.py	Wed Oct 19 19:42:58 2011 +0200
@@ -615,12 +615,20 @@
                 self.tasks.remove(task)
                 del task
         
-    def clearFileTasks(self, filename):
+    def clearFileTasks(self, filename, conditionally=False):
         """
         Public slot to clear all tasks related to a file.
         
         @param filename name of the file (string)
+        @param conditionally flag indicating to clear the tasks of the file
+            checking some conditions (boolean)
         """
+        if conditionally:
+            if self.project and self.project.isProjectSource(filename):
+                # project related tasks will not be cleared
+                return
+            if not Preferences.getTasks("ClearOnFileClose"):
+                return
         for task in self.tasks[:]:
             if task.getFilename() == filename:
                 if self.copyTask == task:

eric ide

mercurial