Make use of the already existing DolphinNewFileMenuObserver singleton class to achieve a better error handling (DolphinNewFileMenu)
Review Request #112178 - Created Aug. 20, 2013 and submitted
Replaced all KNewFileMenu usages in DolphinPart by DolphinNewFileMenu. Removed all signal-slot-connections related to DolphinNewFileMenu->errorMessage(QString) in DolphinMainWindow and DolphinContextMenu and replaced it by a better solution. Now we make use of the already existing DolphinNewFileMenuObserver singleton class to achieve a better error handling, because every newly created DolphinContextMenu instance registers himself by DolphinNewFileMenuObserver and we use this to connect the errorMessage(QString) signal of every DolphinContextMenu instance to the errorMessage(QString) signal of the DolphinNewFileMenuObserver singleton class. So we need only one connection from DolphinNewFileMenuObserver to DolphinMainWindow (or to DolphinPart) to collect all error messages thrown by every DolphinNewFileMenu instance.
All error messages are shown properly.
Thanks for the patch! I think that the idea is good. However, you might want to add David as reviewer, so he can have a look at the DolphinPart changes. One thing that I noticed: by replacing KNewFileMenu by DolphinNewFileMenu in the DolphinPart, you effectively have replaced the action name "new_menu" by "create_new", right? Have you verified that this does not break anything, for example the "Create New..." action from Konqueror's "Edit" menu? It could be that you have to change the action name also somewhere else to make it work correctly.
Review request changed
Replaced the action name "create_new" of DolphinNewFileMenu with "new_menu", so that nothing breaks in DolphinPart. Added David Faure as reviewer, because of the DolphinPart changes.
Revision 2 (+27 -23)
Thanks for the new patch, but now the "File -> Create New..." menu in Dolphin is broken. It doesn't matter much if the name of the action is "create_new" or "new_menu", but if you use a single action everywhere, then the action must have the same name everywhere (including all *.rc files).