Changeset View
Changeset View
Standalone View
Standalone View
vcs/vcspluginhelper.cpp
Show All 11 Lines | |||||
12 | #include "vcspluginhelper.h" | 12 | #include "vcspluginhelper.h" | ||
13 | 13 | | |||
14 | #include <QAction> | 14 | #include <QAction> | ||
15 | #include <QApplication> | 15 | #include <QApplication> | ||
16 | #include <QClipboard> | 16 | #include <QClipboard> | ||
17 | #include <QDialogButtonBox> | 17 | #include <QDialogButtonBox> | ||
18 | #include <QFileInfo> | 18 | #include <QFileInfo> | ||
19 | #include <QMenu> | 19 | #include <QMenu> | ||
20 | #include <QPointer> | ||||
20 | #include <QTimer> | 21 | #include <QTimer> | ||
21 | #include <QVBoxLayout> | 22 | #include <QVBoxLayout> | ||
22 | #include <QVariant> | 23 | #include <QVariant> | ||
23 | 24 | | |||
24 | #include <KLocalizedString> | 25 | #include <KLocalizedString> | ||
25 | #include <KMessageBox> | 26 | #include <KMessageBox> | ||
26 | #include <KParts/MainWindow> | 27 | #include <KParts/MainWindow> | ||
27 | #include <KTextEditor/AnnotationInterface> | 28 | #include <KTextEditor/AnnotationInterface> | ||
▲ Show 20 Lines • Show All 424 Lines • ▼ Show 20 Line(s) | 449 | { | |||
452 | QUrl url = d->ctxUrls.first(); | 453 | QUrl url = d->ctxUrls.first(); | ||
453 | 454 | | |||
454 | // We start the commit UI no matter whether there is real differences, as it can also be used to commit untracked files | 455 | // We start the commit UI no matter whether there is real differences, as it can also be used to commit untracked files | ||
455 | VCSCommitDiffPatchSource* patchSource = new VCSCommitDiffPatchSource(new VCSStandardDiffUpdater(d->vcs, url)); | 456 | VCSCommitDiffPatchSource* patchSource = new VCSCommitDiffPatchSource(new VCSStandardDiffUpdater(d->vcs, url)); | ||
456 | 457 | | |||
457 | bool ret = showVcsDiff(patchSource); | 458 | bool ret = showVcsDiff(patchSource); | ||
458 | 459 | | |||
459 | if(!ret) { | 460 | if(!ret) { | ||
460 | VcsCommitDialog *commitDialog = new VcsCommitDialog(patchSource); | 461 | QPointer<VcsCommitDialog> commitDialog = new VcsCommitDialog(patchSource); | ||
461 | commitDialog->setCommitCandidates(patchSource->infos()); | 462 | commitDialog->setCommitCandidates(patchSource->infos()); | ||
462 | commitDialog->exec(); | 463 | commitDialog->exec(); | ||
464 | delete commitDialog; | ||||
croick: mh, I guess it should be deleted, right? | |||||
croick: it might delete itself, but not necessarily | |||||
463 | } | 465 | } | ||
464 | } | 466 | } | ||
465 | 467 | | |||
466 | void VcsPluginHelper::push() | 468 | void VcsPluginHelper::push() | ||
467 | { | 469 | { | ||
468 | foreach(const QUrl &url, d->ctxUrls) { | 470 | foreach(const QUrl &url, d->ctxUrls) { | ||
469 | VcsJob* job = d->plugin->extension<IDistributedVersionControl>()->push(url, VcsLocation()); | 471 | VcsJob* job = d->plugin->extension<IDistributedVersionControl>()->push(url, VcsLocation()); | ||
470 | ICore::self()->runController()->registerJob(job); | 472 | ICore::self()->runController()->registerJob(job); | ||
Show All 14 Lines |
mh, I guess it should be deleted, right?