aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap/MCIMAPRenameFolderOperation.cpp
blob: 338e02a55e3192f8c7861eaf3a05464dedb0ca8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
//  MCIMAPRenameFolderOperation.cpp
//  mailcore2
//
//  Created by DINH Viêt Hoà on 1/12/13.
//  Copyright (c) 2013 MailCore. All rights reserved.
//

#include "MCIMAPRenameFolderOperation.h"

#include "MCIMAPSession.h"
#include "MCIMAPAsyncConnection.h"

using namespace mailcore;

IMAPRenameFolderOperation::IMAPRenameFolderOperation()
{
    mOtherName = NULL;
}

IMAPRenameFolderOperation::~IMAPRenameFolderOperation()
{
    MC_SAFE_RELEASE(mOtherName);
}

void IMAPRenameFolderOperation::setOtherName(String * otherName)
{
    MC_SAFE_REPLACE_COPY(String, mOtherName, otherName);
}

String * IMAPRenameFolderOperation::otherName()
{
    return mOtherName;
}

void IMAPRenameFolderOperation::main()
{
    ErrorCode error;
    session()->session()->renameFolder(folder(), mOtherName, &error);
    setError(error);
}