diff --git a/vcs/dvcs/dvcsjob.cpp b/vcs/dvcs/dvcsjob.cpp index d6ea1942e3..1ecd23d65c 100644 --- a/vcs/dvcs/dvcsjob.cpp +++ b/vcs/dvcs/dvcsjob.cpp @@ -1,308 +1,308 @@ /*************************************************************************** * This file was partly taken from KDevelop's cvs plugin * * Copyright 2002-2003 Christian Loose * * Copyright 2007 Robert Gruber * * * * Adapted for DVCS * * Copyright 2008 Evgeniy Ivanov * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 2 of * * the License or (at your option) version 3 or any later version * * accepted by the membership of KDE e.V. (or its successor approved * * by the membership of KDE e.V.), which shall act as a proxy * * defined in Section 14 of version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #include "dvcsjob.h" #include #include #include #include #include #include #include #include struct DVcsJobPrivate { DVcsJobPrivate() : childproc(new KProcess), commMode(KProcess::SeparateChannels), vcsplugin(0) { isRunning = failed = wasStarted = false; } ~DVcsJobPrivate() { delete childproc; } KProcess* childproc; QStringList command; QString server; QDir directory; bool isRunning; bool wasStarted; bool failed; QByteArray output; KProcess::OutputChannelMode commMode; KDevelop::IPlugin* vcsplugin; }; DVcsJob::DVcsJob(KDevelop::IPlugin* parent, KDevelop::OutputJob::OutputJobVerbosity verbosity) : VcsJob(parent, verbosity), d(new DVcsJobPrivate) { d->vcsplugin = parent; } DVcsJob::~DVcsJob() { delete d; } void DVcsJob::clear() { - //Do not use KProcess::clearEnvironment() (it sets the environment to kde_dummy. + //Do not use KProcess::clearEnvironment() (it sets the environment to kde_dummy). //Also DVCSjob can't set it, so it's ok. d->command.clear(); d->output.clear(); d->server.clear(); d->directory = QDir::temp(); d->isRunning = d->failed = d->wasStarted = false; } void DVcsJob::setServer(const QString& server) { d->server = server; } void DVcsJob::setDirectory(const QDir& directory) { d->directory = directory; } void DVcsJob::setStandardInputFile(const QString &fileName) { d->childproc->setStandardInputFile(fileName); } const QDir & DVcsJob::getDirectory() const { return d->directory; } bool DVcsJob::isRunning() const { return d->isRunning; } DVcsJob& DVcsJob::operator<<(const QString& arg) { d->command.append( arg ); return *this; } DVcsJob& DVcsJob::operator<<(const char* arg) { d->command.append( arg ); return *this; } DVcsJob& DVcsJob::operator<<(const QStringList& args) { d->command << args; return *this; } QString DVcsJob::dvcsCommand() const { return d->command.join(" "); } QString DVcsJob::output() const { QByteArray stdoutbuf = rawOutput(); int endpos = stdoutbuf.size(); if (isRunning()) { // We may have received only part of a code-point endpos = stdoutbuf.lastIndexOf('\n')+1; // Include the final newline or become 0, when there is no newline } return QString::fromLocal8Bit(stdoutbuf, endpos); } QByteArray DVcsJob::rawOutput() const { return d->output; } void DVcsJob::setResults(const QVariant &res) { results = res; } QVariant DVcsJob::fetchResults() { return results; } void DVcsJob::setExitStatus(const bool exitStatus) { d->failed = exitStatus; } void DVcsJob::start() { Q_ASSERT_X(!d->isRunning, "DVCSjob::start", "Another proccess was started using this job class"); d->wasStarted = true; #if 0 //do not allow to run commands in the application's working dir //TODO: change directory to KUrl, check if it's a relative path if(d->directory.isEmpty() ) { kDebug() << "No working directory specified for DVCS command"; slotProcessError(QProcess::UnknownError); return; } #endif const QString workingDirectory = d->directory.absolutePath(); kDebug() << "Working directory:" << workingDirectory; d->childproc->setWorkingDirectory(workingDirectory); connect(d->childproc, SIGNAL(finished(int, QProcess::ExitStatus)), SLOT(slotProcessExited(int, QProcess::ExitStatus))); connect(d->childproc, SIGNAL(error( QProcess::ProcessError )), SLOT(slotProcessError(QProcess::ProcessError))); connect(d->childproc, SIGNAL(readyReadStandardError()), SLOT(slotReceivedStderr())); connect(d->childproc, SIGNAL(readyReadStandardOutput()), SLOT(slotReceivedStdout())); kDebug() << "Execute dvcs command:" << dvcsCommand(); d->output.clear(); d->isRunning = true; d->childproc->setOutputChannelMode( d->commMode ); d->childproc->setProgram( d->command ); d->childproc->setEnvironment(QProcess::systemEnvironment()); //the started() and error() signals may be delayed! It causes crash with deferred deletion!!! d->childproc->waitForStarted(); d->childproc->start(); } void DVcsJob::setCommunicationMode(KProcess::OutputChannelMode comm) { d->commMode = comm; } void DVcsJob::cancel() { d->childproc->kill(); } void DVcsJob::slotProcessError( QProcess::ProcessError err ) { // disconnect all connections to childproc's signals; they are no longer needed d->childproc->disconnect(); d->isRunning = false; //NOTE: some DVCS commands can use stderr... d->failed = true; //Do not use d->childproc->exitCode() to set an error! If we have FailedToStart exitCode will return 0, //and if exec is used, exec will return true and that is wrong! setError(UserDefinedError); setErrorText( i18n("Process exited with status %1", d->childproc->exitCode() ) ); QString errorValue; //if trolls add Q_ENUMS for QProcess, then we can use better solution than switch: //QMetaObject::indexOfEnumerator(char*), QLatin1String(QMetaEnum::valueToKey())... switch (err) { case QProcess::FailedToStart: errorValue = "FailedToStart"; break; case QProcess::Crashed: errorValue = "Crashed"; break; case QProcess::Timedout: errorValue = "Timedout"; break; case QProcess::WriteError: errorValue = "WriteErro"; break; case QProcess::ReadError: errorValue = "ReadError"; break; case QProcess::UnknownError: errorValue = "UnknownError"; break; } kDebug() << "oops, found an error while running" << dvcsCommand() << ":" << errorValue << "Exit code is:" << d->childproc->exitCode(); jobIsReady(); } void DVcsJob::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus) { // disconnect all connections to childproc's signals; they are no longer needed d->childproc->disconnect(); d->isRunning = false; if (exitStatus != QProcess::NormalExit || exitCode != 0) slotProcessError(QProcess::UnknownError); kDebug() << "process has finished with no errors"; jobIsReady(); } void DVcsJob::slotReceivedStdout() { // accumulate output d->output.append(d->childproc->readAllStandardOutput()); } void DVcsJob::slotReceivedStderr() { // accumulate output d->output.append(d->childproc->readAllStandardError()); } KDevelop::VcsJob::JobStatus DVcsJob::status() const { if (!d->wasStarted) return KDevelop::VcsJob::JobNotStarted; if (d->failed) return KDevelop::VcsJob::JobFailed; if (d->isRunning) return KDevelop::VcsJob::JobRunning; return KDevelop::VcsJob::JobSucceeded; } KDevelop::IPlugin* DVcsJob::vcsPlugin() const { return d->vcsplugin; } void DVcsJob::jobIsReady() { emit readyForParsing(this); //let parsers to set status emitResult(); //KJob emit resultsReady(this); //VcsJob } KProcess* DVcsJob::getChildproc() {return d->childproc;} diff --git a/vcs/dvcs/dvcsjob.h b/vcs/dvcs/dvcsjob.h index 7ebd095936..a3948a956a 100644 --- a/vcs/dvcs/dvcsjob.h +++ b/vcs/dvcs/dvcsjob.h @@ -1,239 +1,239 @@ /*************************************************************************** * This file was partly taken from KDevelop's cvs plugin * * Copyright 2002-2003 Christian Loose * * Copyright 2007 Robert Gruber * * * * Adapted for DVCS * * Copyright 2008 Evgeniy Ivanov * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 2 of * * the License or (at your option) version 3 or any later version * * accepted by the membership of KDE e.V. (or its successor approved * * by the membership of KDE e.V.), which shall act as a proxy * * defined in Section 14 of version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #ifndef DVCS_JOB_H #define DVCS_JOB_H #include #include #include #include "../vcsexport.h" #include "../vcsjob.h" class QDir; class DVcsJobPrivate; /** * This class is capable of running our dvcs commands. - * Most of all DVCSjobs are created in DVCS executors, but executed in DistributedVersionControlPlugin or + * 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. + * @note Connect to KJob::result(KJob*) to be notified when the job finished. * - * How to create DVCSjob: + * How to create DVcsJob: * @code - * DVCSjob* job = new DVCSjob(vcsplugin); + * DVcsJob* job = new DVcsJob(vcsplugin); * if (job) * { * job->setDirectory(workDir); * *job << "git-rev-parse"; * foreach(const QString &arg, args) // *job << args can be used instead! * *job << arg; * return job; * } * if (job) delete job; * return NULL; * @endcode * * Usage example 1: * @code * VcsJob* j = add(DistributedVersionControlPlugin::d->m_ctxUrlList, IBasicVersionControl::Recursive); - * DVCSjob* job = dynamic_cast(j); + * DVcsJob* job = dynamic_cast(j); * if (job) { * connect(job, SIGNAL(result(KJob*) ), * this, SIGNAL(jobFinished(KJob*) )); * job->start(); * } * @endcode * * Usage example 2: * @code - * DVCSjob *branchJob = d->branch(repo, baseBranch, newBranch); - * DVCSjob* job = gitRevParse(dirPath.toLocalFile(), QStringList(QString("--is-inside-work-tree"))); + * DVcsJob* branchJob = d->branch(repo, baseBranch, newBranch); + * DVcsJob* job = gitRevParse(dirPath.toLocalFile(), QStringList(QString("--is-inside-work-tree"))); * if (job) * { * job->exec(); * if (job->status() == KDevelop::VcsJob::JobSucceeded) * return true; * else - * //something, mabe even just + * //something, maybe even just * return false * } * @endcode * * @author Robert Gruber * @author Evgeniy Ivanov */ class KDEVPLATFORMVCS_EXPORT DVcsJob : public KDevelop::VcsJob { Q_OBJECT public: DVcsJob(KDevelop::IPlugin* parent, KDevelop::OutputJob::OutputJobVerbosity verbosity = KDevelop::OutputJob::Verbose); virtual ~DVcsJob(); /** * Call this method to clear the job (for example, before setting another job). */ void clear(); /** * It's not used in any DVCS plugin. */ void setServer(const QString& server); /** * Sets working directory. - * @param directory Should contain only absolute path. Relative path or "" (working dir) are deprecated and will make job failed. - * @note In DVCS plugins directory variable is used to get relative pathes. + * @param directory Should contain only absolute path. Relative paths or "" (working dir) are deprecated and will make the job fail. + * @note In DVCS plugins directory variable is used to get relative paths. */ void setDirectory(const QDir & directory); /** - * Sets standart Input file. + * Sets standard input file. */ void setStandardInputFile(const QString &fileName); /** * Returns current working directory. */ QDir const & getDirectory() const; /** * 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! */ DVcsJob& operator<<(const QString& arg); /** * Overloaded convenience function. * @see operator<<(const QString& arg). */ DVcsJob& operator<<(const char* arg); /** * Overloaded convenience function. * @see operator<<(const QString& arg). */ DVcsJob& operator<<(const QStringList& args); /** - * Call this mehod to start this job. - * @note Default communiaction mode is KProcess::AllOutput. + * Call this method to start this job. + * @note Default communication mode is KProcess::AllOutput. * @see Use setCommunicationMode() to override the default communication mode. */ virtual void start(); /** - * In some cases it's needed to specify the communisation mode between the + * 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 emmited in correct order by KProcess. Which will lead to a + * 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 communiaction mode is KProcess::SeparateChannels. + * @note Default communication mode is KProcess::SeparateChannels. */ void setCommunicationMode(KProcess::OutputChannelMode comm); /** * @return The command that is executed when calling start(). */ QString dvcsCommand() const; /** * @return The whole output of the job as a string. (Might fail on binary data) */ QString output() const; /** * @return The whole binary output of the job */ QByteArray rawOutput() const; // Begin: KDevelop::VcsJob /** - * Sets executions reults. + * Sets executions results. * In most cases this method is used by IDVCSexecutor * @see fetchResults() */ virtual void setResults(const QVariant &res); /** * Returns execution results stored in QVariant. * Mostly used in vcscommitdialog. * @see setResults(const QVariant &res) */ virtual QVariant fetchResults(); /** * Sets exit status (d->failed variable). * Since only executors can parse the job to set result, they can connect parsers to readyForParsing(DVCSjob) using - * Qt::DirectConnection to set the result. For example git-status can return exit status 1 - * if you don't set exit status in your parser then you will have JobFailes in status() result. + * Qt::DirectConnection to set the result. For example git-status can return exit status 1. + * If you don't set exit status in your parser then you will have JobFailed in status() result. * @note First result is set in slotProcessExited() or slotProcessError(). */ virtual void setExitStatus(const bool exitStatus); /** * Returns JobStatus * @see KDevelop::VcsJob::JobStatus */ virtual KDevelop::VcsJob::JobStatus status() const; /** * Returns pointer to IPlugin (which was used to create a job). */ virtual KDevelop::IPlugin* vcsPlugin() const; // End: KDevelop::VcsJob KProcess *getChildproc(); public Q_SLOTS: /** * Cancel slot. */ void cancel(); /** * Returns if the job is running. */ bool isRunning() const; Q_SIGNALS: void readyForParsing(DVcsJob *job); private Q_SLOTS: void slotProcessError( QProcess::ProcessError ); void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus); void slotReceivedStdout(); void slotReceivedStderr(); private: void jobIsReady(); DVcsJobPrivate* const d; QVariant results; }; #endif diff --git a/vcs/dvcs/dvcsplugin.cpp b/vcs/dvcs/dvcsplugin.cpp index c94593ee4d..95903899bf 100644 --- a/vcs/dvcs/dvcsplugin.cpp +++ b/vcs/dvcs/dvcsplugin.cpp @@ -1,374 +1,374 @@ /*************************************************************************** * This file was partly taken from KDevelop's cvs plugin * * Copyright 2007 Robert Gruber * * * * Adapted for DVCS (added templates) * * Copyright 2008 Evgeniy Ivanov * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 2 of * * the License or (at your option) version 3 or any later version * * accepted by the membership of KDE e.V. (or its successor approved * * by the membership of KDE e.V.), which shall act as a proxy * * defined in Section 14 of version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #ifndef DVCS_PLUGIN_CC #define DVCS_PLUGIN_CC #include "dvcsplugin.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dvcsjob.h" #include "ui/dvcsmainview.h" #include "ui/dvcsgenericoutputview.h" #include "ui/importdialog.h" #include "ui/importmetadatawidget.h" #include "ui/logview.h" #include "ui/branchmanager.h" // #include "ui/commitmanager.h" #include "ui/revhistory/commitlogmodel.h" #include "ui/revhistory/commitView.h" #include #include #include #include namespace KDevelop { struct DistributedVersionControlPluginPrivate { explicit DistributedVersionControlPluginPrivate(DistributedVersionControlPlugin * pThis) : m_factory(new KDevDVCSViewFactory(pThis)) , m_common(new VcsPluginHelper(pThis, pThis)) {} KDevDVCSViewFactory* m_factory; std::auto_ptr m_common; }; //class DistributedVersionControlPlugin DistributedVersionControlPlugin::DistributedVersionControlPlugin(QObject *parent, KComponentData compData) : IPlugin(compData, parent) , d(new DistributedVersionControlPluginPrivate(this)) { QString EasterEgg = i18n("Horses are forbidden to eat fire hydrants in Marshalltown, Iowa."); Q_UNUSED(EasterEgg) } DistributedVersionControlPlugin::~DistributedVersionControlPlugin() { //TODO: Find out why this crashes on the svn tests delete d->m_factory; delete d; } // Begin: KDevelop::IBasicVersionControl QList DistributedVersionControlPlugin::getModifiedFiles(const QString &, KDevelop::OutputJob::OutputJobVerbosity) { Q_ASSERT(!"Either implement DistributedVersionControlPlugin::status() or this function"); return QList(); } QList DistributedVersionControlPlugin::getCachedFiles(const QString &, KDevelop::OutputJob::OutputJobVerbosity) { Q_ASSERT(!"Either implement DistributedVersionControlPlugin::status() or this function"); return QList(); } QList DistributedVersionControlPlugin::getOtherFiles(const QString &, KDevelop::OutputJob::OutputJobVerbosity) { Q_ASSERT(!"Either implement DistributedVersionControlPlugin::status() or this function"); return QList(); } KDevelop::VcsJob* DistributedVersionControlPlugin::log(const KUrl& url, const VcsRevision& from, const VcsRevision& to) { Q_UNUSED(to) return log(url, from, 0); } // End: KDevelop::IBasicVersionControl // Begin: KDevelop::IDistributedVersionControl // End: KDevelop::IDistributedVersionControl KDevelop::VcsImportMetadataWidget* DistributedVersionControlPlugin::createImportMetadataWidget(QWidget* parent) { return new ImportMetadataWidget(parent); } KDevelop::ContextMenuExtension DistributedVersionControlPlugin::contextMenuExtension(Context* context) { d->m_common->setupFromContext(context); KUrl::List const & ctxUrlList = d->m_common->contextUrlList(); if (ctxUrlList.isEmpty()) return ContextMenuExtension(); bool isWorkingDirectory = false; foreach(const KUrl &url, ctxUrlList) { if (isValidDirectory(url)) { isWorkingDirectory = true; break; } } if (!isWorkingDirectory) { // Not part of a repository return ContextMenuExtension(); } QMenu * menu = d->m_common->commonActions(); menu->addSeparator(); KAction *action; action = new KAction(KIcon("arrow-up-double"), i18n("Push..."), this); connect(action, SIGNAL(triggered()), this, SLOT(ctxPush())); menu->addAction(action); action = new KAction(KIcon("arrow-down-double"), i18n("Pull..."), this); connect(action, SIGNAL(triggered()), this, SLOT(ctxPull())); menu->addAction(action); action = new KAction(i18n("Branch Manager"), this); connect(action, SIGNAL(triggered()), this, SLOT(ctxBranchManager())); menu->addAction(action); action = new KAction(i18n("Revision History"), this); connect(action, SIGNAL(triggered()), this, SLOT(ctxRevHistory())); menu->addAction(action); ContextMenuExtension menuExt; menuExt.addAction(ContextMenuExtension::ExtensionGroup, menu->menuAction()); return menuExt; } void DistributedVersionControlPlugin::slotInit() { KUrl::List const & ctxUrlList = d->m_common->contextUrlList(); Q_ASSERT(!ctxUrlList.isEmpty()); KUrl url = ctxUrlList.front(); QFileInfo repoInfo = QFileInfo(url.toLocalFile()); if (repoInfo.isFile()) url = repoInfo.path(); ImportDialog dlg(this, url); dlg.exec(); } void DistributedVersionControlPlugin::ctxPush() { KUrl::List const & ctxUrlList = d->m_common->contextUrlList(); Q_ASSERT(!ctxUrlList.isEmpty()); VcsJob* job = push(ctxUrlList.front().toLocalFile(), VcsLocation()); if (job) { connect(job, SIGNAL(result(KJob*)), this, SIGNAL(jobFinished(KJob*))); job->start(); } } void DistributedVersionControlPlugin::ctxPull() { KUrl::List const & ctxUrlList = d->m_common->contextUrlList(); Q_ASSERT(!ctxUrlList.isEmpty()); VcsJob* job = pull(VcsLocation(), ctxUrlList.front().toLocalFile()); if (job) { connect(job, SIGNAL(result(KJob*)), this, SIGNAL(jobFinished(KJob*))); job->start(); } } void DistributedVersionControlPlugin::ctxBranchManager() { KUrl::List const & ctxUrlList = d->m_common->contextUrlList(); Q_ASSERT(!ctxUrlList.isEmpty()); BranchManager * branchManager = new BranchManager(ctxUrlList.front().toLocalFile(), this, core()->uiController()->activeMainWindow()); branchManager->show(); } void DistributedVersionControlPlugin::ctxRevHistory() { KUrl::List const & ctxUrlList = d->m_common->contextUrlList(); Q_ASSERT(!ctxUrlList.isEmpty()); CommitLogModel* model = new CommitLogModel(getAllCommits(ctxUrlList.front().toLocalFile())); CommitView *revTree = new CommitView; revTree->setModel(model); emit addNewTabToMainView(revTree, i18n("Revision History")); } void DistributedVersionControlPlugin::checkoutFinished(KJob* _checkoutJob) { DVcsJob* checkoutJob = dynamic_cast(_checkoutJob); QString workingDir = checkoutJob->getDirectory().absolutePath(); kDebug() << "checkout url is: " << workingDir; KDevelop::IProject* curProject = core()->projectController()->findProjectForUrl(KUrl(workingDir)); if (!curProject) { kDebug() << "couldn't find project for url:" << workingDir; return; } KUrl projectFile = curProject->projectFileUrl(); core()->projectController()->closeProject(curProject); //let's ask to save all files! if (!checkoutJob->exec()) { kDebug() << "CHECKOUT PROBLEM!"; } kDebug() << "projectFile is " << projectFile << " JobDir is " << workingDir; kDebug() << "Project was closed, now it will be opened"; core()->projectController()->openProject(projectFile); // maybe IProject::reloadModel? -// emit jobFinished(_checkoutJob); //couses crash! +// emit jobFinished(_checkoutJob); //causes crash! } KDevDVCSViewFactory * DistributedVersionControlPlugin::dvcsViewFactory() const { return d->m_factory; } bool DistributedVersionControlPlugin::prepareJob(DVcsJob* job, const QString& repository, RequestedOperation op) { if (!job) { return false; } // Only do this check if it's a normal operation like diff, log ... // For other operations like "git clone" isValidDirectory() would fail as the // directory is not yet under git control if (op == NormalOperation && !isValidDirectory(repository)) { kDebug() << repository << " is not a valid repository"; return false; } QFileInfo repoInfo(repository); if (!repoInfo.isAbsolute()) { //We don't want to have empty or non-absolute pathes for working dir return false; } // clear commands and args from a possible previous run job->clear(); //repository is sent by ContextMenu, so we check if it is a file and use it's path if (repoInfo.isFile()) job->setDirectory(repoInfo.absoluteDir()); else job->setDirectory(QDir(repository)); return true; } QString DistributedVersionControlPlugin::stripPathToDir(const QString &path) { QFileInfo repoInfo = QFileInfo(path); if (repoInfo.isFile()) return repoInfo.path() + QDir::separator(); else if (path.endsWith(QDir::separator())) return path; else return path + QDir::separator(); } bool DistributedVersionControlPlugin::addFileList(DVcsJob* job, const KUrl::List& urls) { QStringList args; const QDir & dir = job->getDirectory(); const QString workingDir = dir.absolutePath(); foreach(const KUrl &url, urls) { ///@todo this is ok for now, but what if some of the urls are not /// to the given repository //all urls should be relative to the working directory! //if url is relative we rely on it's relative to job->getDirectory(), so we check if it's exists QString file; if (url.isEmpty()) file = '.'; else if (!url.isRelative()) file = dir.relativeFilePath(url.toLocalFile()); else file = url.toLocalFile(); args << file; kDebug() << "url is: " << url << "job->getDirectory(): " << workingDir << " file is: " << file; } *job << args; return true; } DVcsJob* DistributedVersionControlPlugin::empty_cmd(KDevelop::OutputJob::OutputJobVerbosity verbosity) { DVcsJob* j = new DVcsJob(this, verbosity); *j << "echo" << "command not implemented" << "-n"; return j; } } //----------------------------------------------------------------------------------- //class KDevDVCSViewFactory QWidget* KDevDVCSViewFactory::create(QWidget *parent) { return new DVCSmainView(m_plugin, parent); } Qt::DockWidgetArea KDevDVCSViewFactory::defaultPosition() { return Qt::BottomDockWidgetArea; } QString KDevDVCSViewFactory::id() const { return "org.kdevelop.DVCSview"; } #endif diff --git a/vcs/dvcs/dvcsplugin.h b/vcs/dvcs/dvcsplugin.h index d34f22d909..8f99cbef0d 100644 --- a/vcs/dvcs/dvcsplugin.h +++ b/vcs/dvcs/dvcsplugin.h @@ -1,209 +1,209 @@ /*************************************************************************** * Copyright 2008 Evgeniy Ivanov * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * * published by the Free Software Foundation; either version 2 of * * the License or (at your option) version 3 or any later version * * accepted by the membership of KDE e.V. (or its successor approved * * by the membership of KDE e.V.), which shall act as a proxy * * defined in Section 14 of version 3 of the license. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program. If not, see . * ***************************************************************************/ #ifndef DVCS_PLUGIN_H #define DVCS_PLUGIN_H #include #include #include #include #include #include #include #include "dvcsevent.h" #include #include #include class QString; class KDevDVCSViewFactory; class DVcsJob; namespace KDevelop { class VcsJob; class ContextMenuExtension; struct DistributedVersionControlPluginPrivate; /** * DistributedVersionControlPlugin is a base class for git/hg/bzr plugins. This class implements * KDevelop::IBasicVersionControl, KDevelop::IDistributedVersionControl and KDevelop::IPlugin (contextMenuExtension). * DistributedVersionControlPlugin class uses IDVCSexecutor to get all jobs * from real DVCS plugins like Git. It is based on KDevelop's CVS plugin (also looks like svn plugin is it's relative too). - * @note Create only special items in contextMenuExtension, all standart menu items are created in vcscommon plugin! + * @note Create only special items in contextMenuExtension, all standard menu items are created in vcscommon plugin! */ class KDEVPLATFORMVCS_EXPORT DistributedVersionControlPlugin : public IPlugin, public IDistributedVersionControl { Q_OBJECT Q_INTERFACES(KDevelop::IBasicVersionControl KDevelop::IDistributedVersionControl) public: DistributedVersionControlPlugin(QObject *parent, KComponentData compData); virtual ~DistributedVersionControlPlugin(); // Begin: KDevelop::IBasicVersionControl virtual VcsJob* log(const KUrl& localLocation, const VcsRevision& rev, unsigned long limit) = 0; virtual VcsJob* log(const KUrl& localLocation, const VcsRevision& rev, const VcsRevision& limit); /** Used in KDevelop's appwizardplugin (creates import widget) */ virtual VcsImportMetadataWidget* createImportMetadataWidget(QWidget* parent); // From KDevelop::IPlugin /** Creates context menu - * @note Create only special items here (like checkout), all standart menu items are created in vcscommon plugin! + * @note Create only special items here (like checkout), all standard menu items are created in vcscommon plugin! */ virtual ContextMenuExtension contextMenuExtension(Context*); /** * Parses the output generated by a @code dvcs log @endcode command and * fills the given QList with all commits infos found in the given output. * @param job The finished job of a @code dvcs log @endcode call * @param revisions Will be filled with all revision infos found in @p jobOutput * TODO: Change it to pass the results in @code job->getResults() @endcode */ virtual void parseLogOutput(const DVcsJob * job, QList& revisions) const = 0; // In tree branch-management virtual DVcsJob* switchBranch(const QString &repository, const QString &branch) = 0; /** Branch. */ virtual DVcsJob* branch(const QString &repository, const QString &basebranch = QString(), const QString &branch = QString(), const QStringList &args = QStringList()) = 0; //parsers for branch: /** Returns current branch. */ virtual QString curBranch(const QString &repository) = 0; /** Returns the list of branches. */ virtual QStringList branches(const QString &repository) = 0; // End: In tree branch-management public Q_SLOTS: //slots for context menu void ctxPush(); void ctxPull(); void ctxBranchManager(); void ctxRevHistory(); // slots for menu void slotInit(); /** * Updates project state after checkout (simply reloads it now) */ void checkoutFinished(KJob*); Q_SIGNALS: /** * Some actions like commit, add, remove... will connect the job's * result() signal to this signal. Anybody, like for instance the * DVCSMainView class, that is interested in getting notified about * jobs that finished can connect to this signal. * @see class GitMainView */ void jobFinished(KJob* job); /** * Gets emmited when a job like log, editors... was created. * GitPlugin will connect the newly created view to the result() signal * of a job. So the new view will show the output of that job as * soon as it has finished. */ void addNewTabToMainView(QWidget* tab, QString label); protected: /////////////////// /** Checks if dirPath is located in DVCS repository */ virtual bool isValidDirectory(const KUrl &dirPath) = 0; // Additional interface to be implemented by derived plugins //commit dialog helpers: /** Returns the list of modified files (diff between workdir and index). */ virtual QList getModifiedFiles(const QString &directory, KDevelop::OutputJob::OutputJobVerbosity verbosity = KDevelop::OutputJob::Verbose); /** Returns the list of already cached files (diff between index and HEAD). */ virtual QList getCachedFiles(const QString &directory, KDevelop::OutputJob::OutputJobVerbosity verbosity = KDevelop::OutputJob::Verbose); /** Files are not in the repo, but in the repository location. */ virtual QList getOtherFiles(const QString &directory, KDevelop::OutputJob::OutputJobVerbosity verbosity = KDevelop::OutputJob::Verbose); /** empty_cmd is used when something is not implemented, but has to return any job */ virtual DVcsJob* empty_cmd(KDevelop::OutputJob::OutputJobVerbosity verbosity = KDevelop::OutputJob::Verbose); - /** Returs the list of all commits (in all branches). + /** Returns the list of all commits (in all branches). * @see CommitView and CommitViewDelegate to see how this list is used. */ virtual QList getAllCommits(const QString &repo) = 0; KDevDVCSViewFactory * dvcsViewFactory() const; /** RequestedOperation is used to know if we should check the repo with isValidDirectory * or we want to create new repo (init/clone). */ enum RequestedOperation { NormalOperation, /**< add/commit/etc, check if we are in the repo */ Init /**< we need init/clone, so don't call isValidDirectory, we're not in the repo, but yet ;) */ }; /** This method checks RequestedOperation, clears the job and sets working directory. * Returns false only if op == NormalOperation and we are not in the repository. * @param job the DVCSjob to be prepared * @param repository working directiry * @param op shows if the method should run isValidDirectory */ virtual bool prepareJob(DVcsJob* job, const QString& repository, enum RequestedOperation op = NormalOperation); /** Add files as args to the job. It changes absolute pathes to relatives */ static bool addFileList(DVcsJob* job, const KUrl::List& urls); /** Always returns directory path. * @param path a path of a file or a directory. - * @return if path argument if file then returns parent directory, otherwice path arg is returned. + * @return if path argument if file then returns parent directory, otherwise path arg is returned. * @todo it will be nice to change prepareJob() so it can change its repository argument. */ static QString stripPathToDir(const QString &path); private: DistributedVersionControlPluginPrivate * const d; }; } class KDevDVCSViewFactory: public KDevelop::IToolViewFactory { public: KDevDVCSViewFactory(KDevelop::DistributedVersionControlPlugin *plugin): m_plugin(plugin) {} virtual QWidget* create(QWidget *parent = 0); virtual Qt::DockWidgetArea defaultPosition(); virtual QString id() const; private: KDevelop::DistributedVersionControlPlugin *m_plugin; }; #endif diff --git a/vcs/vcsjob.h b/vcs/vcsjob.h index eae14afdee..42e1ec0f4c 100644 --- a/vcs/vcsjob.h +++ b/vcs/vcsjob.h @@ -1,146 +1,146 @@ /* This file is part of KDevelop * * Copyright 2007 Andreas Pakulat * Copyright 2007 Matthew Woehlke * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef VCSJOB_H #define VCSJOB_H #include #include "vcsexport.h" class QVariant; class QString; class KUrl; namespace KDevelop { class IPlugin; /** - * This class provides an extension of KJob to get various Vcs - * specific information about the job. This includes the type, the state + * This class provides an extension of KJob to get various VCS-specific + * information about the job. This includes the type, the state * and the results provided by the job. * */ class KDEVPLATFORMVCS_EXPORT VcsJob : public OutputJob { Q_OBJECT public: VcsJob( QObject* parent = 0, OutputJobVerbosity verbosity = OutputJob::Verbose); virtual ~VcsJob(); /** - * To easily check which type of job this is + * To easily check which type of job this is. * * @TODO: Check how this can be extended via plugins, maybe use QFlag? (not * QFlags!) */ enum JobType { Add = 0 /**< An add job */, Remove = 1 /**< A remove job */, Copy = 2 /**< A copy job */, Move = 3 /**< A move job */, Diff = 4 /**< A diff job */, Commit = 5 /**< A commit job */, Update = 6 /**< An update job */, Merge = 7 /**< A merge job */, Resolve = 8 /**< A resolve job */, Import = 9 /**< An import job */, Checkout = 10 /**< A checkout job */, Log = 11 /**< A log job */, Push = 12 /**< A push job */, Pull = 13 /**< A pull job */, Annotate = 14 /**< An annotate job */, Clone = 15 /**< A clone job */, Status = 16 /**< A status job */, Revert = 17 /**< A revert job */, Cat = 18 /**< A cat job */, UserType = 1000 /**< A custom job */ }; /** - * Simple enum to define how the job finished + * Simple enum to define how the job finished. */ enum JobStatus { JobRunning = 0 /**< The job is running */, JobSucceeded = 1 /**< The job succeeded */, JobCanceled = 2 /**< The job was cancelled */, JobFailed = 3 /**< The job failed */, JobNotStarted = 4 /**< The job is not yet started */ }; /** * This method will return all new results of the job. The actual data * type that is wrapped in the QVariant depends on the type of job. * * @note Results returned by a previous call to fetchResults are not * returned. */ virtual QVariant fetchResults() = 0; /** - * Find out in which state the job is, it can be running, cancelled + * Find out in which state the job is. It can be running, canceled, * failed or finished * * @return the status of the job * @see JobStatus */ virtual JobStatus status() const = 0; /** - * Used to find out about the type of job + * Used to find out about the type of job. * * @return the type of job */ JobType type(); /** * Used to get at the version control plugin. The plugin * can be used to get one of the interfaces to execute - * more vcs actions, depending on this jobs results + * more vcs actions, depending on this job's results * (like getting a diff for an entry in a log) */ virtual KDevelop::IPlugin* vcsPlugin() const = 0; protected: /** - * This can be used to set the type of the vcs job in subclasses + * This can be used to set the type of the vcs job in subclasses. */ void setType( JobType ); Q_SIGNALS: /** * This signal is emitted when new results are available. Depending on * the plugin and the operation, it may be emitted only once when all * results are ready, or several times. */ void resultsReady( KDevelop::VcsJob* ); private: class VcsJobPrivate* const d; }; } #endif diff --git a/vcs/vcslocation.h b/vcs/vcslocation.h index 3ec8756a00..3b70a41d36 100644 --- a/vcs/vcslocation.h +++ b/vcs/vcslocation.h @@ -1,162 +1,162 @@ /* This file is part of KDevelop * * Copyright 2007 Andreas Pakulat * Copyright 2007 Matthew Woehlke * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef KDEVVCSLOCATION_H #define KDEVVCSLOCATION_H #include "vcsexport.h" #include #include #include namespace KDevelop { /** - * Denotes a local or repository location for a Vcs system + * Denotes a local or repository location for a Vcs system. * - * For the RepositoryLocation type most of the information - * are vcs specific + * For the RepositoryLocation type, most of the information + * is vcs-specific. */ class KDEVPLATFORMVCS_EXPORT VcsLocation { public: enum LocationType { LocalLocation = 0 /**< this is a local location */, RepositoryLocation = 1 /**< this is a repository location */ }; VcsLocation(); VcsLocation( const KUrl& ); VcsLocation( const QString& ); ~VcsLocation(); VcsLocation( const VcsLocation& ); VcsLocation& operator=( const VcsLocation& ); /** * @returns Local url if this location is a LocalLocation */ KUrl localUrl() const; /** - * Returns a string for the repository, usually this identifies the server + * Returns a string for the repository, usually this identifies the server. * @returns a vcs-implementation-specific string identifying the server */ QString repositoryServer() const; /** - * Returns the module or module path inside the server + * Returns the module or module path inside the server. * @returns a vcs-implementation-specific string identifying the module */ QString repositoryModule() const; /** - * identifies the tag which this location belongs to + * Identifies the tag which this location belongs to. * @returns a vcs-implementation-specific string identifying the tag */ QString repositoryTag() const; /** - * identifies the branch to which this location belongs to + * Identifies the branch to which this location belongs to. * @returns a vcs-implementation-specific string identifying the branch */ QString repositoryBranch() const; /** - * This can define a path relative to the module, this is used + * This can define a path relative to the module. This is used * when identifying a subdirectory or file inside a repository location * @returns a path relative to module */ QString repositoryPath() const; /** * @returns the type of this location */ LocationType type() const; /** * Set the local url for this location, automatically sets the type to LocalLocation * @param url the local url */ void setLocalUrl( const KUrl& url ); /** * Set the server string for this location, automatically sets the type to RepositoryLocation */ void setRepositoryServer( const QString& ); /** * Set the module for this location, automatically sets the type to RepositoryLocation */ void setRepositoryModule( const QString& ); /** * Set the branch string for this location, automatically sets the type to RepositoryLocation */ void setRepositoryBranch( const QString& ); /** * Set the tag string for this location, automatically sets the type to RepositoryLocation */ void setRepositoryTag( const QString& ); /** * Set the path for this location, automatically sets the type to RepositoryLocation */ void setRepositoryPath( const QString& ); /** - * Allows to add vcs-specific data to this location - * automatically sets the type to RepositoryLocation + * Allows to add vcs-specific data to this location. + * Automatically sets the type to RepositoryLocation * @param data the vcs-specific data */ void setUserData( const QVariant& ); /** * retrieve vcs-specific data */ QVariant userData() const; bool operator==( const KDevelop::VcsLocation& ); bool isValid() const; private: class VcsLocationPrivate* d; }; inline uint qHash( const KDevelop::VcsLocation& loc ) { if( loc.type() == KDevelop::VcsLocation::LocalLocation ) { return qHash(loc.localUrl()); }else { return qHash(loc.repositoryServer()); } } inline bool operator==( const KDevelop::VcsLocation& lhs, const KDevelop::VcsLocation& rhs ) { return( lhs.type() == rhs.type() && lhs.repositoryServer() == rhs.repositoryServer() && lhs.localUrl() == rhs.localUrl() ); } } Q_DECLARE_METATYPE( KDevelop::VcsLocation ) #endif diff --git a/vcs/vcsrevision.h b/vcs/vcsrevision.h index 880cf26a6d..0d7a78fb50 100644 --- a/vcs/vcsrevision.h +++ b/vcs/vcsrevision.h @@ -1,174 +1,174 @@ /* This file is part of KDevelop * * Copyright 2007 Andreas Pakulat * Copyright 2007 Matthew Woehlke * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #ifndef VCSREVISION_H #define VCSREVISION_H #include "vcsexport.h" #include class QStringList; class QString; namespace KDevelop { /** - * Encapsulates a vcs revision number, date or range of revisions + * Encapsulates a vcs revision number, date or range of revisions. * * The type of the QVariant value depends on the type of the revision, * the following table lists the standard types and the according datatype - * in the qvariant: + * in the QVariant: * * * * * * * *
Revision typeQVariant type
GlobalNumberqlonglong
FileNumberqlonglong
DateQDateTime
SpecialKDevelop::VcsRevision::RevisionSpecialType or int, see explanation below
* * The vcs plugins need to register the Revision and RevisionSpecialType with * qRegisterMetaType. * * Also Users of this class should set RevisionSpecialType QVariant values via * * setRevisionValue( qVariantFromValue( val ), KDevelop::VcsRevision::Special); * * instead of * * setRevisionValue( qVariantFromValue( val ), KDevelop::VcsRevision::Special); * * * If the latter method is used the QVariant will be an Integer, which might not * be handled by the vcs plugin and is possibly ambiguous with the qlonglong * parameters. * */ class KDEVPLATFORMVCS_EXPORT VcsRevision { public: /** * @note Not all VCS's support both FileNumber and GlobalNumber. For those * that don't, asking for one may give you the other, therefore you should * check which is returned. For example, CVS does not support GlobalNumber, * and Subversion does not support FileNumber, while Perforce supports both. */ enum RevisionType { Special = 0 /**< One of the special versions in RevisionSpecialType. */, GlobalNumber = 1 /**< Global repository version when item was last changed. */, FileNumber = 2 /**< Item's independent version number. */, Date = 3, /**< The date of the revision to check out */ Invalid = 4 /**< The type is not set, this is an invalid revision. */, UserType = 1000 /**< This should be used by subclasses as base for their own types. */ }; enum RevisionSpecialType { Head = 0 /**< Latest revision in the repository. */, Working = 1 /**< The local copy (including any changes made). */, Base = 2 /**< The repository source of the local copy. */, Previous = 3 /**< The version prior the other one (only valid in functions that take two revisions). */, Start = 4, /**< The first commit in a repository. */ UserSpecialType = 1000 /**< This should be used by subclasses as base for their own special types. */ }; VcsRevision(); virtual ~VcsRevision(); VcsRevision( const VcsRevision& ); VcsRevision& operator=( const VcsRevision& ); /** * Set the value of this revision */ void setRevisionValue( const QVariant& rev, RevisionType type ); /** * returns the type of the revision */ RevisionType revisionType() const; /** - * return the value of this revision - * The actualy content depends on the type of this revision, the possible + * Return the value of this revision. + * The actual content depends on the type of this revision, the possible * combinations are: * * FileNumber/GlobalNumber -> qlonglong * RevisionSpecialType -> int that can be used to create a RevisionSpecialType * Date -> QDateTime * */ QVariant revisionValue() const; /** * This returns the value of the revision, suitable for displaying to the * user. For numbers it just returns the number converted to a string, for * the special types it returns the literal value of the special type and * for a datetime value it returns a localized string of the datetime value. */ QString prettyValue() const; bool operator==( const KDevelop::VcsRevision&) const; /** * Helper function to create a vcs revision for one of the special types */ static VcsRevision createSpecialRevision( KDevelop::VcsRevision::RevisionSpecialType type ); protected: /** * Get the keys that make up the internal data of this revision instance */ QStringList keys() const; /** * get the value for a given key, this retrieves internal data and is * meant to be used by subclasses */ QVariant getValue( const QString& key ) const; /** * change the value of the given internal data */ void setValue( const QString& key, const QVariant& value ); /** * write methods for subclasses to easily set the type and value */ void setType( RevisionType t); void setSpecialType( RevisionSpecialType t); void setValue( const QVariant& ); private: class VcsRevisionPrivate* const d; }; KDEVPLATFORMVCS_EXPORT uint qHash( const KDevelop::VcsRevision& rev); } Q_DECLARE_METATYPE(KDevelop::VcsRevision) Q_DECLARE_METATYPE(KDevelop::VcsRevision::RevisionSpecialType) #endif diff --git a/vcs/widgets/vcsdiffpatchsources.h b/vcs/widgets/vcsdiffpatchsources.h index 4bff4decc2..439bef8c29 100644 --- a/vcs/widgets/vcsdiffpatchsources.h +++ b/vcs/widgets/vcsdiffpatchsources.h @@ -1,91 +1,91 @@ /* Copyright 2009 David Nolden This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /** * This is an internal header */ #ifndef VCSDIFFPATCHSOURCES_H #define VCSDIFFPATCHSOURCES_H #include #include #include #include "vcsdiff.h" #include #include #include "interfaces/ibasicversioncontrol.h" namespace KDevelop { class VcsCommitDialog; } class QWidget; class VCSDiffPatchSource : public KDevelop::IPatchSource { public: VCSDiffPatchSource(const KDevelop::VcsDiff& diff) ; virtual KUrl baseDir() const ; virtual KUrl file() const ; virtual QString name() const ; virtual void update() ; virtual bool isAlreadyApplied() const { return true; } KUrl m_base, m_file; QString m_name; }; class VCSCommitDiffPatchSource : public VCSDiffPatchSource { Q_OBJECT public: VCSCommitDiffPatchSource(const KDevelop::VcsDiff& vcsdiff, QMap selectable, KDevelop::IBasicVersionControl* vcs); ~VCSCommitDiffPatchSource() ; virtual bool canSelectFiles() const ; QMap additionalSelectableFiles() const ; virtual QWidget* customWidget() const ; virtual QString finishReviewCustomText() const ; virtual bool canCancel() const; virtual void cancelReview(); virtual bool finishReview(QList< KUrl > selection) ; Q_SIGNALS: void reviewFinished(QString message, QList selection); public: QPointer m_commitMessageWidget; QPointer m_commitMessageEdit; QMap m_selectable; KDevelop::IBasicVersionControl* m_vcs; }; -///Sends the diff to the patch-review plugin -///Returns whether the diff was shown successfully +///Sends the diff to the patch-review plugin. +///Returns whether the diff was shown successfully. bool showVcsDiff(KDevelop::IPatchSource* vcsDiff); #endif // VCSDIFFPATCHSOURCES_H