| 17 | using namespace KDevelop; |
| 18 | |
| 19 | StashPatchSource::StashPatchSource(const QString& stashName, GitPlugin* plugin, const QDir & baseDir) |
| 20 | : m_stashName(stashName), m_plugin(plugin), m_baseDir(baseDir) |
| 21 | { |
| 22 | QTemporaryFile tempFile; |
| 23 | |
| 24 | tempFile.setAutoRemove(false); |
| 25 | tempFile.open(); |
| 26 | m_patchFile = QUrl::fromLocalFile(tempFile.fileName()); |
| 27 | |
| 28 | auto job = qobject_cast<KDevelop::DVcsJob*>(m_plugin->gitStash(m_baseDir, QStringList{QStringLiteral("show"), QStringLiteral("-u"), m_stashName}, KDevelop::OutputJob::Silent)); |
| 29 | |
| 30 | connect(job, &DVcsJob::resultsReady, this, &StashPatchSource::updatePatchFile); |
| 31 | KDevelop::ICore::self()->runController()->registerJob(job); |
| 32 | } |
| 33 | |
| 34 | StashPatchSource::~StashPatchSource() |
| 35 | { |
nothing calls this directly
no test coverage detected