kmail Library API Documentation

KMail::CopyFolderJob Class Reference

Copy a hierarchy of folders somewhere else in the folder tree. More...

#include <copyfolderjob.h>

Collaboration diagram for KMail::CopyFolderJob:

Collaboration graph
[legend]
List of all members.

Signals

void folderCopyComplete (bool success)

Public Member Functions

 CopyFolderJob (const FolderStorage *const storage, KMFolderDir *const newParent=0)
virtual void execute ()

Protected Slots

bool createTargetDir ()
void copyMessagesToTargetDir ()
void slotCopyCompleted (KMCommand *command)
void slotCopyNextChild (bool success=true)
void rollback ()

Protected Attributes

const FolderStorage *const mStorage
KMFolderDir *const mNewParent
KMFoldermNewFolder
QPtrListIterator< KMFolderNode > mChildFolderNodeIterator
KMFoldermNextChildFolder

Detailed Description

Copy a hierarchy of folders somewhere else in the folder tree.

Currently online imap folders are not supported as target folders, and the same is true for search folders where it does not make much sense for them to be target folders.

Definition at line 48 of file copyfolderjob.h.


Constructor & Destructor Documentation

CopyFolderJob::CopyFolderJob const FolderStorage *const   storage,
KMFolderDir *const   newParent = 0
 

Create a new job.

Parameters:
storage of the folder that should be copied
newParent the target parent folder

Definition at line 46 of file copyfolderjob.cpp.

Referenced by slotCopyNextChild().


Member Function Documentation

bool CopyFolderJob::createTargetDir  )  [protected, slot]
 

Create the target directory under the new parent.

Returns success or failure.

Definition at line 159 of file copyfolderjob.cpp.

References FolderStorage::contentsType(), FolderStorage::folder(), folderCopyComplete(), KMFolder::idString(), KMFolderDir::owner(), and KMFolder::storage().

void CopyFolderJob::copyMessagesToTargetDir  )  [protected, slot]
 

Copy all messages from the original folder to mNewFolder.

Definition at line 70 of file copyfolderjob.cpp.

References FolderStorage::getMsgBase(), slotCopyCompleted(), and slotCopyNextChild().

void CopyFolderJob::slotCopyCompleted KMCommand *  command  )  [protected, slot]
 

Called when the CopyCommand has either succesfully completed copying the contents of our folder to the new location or failed.

Definition at line 93 of file copyfolderjob.cpp.

References FolderStorage::folder(), folderCopyComplete(), rollback(), and slotCopyNextChild().

Referenced by copyMessagesToTargetDir().

void CopyFolderJob::slotCopyNextChild bool  success = true  )  [protected, slot]
 

Called when the previous sibling's copy operation completed.

Parameters:
success indicates whether the last copy was successful.

Definition at line 113 of file copyfolderjob.cpp.

References KMFolder::close(), CopyFolderJob(), KMFolder::createChildFolder(), folderCopyComplete(), KMFolder::open(), KMFolder::prettyURL(), rollback(), and KMFolder::storage().

Referenced by copyMessagesToTargetDir(), and slotCopyCompleted().

void CopyFolderJob::rollback  )  [protected, slot]
 

Called when one of the operations of the foldre itself or one of it's child folders failed and the already created target folder needs to be removed again.

Definition at line 198 of file copyfolderjob.cpp.

References KMFolder::createChildFolder(), and folderCopyComplete().

Referenced by slotCopyCompleted(), and slotCopyNextChild().

void KMail::CopyFolderJob::folderCopyComplete bool  success  )  [signal]
 

Emitted when the job is done, check the success bool.

Referenced by createTargetDir(), rollback(), slotCopyCompleted(), and slotCopyNextChild().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmail Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Aug 2 09:55:42 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003