| 171 | } |
| 172 | |
| 173 | void VCSDiffPatchSource::updateFromDiff(const VcsDiff& vcsdiff) |
| 174 | { |
| 175 | if(!m_file.isValid()) |
| 176 | { |
| 177 | QTemporaryFile temp2(QDir::tempPath() + QLatin1String("/kdevelop_XXXXXX.patch")); |
| 178 | temp2.setAutoRemove(false); |
| 179 | temp2.open(); |
| 180 | QTextStream t2(&temp2); |
| 181 | t2 << vcsdiff.diff(); |
| 182 | qCDebug(VCS) << "filename:" << temp2.fileName(); |
| 183 | m_file = QUrl::fromLocalFile(temp2.fileName()); |
| 184 | temp2.close(); |
| 185 | }else{ |
| 186 | QFile file(m_file.path()); |
| 187 | file.open(QIODevice::WriteOnly); |
| 188 | QTextStream t2(&file); |
| 189 | t2 << vcsdiff.diff(); |
| 190 | } |
| 191 | |
| 192 | qCDebug(VCS) << "using file" << m_file << vcsdiff.diff() << "base" << vcsdiff.baseDiff(); |
| 193 | |
| 194 | m_name = QStringLiteral("VCS Diff"); |
| 195 | m_base = vcsdiff.baseDiff(); |
| 196 | m_depth = vcsdiff.depth(); |
| 197 | |
| 198 | emit patchChanged(); |
| 199 | } |
| 200 | |
| 201 | void VCSDiffPatchSource::update() { |
| 202 | if(!m_updater) |