diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bcb704366cb5e333a626c18c308c7e0448a8e69f (patch) | |
tree | f0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/protocols/groupwise/libgroupwise/tasks/needfoldertask.cpp | |
download | tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/groupwise/libgroupwise/tasks/needfoldertask.cpp')
-rw-r--r-- | kopete/protocols/groupwise/libgroupwise/tasks/needfoldertask.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/kopete/protocols/groupwise/libgroupwise/tasks/needfoldertask.cpp b/kopete/protocols/groupwise/libgroupwise/tasks/needfoldertask.cpp new file mode 100644 index 00000000..810326ee --- /dev/null +++ b/kopete/protocols/groupwise/libgroupwise/tasks/needfoldertask.cpp @@ -0,0 +1,58 @@ +// +// C++ Implementation: %{MODULE} +// +// Description: +// +// +// Author: %{AUTHOR} <%{EMAIL}>, (C) %{YEAR} +// +// Copyright: See COPYING file that comes with this distribution +// +// +#include "client.h" +#include "tasks/createcontactinstancetask.h" +#include "tasks/createfoldertask.h" + +#include "needfoldertask.h" + +NeedFolderTask::NeedFolderTask(Task* parent): ModifyContactListTask(parent) +{ +} + +NeedFolderTask::~NeedFolderTask() +{ +} + +void NeedFolderTask::createFolder() +{ + CreateFolderTask * cct = new CreateFolderTask( client()->rootTask() ); + cct->folder( 0, m_folderSequence, m_folderDisplayName ); + connect( cct, SIGNAL( gotFolderAdded( const FolderItem & ) ), client(), SIGNAL( folderReceived( const FolderItem & ) ) ); + connect( cct, SIGNAL( gotFolderAdded( const FolderItem & ) ), SLOT( slotFolderAdded( const FolderItem & ) ) ); + connect( cct, SIGNAL( finished() ), SLOT( slotFolderTaskFinished() ) ); + cct->go( true ); +} + +void NeedFolderTask::slotFolderAdded( const FolderItem & addedFolder ) +{ + // if this is the folder we were trying to create + if ( m_folderDisplayName == addedFolder.name ) + { + client()->debug( QString( "NeedFolderTask::slotFolderAdded() - Folder %1 was created on the server, now has objectId %2" ).arg( addedFolder.name ).arg( addedFolder.id ) ); + m_folderId = addedFolder.id; + } +} + +void NeedFolderTask::slotFolderTaskFinished() +{ + CreateFolderTask *cct = ( CreateFolderTask* )sender(); + if ( cct->success() ) + { + // call our child class's action to be performed + onFolderCreated(); + } + else + setError( 1, "Folder creation failed" ); +} + +#include "needfoldertask.moc" |