diff options
author | Vincent Richard <[email protected]> | 2004-12-22 09:07:05 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2004-12-22 09:07:05 +0000 |
commit | bf3b1d9dc903453c8aef3449d3d02010b7f1e523 (patch) | |
tree | 21558abe2f5420062967ebb8f716ba54e3396a0d /src/messaging/IMAPFolder.cpp | |
parent | Typo in function doc. (diff) | |
download | vmime-bf3b1d9dc903453c8aef3449d3d02010b7f1e523.tar.gz vmime-bf3b1d9dc903453c8aef3449d3d02010b7f1e523.zip |
Notification when renaming IMAP folder.
Diffstat (limited to 'src/messaging/IMAPFolder.cpp')
-rw-r--r-- | src/messaging/IMAPFolder.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 <IMAPFolder*>::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); + } + } } |