[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: [Patch] Support for undo closed window
From:       Eduardo Robles Elvira <edulix () gmail ! com>
Date:       2008-03-16 20:57:25
Message-ID: 200803162157.31191.edulix () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


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)

["undo-closed-windows.patch.zip" (application/x-zip)]
["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic