kdevplatform/vcs
vcsdiffpatchsources.cpp
Go to the documentation of this file.
79 connect(this, &VCSCommitDiffPatchSource::reviewCancelled, this, &VCSCommitDiffPatchSource::addMessageToHistory);
80 connect(this, &VCSCommitDiffPatchSource::reviewFinished, this, &VCSCommitDiffPatchSource::addMessageToHistory);
123 KMessageBox::detailedError(nullptr, i18n("Unable to commit"), details, i18nc("@title:window", "Commit Unsuccessful"));
227 QMap< QUrl, KDevelop::VcsStatusInfo::State> VCSDiffPatchSource::additionalSelectableFiles() const {
266 files += QLatin1String("<li>") + ICore::self()->projectController()->prettyFileName(url, KDevelop::IProjectController::FormatPlain) + QLatin1String("</li>");
269 QString text = i18n("<qt>Files will be committed:\n<ul>%1</ul>\nWith message:\n <pre>%2</pre></qt>", files, message);
271 int res = KMessageBox::warningContinueCancel(nullptr, text, i18nc("@title:window", "About to Commit to Repository"),
293 auto* patchReview = ICore::self()->pluginController()->extensionForPlugin<IPatchReview>(QStringLiteral("org.kdevelop.IPatchReview"));
bool finishReview(const QList< QUrl > &selection) override
Called when the user has reviewed and accepted this patch If canSelectFiles() returned true,...
Definition: vcsdiffpatchsources.cpp:255
void patchChanged()
Should be emitted whenever the patch has changed.
uint depth() const override
Depth - number of directories to left-strip from paths in the patch - see "patch -p" Defaults to 0.
Definition: vcsdiffpatchsources.cpp:181
void oldMessageChanged(const QString &)
Definition: vcsdiffpatchsources.cpp:106
virtual KDevelop::VcsDiff update() const =0
QMap< QUrl, KDevelop::VcsStatusInfo::State > additionalSelectableFiles() const override
May return an additional list of selectable files together with short description strings for this pa...
Definition: vcsdiffpatchsources.cpp:227
~VCSCommitDiffPatchSource() override
Definition: vcsdiffpatchsources.cpp:219
~VCSDiffPatchSource() override
Definition: vcsdiffpatchsources.cpp:163
void update() override
Explicit updating of the patch: If it is a dynamic patch, it should re-compare the files or whatever ...
Definition: vcsdiffpatchsources.cpp:213
void push_front(const T &value)
bool remove()
VCSDiffPatchSource(VCSDiffUpdater *updater)
The ownership of the updater is taken.
Definition: vcsdiffpatchsources.cpp:129
int removeAll(const T &value)
void addMessageToHistory(const QString &message)
Definition: vcsdiffpatchsources.cpp:89
Definition: vcsdiffpatchsources.h:66
void cancelReview() override
Called when the user has rejected this patch.
Definition: vcsdiffpatchsources.cpp:243
bool canSelectFiles() const override
Should return whether the user should be able to select files of the patch The files available for se...
Definition: vcsdiffpatchsources.cpp:223
virtual VcsJob * diff(const QUrl &fileOrDirectory, const VcsRevision &srcRevision, const VcsRevision &dstRevision, IBasicVersionControl::RecursionMode recursion=IBasicVersionControl::Recursive)=0
Retrieves a diff between two revisions of a file.
Definition: vcsdiff.h:37
void reviewCancelled(const QString &message)
This is the basic interface that all Version Control or Source Code Management plugins need to implem...
Definition: ibasicversioncontrol.h:52
bool showVcsDiff(IPatchSource *vcsDiff)
Sends the diff to the patch-review plugin.
Definition: vcsdiffpatchsources.cpp:291
virtual void startReview(IPatchSource *patch, ReviewMode mode=OpenAndRaise)=0
Starts a review on the patch: Opens the patch and the files within the review area.
void reserve(int size)
QStringList oldMessages() const
Definition: vcsdiffpatchsources.cpp:83
void jobFinished(KJob *)
Definition: vcsdiffpatchsources.cpp:115
virtual QUrl url() const =0
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QString finishReviewCustomText() const override
May return a custom text for the "Finish Review" action.
Definition: vcsdiffpatchsources.cpp:235
QUrl baseDir() const override
Should return the base-dir of the patch.
Definition: vcsdiffpatchsources.cpp:169
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
uint depth() const
Depth - number of directories to left-strip from paths in the patch - see "patch -p" Defaults to 0.
Definition: vcsdiff.cpp:93
QString tempPath()
void reserve(int alloc)
QWidget * customWidget() const override
Can return a custom widget that should be shown to the user with this patch The ownership of the widg...
Definition: vcsdiffpatchsources.cpp:231
QPointer< KTextEdit > m_commitMessageEdit
Definition: vcsdiffpatchsources.h:124
bool isValid() const
VCSCommitDiffPatchSource(VCSDiffUpdater *updater)
The ownership of the updater is taken.
Definition: vcsdiffpatchsources.cpp:47
int size() const
KDevelop::VcsDiff update() const override
Definition: vcsdiffpatchsources.cpp:304
void deleteLater()
virtual KDevelop::IBasicVersionControl * vcs() const =0
QMap< QUrl, KDevelop::VcsStatusInfo::State > m_selectable
Definition: vcsdiffpatchsources.h:92
bool canCancel() const override
Should return whether the user may cancel this review (cancelReview will be called when he does) The ...
Definition: vcsdiffpatchsources.cpp:239
QString name() const override
Name of the patch, that will be shown in a combo box.
Definition: vcsdiffpatchsources.cpp:177
QList< KDevelop::VcsStatusInfo > m_infos
Definition: vcsdiffpatchsources.h:91
QList< T > mid(int pos, int length) const
Any entity may delete an IPatchSource based object at will, so it must always be referenced through a...
Definition: ipatchsource.h:32
bool isEmpty() const
QUrl fromLocalFile(const QString &localFile)
QPointer< QWidget > m_commitMessageWidget
Definition: vcsdiffpatchsources.h:123
QString toLocalFile() const
The local copy (including any changes made).
Definition: vcsrevision.h:88
Definition: vcsdiffpatchsources.h:45
VCSStandardDiffUpdater(KDevelop::IBasicVersionControl *vcs, const QUrl &url)
Definition: vcsdiffpatchsources.cpp:318
QString path() const
This class provides an extension of KJob to get various VCS-specific information about the job.
Definition: vcsjob.h:43
don't run recursively through subdirectories
Definition: ibasicversioncontrol.h:59
void setContentsMargins(int left, int top, int right, int bottom)
Definition: dvcsevent.h:33
static VcsRevision createSpecialRevision(KDevelop::VcsRevision::RevisionSpecialType type)
Helper function to create a vcs revision for one of the special types.
Definition: vcsrevision.cpp:49
virtual void setupCommitMessageEditor(const QUrl &, KTextEdit *edit) const
Optionally apply VCS specific settings to the commit message editor.
Definition: ibasicversioncontrol.cpp:24
~VCSStandardDiffUpdater() override
Definition: vcsdiffpatchsources.cpp:324
Class that encapsulates status information for one local url.
Definition: vcsstatusinfo.h:47
T * data() const
KDevelop::IBasicVersionControl * m_vcs
Definition: vcsdiffpatchsources.h:125
virtual VcsJob * commit(const QString &message, const QList< QUrl > &localLocations, RecursionMode recursion=IBasicVersionControl::Recursive)=0
Checks in the changes of the given file(s)/dir(s) into the repository.
KComboBox * m_oldMessages
Definition: vcsdiffpatchsources.h:126
Definition: ipatchsource.h:97
void reviewFinished(const QString &message, const QList< QUrl > &selection)
virtual VcsJob * status(const QList< QUrl > &localLocations, RecursionMode recursion=IBasicVersionControl::Recursive)=0
Fetches the status of the given local vcs locations.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 23:37:48 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Jan 25 2021 23:37:48 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.