Review Request: [logviewer] Add actions to clear account and contact logs

Dan Vratil dan at progdan.cz
Sun Sep 9 22:13:32 UTC 2012



> On Sept. 9, 2012, 5:07 p.m., David Edmundson wrote:
> > logviewer/log-viewer.cpp, line 252
> > <http://git.reviewboard.kde.org/r/106229/diff/1/?file=81375#file81375line252>
> >
> >     It's generally a bad idea to update the UI whilst deleting things.
> >     
> >     The ideal way of doing this is you call clearAccount, and then are notified from the backend that the data has been cleared which you monitor for.
> >     
> >     Otherwise if a remove fails, you still hide it, also if someone else clears the account you don't hide it.
> >     
> >     However I'm not sure there's a way to do this. Think about it for a little while and see if there's a better way before committing.

Unfortunately Tpl doesn't provide any "notify" API, so I wouldn't know about the log being removed. I could only think of two solutions for this:
 - polling, which in general is a very bad solution
 - watching the file system (like Nepomuk does) and being notified about log file/folder going missing. I think that's an extreme overkill for our little utility though, so no.

This leaves me with the current solution, which I agree with you is not an optimal solution, but I think it's good enough (for now).

Anyway, I fixed the handler to display an error message when clearing fails instead of hiding the item. As I said above, I can't effectively learn that someone else delete the log, so I can't hide the item after that. You can't do it from anywhere else in KTp though and if someone would do it from an another log viewer or would delete the log file directly from file system while running our logviewer, then from my point of view it's his/hers problem if something breaks. 


- Dan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/106229/#review18069
-----------------------------------------------------------


On Aug. 31, 2012, 10:53 p.m., Dan Vratil wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/106229/
> -----------------------------------------------------------
> 
> (Updated Aug. 31, 2012, 10:53 p.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Description
> -------
> 
> Add a popup menu to entity view. The menu has "Clear account history" and "Clear contact history" actions.
> 
> 
> This addresses bug 305762.
>     http://bugs.kde.org/show_bug.cgi?id=305762
> 
> 
> Diffs
> -----
> 
>   logviewer/entity-model-item.h e740d25 
>   logviewer/entity-model-item.cpp c7f2249 
>   logviewer/entity-model.h 205c132 
>   logviewer/entity-model.cpp cbee00a 
>   logviewer/log-viewer.h 4a9e20b 
>   logviewer/log-viewer.cpp 83d329c 
> 
> Diff: http://git.reviewboard.kde.org/r/106229/diff/
> 
> 
> Testing
> -------
> 
> Successfully destroyed all my logs
> 
> 
> Thanks,
> 
> Dan Vratil
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20120909/39c0f3c2/attachment.html>


More information about the KDE-Telepathy mailing list