[Patch] Support for undo closed window

Eduardo Robles Elvira edulix at gmail.com
Sun Mar 16 20:57:25 GMT 2008


El Sábado 01 Marzo 2008, escribió:
> I've just finished implementing undoing closed windows. Hey it works! I've
> done some major work:
>
>  * First, I've renamed every that was related to closedTabs to closedItems.
> Because now a closedItem can be either a closed tab or a closed window.
>
>  * I've added support for custom commands (as David Faure wished :D) to the 
file
> undo manager. And in a very convenient and powerful way I must add.
>
>  * The closed windows however are not stored in the kfileundomanager,
> because when you close a window, because basically they are much more
> conceptually related to closed tabs than to removed files;
> For example when you open the popup menu listing the closed items, you
> would need to retrieve the appropiate list of closed windows. You can't do
> that if it's in the QStack that holds the undo items in kfileundomanager.
> Etc.
>
> The solution? Store the closed windows in the KonqUndoManager List of
> closed items along with closed tabs. Now if you have 3 windows opened and
> you close one, the other 2 windows will have a reference to the same Closed
> Window Item.
>
> And if you undo the closing of the window from window1, a signal will be
> emitted from window1 that says "hey remove any reference to this closed
> window, as it has been reopened". That's done in
> removeWindowInOtherInstances(), which emits bypassCustomInfo(QVariant&),
> which is a signal conected to a signal in the KFileUndoManager which is
> then received and decoded by the KonqUndoManager related to window2.
>
> Something similar happens when a window is closed, adding the closed window
> to the other instances. There are some "nasty" castings involved, but that
> ought to be done if we wanted the KFileUndoManager to be generic and not
> konqueror-specific.
>
> So with this patch the file undo manager not only supports adding custom
> file undoable actions, but it also has a "comunnication channel"
> represented by the bypassCustomInfo(QVariant&) signal, which allows
> comunication between the instances connected to the file undo manager.
> Which is the way I implemented the undo closed window thingie.
>
> I've tested this patch and it works fine so far. Should I commit it to
> trunk?
>
> Greetings,
>        Eduardo Robles Elvira.

Hi again!

Here is the updated patch which fixes a bug that prevented closed windows from 
being deleted from the config file and thus being written to disk. If noone 
objects (and as none has commented about this patch yet!) I will commit it 
tomorrow and thus I will continue working on getting working session crash 
recovery and session saving like firefox, which is my next konqueror project 
once this is commited to SVN ;-).

Greetings,
       Eduardo Robles Elvira.
-- 
"The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all progress
depends on the unreasonable man." (George Bernard Shaw)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: undo-closed-windows.patch.zip
Type: application/x-zip
Size: 9176 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080316/7a0ff1fd/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20080316/7a0ff1fd/attachment.sig>


More information about the kfm-devel mailing list