2
* Copyright: 2014 Canonical, Ltd
4
* This file is part of reminders
6
* reminders is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* reminders is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
* Authors: Michael Zanetti <michael.zanetti@canonical.com>
21
#include "createtagjob.h"
25
CreateTagJob::CreateTagJob(const QString &name, QObject *parent) :
26
NotesStoreJob(parent),
31
void CreateTagJob::startJob()
33
m_result.name = m_name.toStdString();
34
m_result.__isset.name = true;
35
client()->createTag(m_result, token().toStdString(), m_result);
38
bool CreateTagJob::operator==(const EvernoteJob *other) const
40
const CreateTagJob *otherJob = qobject_cast<const CreateTagJob*>(other);
44
return this->m_name == otherJob->m_name;
47
void CreateTagJob::attachToDuplicate(const EvernoteJob *other)
49
const CreateTagJob *otherJob = static_cast<const CreateTagJob*>(other);
50
connect(otherJob, &CreateTagJob::jobDone, this, &CreateTagJob::jobDone);
53
void CreateTagJob::emitJobDone(EvernoteConnection::ErrorCode errorCode, const QString &errorMessage)
55
emit jobDone(errorCode, errorMessage, m_result);