| 115 | } |
| 116 | |
| 117 | VCSDiffPatchSource::VCSDiffPatchSource(VCSDiffUpdater* updater) |
| 118 | : m_updater(updater) |
| 119 | { |
| 120 | update(); |
| 121 | KDevelop::IBasicVersionControl* vcs = m_updater->vcs(); |
| 122 | QUrl url = m_updater->url(); |
| 123 | |
| 124 | QScopedPointer<VcsJob> statusJob(vcs->status(QList<QUrl>() << url)); |
| 125 | QVariant varlist; |
| 126 | |
| 127 | if( statusJob->exec() && statusJob->status() == VcsJob::JobSucceeded ) |
| 128 | { |
| 129 | varlist = statusJob->fetchResults(); |
| 130 | |
| 131 | const auto vars = varlist.toList(); |
| 132 | m_infos.reserve(m_infos.size() + vars.size()); |
| 133 | for (const auto& var : vars) { |
| 134 | VcsStatusInfo info = var.value<KDevelop::VcsStatusInfo>(); |
| 135 | |
| 136 | m_infos += info; |
| 137 | if(info.state()!=VcsStatusInfo::ItemUpToDate) |
| 138 | m_selectable[info.url()] = info.state(); |
| 139 | } |
| 140 | } |
| 141 | else |
| 142 | qCDebug(VCS) << "Couldn't get status for urls: " << url; |
| 143 | } |
| 144 | |
| 145 | VCSDiffPatchSource::VCSDiffPatchSource(const KDevelop::VcsDiff& diff) |
| 146 | : m_updater(nullptr) |