Changeset View
Changeset View
Standalone View
Standalone View
src/core/jobs/tagmodifyjob.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 59 | if (!d->mTag.remoteId().isNull()) { | |||
---|---|---|---|---|---|
60 | cmd->setRemoteId(d->mTag.remoteId()); | 60 | cmd->setRemoteId(d->mTag.remoteId()); | ||
61 | } | 61 | } | ||
62 | if (!d->mTag.type().isEmpty()) { | 62 | if (!d->mTag.type().isEmpty()) { | ||
63 | cmd->setType(d->mTag.type()); | 63 | cmd->setType(d->mTag.type()); | ||
64 | } | 64 | } | ||
65 | if (d->mTag.parent().isValid() && !d->mTag.isImmutable()) { | 65 | if (d->mTag.parent().isValid() && !d->mTag.isImmutable()) { | ||
66 | cmd->setParentId(d->mTag.parent().id()); | 66 | cmd->setParentId(d->mTag.parent().id()); | ||
67 | } | 67 | } | ||
68 | if (!d->mTag.d_ptr->mDeletedAttributes.isEmpty()) { | 68 | if (!d->mTag.d_ptr->mAttributeStorage.deletedAttributes().isEmpty()) { | ||
69 | cmd->setRemovedAttributes(d->mTag.d_ptr->mDeletedAttributes); | 69 | cmd->setRemovedAttributes(d->mTag.d_ptr->mAttributeStorage.deletedAttributes()); | ||
70 | } | ||||
71 | if (d->mTag.d_ptr->mAttributeStorage.hasModifiedAttributes()) { | ||||
72 | cmd->setAttributes(ProtocolHelper::attributesToProtocol(d->mTag.d_ptr->mAttributeStorage.modifiedAttributes())); | ||||
70 | } | 73 | } | ||
71 | | ||||
72 | cmd->setAttributes(ProtocolHelper::attributesToProtocol(d->mTag)); | | |||
73 | 74 | | |||
74 | d->sendCommand(cmd); | 75 | d->sendCommand(cmd); | ||
75 | } | 76 | } | ||
76 | 77 | | |||
77 | bool TagModifyJob::doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) | 78 | bool TagModifyJob::doHandleResponse(qint64 tag, const Protocol::CommandPtr &response) | ||
78 | { | 79 | { | ||
79 | //Q_D(TagModifyJob); | 80 | Q_D(TagModifyJob); | ||
80 | 81 | | |||
81 | if (response->isResponse()) { | 82 | if (response->isResponse()) { | ||
82 | if (response->type() == Protocol::Command::FetchTags) { | 83 | if (response->type() == Protocol::Command::FetchTags) { | ||
83 | // Tag was modified, we ignore the response for now | 84 | // Tag was modified, we ignore the response for now | ||
84 | return false; | 85 | return false; | ||
85 | } else if (response->type() == Protocol::Command::DeleteTag) { | 86 | } else if (response->type() == Protocol::Command::DeleteTag) { | ||
86 | // The tag was deleted/merged | 87 | // The tag was deleted/merged | ||
87 | return false; | 88 | return false; | ||
88 | } else if (response->type() == Protocol::Command::ModifyTag) { | 89 | } else if (response->type() == Protocol::Command::ModifyTag) { | ||
89 | // Done. | 90 | // Done. | ||
91 | d->mTag.d_ptr->resetChangeLog(); | ||||
90 | return true; | 92 | return true; | ||
91 | } | 93 | } | ||
92 | } | 94 | } | ||
93 | 95 | | |||
94 | return Job::doHandleResponse(tag, response); | 96 | return Job::doHandleResponse(tag, response); | ||
95 | } | 97 | } |