Jerome Laheurte | 21 Jun 10:12
Favicon

Little bug, I think


Hi, Franck. What is the motivation of the "elif not 
self.__taskFile.isEmpty()" in IOController.save() ?

     def save(self, *args):
         if self.__taskFile.filename():
             self.__taskFile.save()
             self.__showSaveMessage(self.__taskFile)
             return True
         elif not self.__taskFile.isEmpty():
             return self.saveas()
         else:
             return False

The problem is the following: starting with an empty file, if I create 
a task, undo the create, and try to save, the taskfile is still marked 
dirty, the save button is still enabled and I get the confirmation 
dialog when quitting, which I suppose is not the intended behaviour :)

------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/taskcoach-dev/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
(Continue reading)

Frank Niessink | 21 Jun 16:26

Re: Little bug, I think

Hi Jerome,

2008/6/21 Jerome Laheurte <fraca7@...>:
>
> Hi, Franck. What is the motivation of the "elif not
> self.__taskFile.isEmpty()" in IOController.save() ?
>
>     def save(self, *args):
>         if self.__taskFile.filename():
>             self.__taskFile.save()
>             self.__showSaveMessage(self.__taskFile)
>             return True
>         elif not self.__taskFile.isEmpty():
>             return self.saveas()
>         else:
>             return False

This method is called when the user clicks save. If the task file does
not have a filename the IOController needs to invoke saveas to force
the user to give it one. This only makes sense if there is something
to save, i.e. the task file is not empty.

> The problem is the following: starting with an empty file, if I create
> a task, undo the create, and try to save, the taskfile is still marked
> dirty, the save button is still enabled and I get the confirmation
> dialog when quitting, which I suppose is not the intended behaviour :)

Ah, I see what you mean. So to solve this we would only need to change
the above code into:

(Continue reading)


Gmane