From bf3b1d9dc903453c8aef3449d3d02010b7f1e523 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Wed, 22 Dec 2004 09:07:05 +0000 Subject: [PATCH] Notification when renaming IMAP folder. --- src/messaging/IMAPFolder.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/messaging/IMAPFolder.cpp b/src/messaging/IMAPFolder.cpp index a3c83c77..9ca55fc6 100644 --- a/src/messaging/IMAPFolder.cpp +++ b/src/messaging/IMAPFolder.cpp @@ -1292,6 +1292,20 @@ void IMAPFolder::rename(const folder::path& newPath) events::folderEvent event(this, events::folderEvent::TYPE_RENAMED, oldPath, newPath); notifyFolder(event); + + // Notify folders with the same path + for (std::list ::iterator it = m_store->m_folders.begin() ; + it != m_store->m_folders.end() ; ++it) + { + if ((*it) != this && (*it)->getFullPath() == oldPath) + { + (*it)->m_path = newPath; + (*it)->m_name = newPath.getLastComponent(); + + events::folderEvent event(*it, events::folderEvent::TYPE_RENAMED, oldPath, newPath); + (*it)->notifyFolder(event); + } + } }