kdevplatform/vcs
#include <dvcsjob.h>

Public Slots | |
void | cancel () |
Signals | |
void | readyForParsing (KDevelop::DVcsJob *job) |
![]() | |
void | resultsReady (KDevelop::VcsJob *) |
Public Member Functions | |
DVcsJob (const QDir &workingDir, KDevelop::IPlugin *parent=nullptr, KDevelop::OutputJob::OutputJobVerbosity verbosity=KDevelop::OutputJob::Verbose) | |
~DVcsJob () override | |
QDir | directory () const |
void | displayOutput (const QString &output) |
QStringList | dvcsCommand () const |
QByteArray | errorOutput () const |
QVariant | fetchResults () override |
DVcsJob & | operator<< (const char *arg) |
DVcsJob & | operator<< (const QList< QUrl > &args) |
DVcsJob & | operator<< (const QString &arg) |
DVcsJob & | operator<< (const QStringList &args) |
virtual DVcsJob & | operator<< (const QUrl &arg) |
QString | output () const |
KProcess * | process () const |
QByteArray | rawOutput () const |
void | setCommunicationMode (KProcess::OutputChannelMode comm) |
void | setIgnoreError (bool ignore) |
virtual void | setResults (const QVariant &res) |
void | start () override |
KDevelop::VcsJob::JobStatus | status () const override |
KDevelop::IPlugin * | vcsPlugin () const override |
![]() | |
VcsJob (QObject *parent=nullptr, OutputJobVerbosity verbosity=OutputJob::Verbose) | |
~VcsJob () override | |
void | setType (JobType) |
JobType | type () const |
Protected Slots | |
virtual void | slotProcessError (QProcess::ProcessError) |
Protected Member Functions | |
bool | doKill () override |
Additional Inherited Members | |
![]() | |
enum | JobStatus { JobRunning = 0, JobSucceeded = 1, JobCanceled = 2, JobFailed = 3, JobNotStarted = 4 } |
enum | JobType { Unknown = -1, Add = 0, Remove = 1, Copy = 2, Move = 3, Diff = 4, Commit = 5, Update = 6, Merge = 7, Resolve = 8, Import = 9, Checkout = 10, Log = 11, Push = 12, Pull = 13, Annotate = 14, Clone = 15, Status = 16, Revert = 17, Cat = 18, Reset = 19, Apply = 20, UserType = 1000 } |
Detailed Description
This class is capable of running our dvcs commands.
Most of all DVcsJob are created in DVCS executors, but executed in DistributedVersionControlPlugin or any managers like BranchManager.
- Note
- Connect to KJob::result(KJob*) to be notified when the job finished.
How to create DVcsJob:
Usage example 1:
Usage example 2, asynchronous:
Constructor & Destructor Documentation
◆ DVcsJob()
|
explicit |
Definition at line 66 of file dvcsjob.cpp.
◆ ~DVcsJob()
|
overridedefault |
Member Function Documentation
◆ cancel
|
slot |
Cancel slot.
Definition at line 228 of file dvcsjob.cpp.
◆ directory()
QDir DVcsJob::directory | ( | ) | const |
Returns current working directory.
Definition at line 93 of file dvcsjob.cpp.
◆ displayOutput()
void DVcsJob::displayOutput | ( | const QString & | output | ) |
Definition at line 303 of file dvcsjob.cpp.
◆ doKill()
|
overrideprotected |
Definition at line 352 of file dvcsjob.cpp.
◆ dvcsCommand()
QStringList DVcsJob::dvcsCommand | ( | ) | const |
- Returns
- The command that is executed when calling start().
Definition at line 124 of file dvcsjob.cpp.
◆ errorOutput()
QByteArray DVcsJob::errorOutput | ( | ) | const |
- Returns
- The whole binary stderr output of the job.
Definition at line 151 of file dvcsjob.cpp.
◆ fetchResults()
|
overridevirtual |
Returns execution results stored in QVariant.
Mostly used in vcscommitdialog.
- See also
- setResults(const QVariant &res)
Implements KDevelop::VcsJob.
Definition at line 172 of file dvcsjob.cpp.
◆ operator<<() [1/5]
DVcsJob & DVcsJob::operator<< | ( | const char * | arg | ) |
Overloaded convenience function.
- Parameters
-
arg command or argument as utf8-encoded string
- See also
- operator<<(const QString& arg).
Definition at line 108 of file dvcsjob.cpp.
◆ operator<<() [2/5]
- See also
- operator<<(const QUrl& arg).
Definition at line 344 of file dvcsjob.cpp.
◆ operator<<() [3/5]
Call this method to set command to execute and its arguments.
- Note
- Don't forget <<"one two"; is not the same as <<"one"<<"two"; Use one word(command, arg) per one QString!
Definition at line 100 of file dvcsjob.cpp.
◆ operator<<() [4/5]
DVcsJob & DVcsJob::operator<< | ( | const QStringList & | args | ) |
Overloaded convenience function.
- See also
- operator<<(const QString& arg).
Definition at line 116 of file dvcsjob.cpp.
◆ operator<<() [5/5]
Overloaded operator << for url's, can be used to pass files and makes arguments absolute to the process working directory.
Override if you need to treat paths before adding them as parameters.
Definition at line 336 of file dvcsjob.cpp.
◆ output()
QString DVcsJob::output | ( | ) | const |
- Returns
- The whole output of the job as a string. (Might fail on binary data)
Definition at line 131 of file dvcsjob.cpp.
◆ process()
KProcess * DVcsJob::process | ( | ) | const |
Definition at line 377 of file dvcsjob.cpp.
◆ rawOutput()
QByteArray DVcsJob::rawOutput | ( | ) | const |
- Returns
- The whole binary output of the job
Definition at line 144 of file dvcsjob.cpp.
◆ readyForParsing
|
signal |
◆ setCommunicationMode()
void DVcsJob::setCommunicationMode | ( | KProcess::OutputChannelMode | comm | ) |
In some cases it's needed to specify the communication mode between the process and the job object.
This is for instance done for the "git status" command. If stdout and stderr are processed as separate streams, their signals do not always get emitted in correct order by KProcess, which will lead to a screwed up output.
- Note
- Default communication mode is KProcess::SeparateChannels.
Definition at line 221 of file dvcsjob.cpp.
◆ setIgnoreError()
void DVcsJob::setIgnoreError | ( | bool | ignore | ) |
Ignore a non-zero exit code depending on ignore
.
Definition at line 158 of file dvcsjob.cpp.
◆ setResults()
|
virtual |
Sets executions results.
In most cases this method is used by IDVCSexecutor
- See also
- fetchResults()
Definition at line 165 of file dvcsjob.cpp.
◆ slotProcessError
|
protectedvirtualslot |
Definition at line 235 of file dvcsjob.cpp.
◆ start()
|
override |
Call this method to start this job.
- Note
- Default communication mode is KProcess::AllOutput.
- See also
- Use setCommunicationMode() to override the default communication mode.
Definition at line 179 of file dvcsjob.cpp.
◆ status()
|
overridevirtual |
Returns JobStatus.
- See also
- KDevelop::VcsJob::JobStatus
Implements KDevelop::VcsJob.
Definition at line 322 of file dvcsjob.cpp.
◆ vcsPlugin()
|
overridevirtual |
Returns pointer to IPlugin (which was used to create a job).
Implements KDevelop::VcsJob.
Definition at line 329 of file dvcsjob.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu Apr 22 2021 23:31:47 by doxygen 1.8.16 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.