Ark - "Add option to open-with, and also disable preview"
Review Request #6580 - Created March 4, 2011 and updated
-double click/enter: opens with default viewer -'preview' button: opens the viewer like it does now. -ctrl+w: 'open with' dialog shows to choose the application to open with. (it's a KAction, but not added to a context menu or anything (yet)). other: QFile::remove calls removed and centralized in the destructor by deleting KTempDirs. It creates a folder per opened file, same behaviour as winrar. Why? The problem is that you dont know when an external program closes (started through KRun) so we cant remove the file directly after the external program closes. So with one directory this scenario will happen: open file, (temp dir created and file extracted therre), user closes file, opens again .. and the message "File already exists" appears. Probably this is also the first reason why the current preview dialog was created=> we know when the user closes it.
Thanks, the patch looks really nice. I'm not really commenting on it yet because I'd like to discuss the general approach first. Using "Ctrl+W" doesn't sound very good (it's usually associated with closing tabs and things like that, plus it is not advertised anywhere), and changing the default behavior of the activated() signal will confuse the users. IMO, you should add a context menu with the options for opening with the default application and choosing the application from a list (and maybe the Preview option too). Besides that, there could be a new setting for choosing the default behavior when an item is selected.