MCPcopy Create free account
hub / github.com/KDE/kdevelop / updateFromDiff

Method updateFromDiff

kdevplatform/vcs/widgets/vcsdiffpatchsources.cpp:173–199  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173void 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
201void VCSDiffPatchSource::update() {
202 if(!m_updater)

Callers

nothing calls this directly

Calls 8

baseDiffMethod · 0.80
isValidMethod · 0.45
openMethod · 0.45
diffMethod · 0.45
fileNameMethod · 0.45
closeMethod · 0.45
pathMethod · 0.45
depthMethod · 0.45

Tested by

no test coverage detected