Hi Vadim, I already implemented a draft of the 'Moving folder' feature. As I mostly did that while I could not read this list, I did it 'my way' and it does not include the 'change folder ordering' feature
Current status -------------- 1. There is a 'Move' command in the folder menu. It allows you to choose the folder you want as new parent for the moved folder. 2. It is not able to move a folder that has sub-folders. 3. It works with local mailboxes and POP folders. I did not test moving group folders because moving a hierarchy does not work yet. I did not test any other kind of folder because I don't have any of them. I don't know how NNTP and NEWS folder work, so moving them is disabled. For IMAP folders, the RENAME command is not sent yet so this is also disabled. Note that, for IMAP folders, I suppose that we could move the root folder of the server (when moving hierarchies is supported). Then no RENAME command is needed for this or any of its sub-folders. How it works ------------ This is done by creating a new MFolderFromProfile object with the correct name (i.e. the full path of the target + the name of the moved folder). Then I loop over all the entries in the profile associated with the old folder, and create the same intries in the profile of the new folder, while disabling the environment variables expansion. Then I delete the old folder (to remove it from the hierarchy), and lastly I send an event stating that a new folder has been created. Questions --------- 1. Do you think that create new-delete old idea is a good one ? 2. I have a problem to update the folder cache, which means that I must close (and re-open) the moved folder to get it to display its number of messages. My understanding is that I can't create a new entry in the cache because the MFolder instance for the old folder is not deleted yet when I try to do that, but I did not look at this problem carefully yet. 3. Should I commit now ? I guess I should because: - when dealing with POP or mbox folders, I never call c-client so there is little chance that some messages could be lost. - I don't use IMAP, so I will have problems to implement/test the feature for those folders. On the other hand, the code is not yet clean: all is located in one bool MFolderFromProfile::Move(MFolder *newParent) method, including the loop to copy the profile entries. It should be re-factored even if the not yet implemented feature do not mandate it. Cheers, -- Xavier Nodet "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." - Benjamin Franklin, 1759. ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Mahogany-Developers mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/mahogany-developers