Commit 2a548814 authored by hjk's avatar hjk
Browse files

Mercurial: code cosmetics



Change-Id: Id7257fc5ccdcc4d36b276278906902f12d7e8c57
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent 595f4ce2
......@@ -41,12 +41,13 @@
#include <vcsbase/vcsconfigurationpage.h>
using namespace Mercurial::Internal;
using namespace VcsBase;
CloneWizard::CloneWizard(QObject *parent)
: VcsBase::BaseCheckoutWizard(parent),
m_icon(QIcon(QLatin1String(":/mercurial/images/hg.png")))
: BaseCheckoutWizard(parent),
m_icon(QIcon(QLatin1String(":/mercurial/images/hg.png")))
{
setId(QLatin1String(VcsBase::Constants::VCS_ID_MERCURIAL));
setId(QLatin1String(Constants::VCS_ID_MERCURIAL));
}
QIcon CloneWizard::icon() const
......@@ -64,25 +65,25 @@ QString CloneWizard::displayName() const
return tr("Mercurial Clone");
}
QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path)
QList<QWizardPage *> CloneWizard::createParameterPages(const QString &path)
{
QList<QWizardPage*> wizardPageList;
QList<QWizardPage *> wizardPageList;
const Core::IVersionControl *vc = MercurialPlugin::instance()->versionControl();
if (!vc->isConfigured())
wizardPageList.append(new VcsBase::VcsConfigurationPage(vc));
wizardPageList.append(new VcsConfigurationPage(vc));
CloneWizardPage *page = new CloneWizardPage;
page->setPath(path);
wizardPageList.append(page);
return wizardPageList;
}
QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage *> &parameterPages,
QString *checkoutPath)
QSharedPointer<AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage *> &parameterPages,
QString *checkoutPath)
{
const CloneWizardPage *page = qobject_cast<const CloneWizardPage *>(parameterPages.front());
if (!page)
return QSharedPointer<VcsBase::AbstractCheckoutJob>();
return QSharedPointer<AbstractCheckoutJob>();
const MercurialSettings &settings = MercurialPlugin::instance()->settings();
......@@ -92,7 +93,7 @@ QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<
QStringList args;
args << QLatin1String("clone") << page->repository() << directory;
*checkoutPath = path + QLatin1Char('/') + directory;
VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob;
ProcessCheckoutJob *job = new ProcessCheckoutJob;
job->addStep(settings.stringValue(MercurialSettings::binaryPathKey), args, path);
return QSharedPointer<VcsBase::AbstractCheckoutJob>(job);
return QSharedPointer<AbstractCheckoutJob>(job);
}
......@@ -45,13 +45,13 @@ CloneWizardPage::CloneWizardPage(QWidget *parent)
QString CloneWizardPage::directoryFromRepository(const QString &repository) const
{
//mercurial repositories are generally of the form protocol://repositoryUrl/repository/
//we are just looking for repository.
// Mercurial repositories are generally of the form protocol://repositoryUrl/repository/
// We are just looking for repository.
const QChar slash = QLatin1Char('/');
QString repo = repository.trimmed();
if (repo.endsWith(slash))
repo.truncate(repo.size() - 1);
//Take the basename or the repository url
// Take the basename or the repository url.
return repo.mid(repo.lastIndexOf(slash) + 1);
}
......@@ -36,13 +36,13 @@
#include <vcsbase/submitfilemodel.h>
#include <QtCore/QDebug>
#include <QtCore/QDir> //TODO REMOVE WHEN BASE FILE CHANGES ARE PULLED
using namespace Mercurial::Internal;
using namespace VcsBase;
CommitEditor::CommitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent)
: VcsBase::VcsBaseSubmitEditor(parameters, new MercurialCommitWidget(parent)),
CommitEditor::CommitEditor(const VcsBaseSubmitEditorParameters *parameters, QWidget *parent)
: VcsBaseSubmitEditor(parameters, new MercurialCommitWidget(parent)),
fileModel(0)
{
setDisplayName(tr("Commit Editor"));
......@@ -55,7 +55,7 @@ MercurialCommitWidget *CommitEditor::commitWidget()
void CommitEditor::setFields(const QFileInfo &repositoryRoot, const QString &branch,
const QString &userName, const QString &email,
const QList<VcsBase::VcsBaseClient::StatusItem> &repoStatus)
const QList<VcsBaseClient::StatusItem> &repoStatus)
{
MercurialCommitWidget *mercurialWidget = commitWidget();
if (!mercurialWidget)
......@@ -63,23 +63,23 @@ void CommitEditor::setFields(const QFileInfo &repositoryRoot, const QString &bra
mercurialWidget->setFields(repositoryRoot.absoluteFilePath(), branch, userName, email);
fileModel = new VcsBase::SubmitFileModel(this);
fileModel = new SubmitFileModel(this);
//TODO Messy tidy this up
QStringList shouldTrack;
foreach (const VcsBase::VcsBaseClient::StatusItem &item, repoStatus) {
foreach (const VcsBaseClient::StatusItem &item, repoStatus) {
if (item.flags == QLatin1String("Untracked"))
shouldTrack.append(item.file);
else
fileModel->addFile(item.file, item.flags, false);
}
VcsBase::VcsBaseSubmitEditor::filterUntrackedFilesOfProject(repositoryRoot.absoluteFilePath(),
VcsBaseSubmitEditor::filterUntrackedFilesOfProject(repositoryRoot.absoluteFilePath(),
&shouldTrack);
foreach (const QString &track, shouldTrack) {
foreach (const VcsBase::VcsBaseClient::StatusItem &item, repoStatus) {
foreach (const VcsBaseClient::StatusItem &item, repoStatus) {
if (item.file == track)
fileModel->addFile(item.file, item.flags, false);
}
......
......@@ -30,8 +30,8 @@
**
**************************************************************************/
#ifndef CONSTANTS_H
#define CONSTANTS_H
#ifndef MERCURIAL_CONSTANTS_H
#define MERCURIAL_CONSTANTS_H
namespace Mercurial {
namespace Constants {
......@@ -40,14 +40,14 @@ enum { debug = 0 };
const char MECURIALREPO[] = ".hg";
const char MERCURIALDEFAULT[] = "hg";
//changeset identifiers
// Changeset identifiers
const char CHANGESETID12[] = " ([a-f0-9]{12,12}) "; //match 12 hex chars and capture
const char CHANGESETID40[] = " ([a-f0-9]{40,40}) ";
const char CHANGEIDEXACT12[] = "[a-f0-9]{12,12}"; //match 12 hex chars a
const char CHANGEIDEXACT40[] = "[a-f0-9]{40,40}";
const char DIFFIDENTIFIER[] = "^[-+]{3,3} [ab]{1,1}.*"; // match e.g. +++ b/filename
//BaseEditorParameters
// Base editor parameters
const char COMMANDLOG_ID[] = "Mercurial Command Log Editor";
const char COMMANDLOG_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Mercurial Command Log Editor");
const char COMMANDLOG[] = "Mercurial Command Log Editor";
......@@ -72,13 +72,12 @@ const char DIFFLOG[] = "Mercurial Diff Editor";
const char DIFFAPP[] = "text/x-patch";
const char DIFFEXT[] = "diff";
//SubmitEditorParameters
// Submit editor parameters
const char COMMIT_ID[] = "Mercurial Commit Log Editor";
const char COMMIT_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("VCS", "Mercurial Commit Log Editor");
const char COMMITMIMETYPE[] = "application/vnd.nokia.text.scs_mercurial_commitlog";
//menu items
//File menu actions
// File menu actions
const char ADD[] = "Mercurial.AddSingleFile";
const char DELETE[] = "Mercurial.DeleteSingleFile";
const char ANNOTATE[] = "Mercurial.Annotate";
......@@ -87,13 +86,13 @@ const char LOG[] = "Mercurial.LogSingleFile";
const char REVERT[] = "Mercurial.RevertSingleFile";
const char STATUS[] = "Mercurial.Status";
//directory menu Actions
// Directory menu actions
const char DIFFMULTI[] = "Mercurial.Action.DiffMulti";
const char REVERTMULTI[] = "Mercurial.Action.RevertMulti";
const char STATUSMULTI[] = "Mercurial.Action.StatusMulti";
const char LOGMULTI[] = "Mercurial.Action.Logmulti";
//repository menu actions
// Repository menu actions
const char PULL[] = "Mercurial.Action.Pull";
const char PUSH[] = "Mercurial.Action.Push";
const char UPDATE[] = "Mercurial.Action.Update";
......@@ -103,10 +102,10 @@ const char OUTGOING[] = "Mercurial.Action.Outgoing";
const char COMMIT[] = "Mercurial.Action.Commit";
const char CREATE_REPOSITORY[] = "Mercurial.Action.CreateRepository";
//submit editor actions
// Submit editor actions
const char DIFFEDITOR[] = "Mercurial.Action.Editor.Diff";
} // namespace Constants
} // namespace mercurial
#endif // CONSTANTS_H
#endif // MERCURIAL_CONSTANTS_H
......@@ -72,7 +72,7 @@ private:
const QChar m_hashChar;
};
MercurialSubmitHighlighter::MercurialSubmitHighlighter(QTextEdit * parent) :
MercurialSubmitHighlighter::MercurialSubmitHighlighter(QTextEdit *parent) :
QSyntaxHighlighter(parent),
m_commentFormat(commentFormat()),
m_keywordPattern(QLatin1String("^\\w+:")),
......
......@@ -44,7 +44,7 @@
using namespace Mercurial::Internal;
MercurialControl::MercurialControl(MercurialClient *client)
: mercurialClient(client)
: mercurialClient(client)
{
}
......
......@@ -44,11 +44,12 @@ namespace Internal {
class MercurialClient;
//Implements just the basics of the Version Control Interface
//MercurialClient handles all the work
// Implements just the basics of the Version Control Interface
// MercurialClient handles all the work.
class MercurialControl: public Core::IVersionControl
{
Q_OBJECT
public:
explicit MercurialControl(MercurialClient *mercurialClient);
......@@ -82,7 +83,7 @@ private:
MercurialClient *mercurialClient;
};
} //namespace Internal
} //namespace Mercurial
} // namespace Internal
} // namespace Mercurial
#endif // MERCURIALCONTROL_H
......@@ -133,4 +133,3 @@ QStringList MercurialEditor::annotationPreviousVersions(const QString &revision)
return QStringList();
return descriptions;
}
......@@ -63,4 +63,5 @@ private:
} // namespace Internal
} // namespace Mercurial
#endif // MERCURIALEDITOR_H
......@@ -76,31 +76,33 @@
using namespace Mercurial::Internal;
using namespace Mercurial;
using namespace VcsBase;
using namespace Utils;
static const VcsBase::VcsBaseEditorParameters editorParameters[] = {
static const VcsBaseEditorParameters editorParameters[] = {
{
VcsBase::RegularCommandOutput, //type
RegularCommandOutput, //type
Constants::COMMANDLOG_ID, // id
Constants::COMMANDLOG_DISPLAY_NAME, // display name
Constants::COMMANDLOG, // context
Constants::COMMANDAPP, // mime type
Constants::COMMANDEXT}, //extension
{ VcsBase::LogOutput,
{ LogOutput,
Constants::FILELOG_ID,
Constants::FILELOG_DISPLAY_NAME,
Constants::FILELOG,
Constants::LOGAPP,
Constants::LOGEXT},
{ VcsBase::AnnotateOutput,
Constants::ANNOTATELOG_ID,
Constants::ANNOTATELOG_DISPLAY_NAME,
Constants::ANNOTATELOG,
Constants::ANNOTATEAPP,
Constants::ANNOTATEEXT},
{ AnnotateOutput,
Constants::ANNOTATELOG_ID,
Constants::ANNOTATELOG_DISPLAY_NAME,
Constants::ANNOTATELOG,
Constants::ANNOTATEAPP,
Constants::ANNOTATEEXT},
{ VcsBase::DiffOutput,
{ DiffOutput,
Constants::DIFFLOG_ID,
Constants::DIFFLOG_DISPLAY_NAME,
Constants::DIFFLOG,
......@@ -108,7 +110,7 @@ static const VcsBase::VcsBaseEditorParameters editorParameters[] = {
Constants::DIFFEXT}
};
static const VcsBase::VcsBaseSubmitEditorParameters submitEditorParameters = {
static const VcsBaseSubmitEditorParameters submitEditorParameters = {
Constants::COMMITMIMETYPE,
Constants::COMMIT_ID,
Constants::COMMIT_DISPLAY_NAME,
......@@ -116,17 +118,17 @@ static const VcsBase::VcsBaseSubmitEditorParameters submitEditorParameters = {
};
// Utility to find a parameter set by type
static inline const VcsBase::VcsBaseEditorParameters *findType(int ie)
static const VcsBaseEditorParameters *findType(int ie)
{
const VcsBase::EditorContentType et = static_cast<VcsBase::EditorContentType>(ie);
return VcsBase::VcsBaseEditorWidget::findType(editorParameters,
sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters), et);
const EditorContentType et = static_cast<EditorContentType>(ie);
return VcsBaseEditorWidget::findType(editorParameters,
sizeof(editorParameters)/sizeof(editorParameters[0]), et);
}
MercurialPlugin *MercurialPlugin::m_instance = 0;
MercurialPlugin::MercurialPlugin() :
VcsBase::VcsBasePlugin(QLatin1String(Constants::COMMIT_ID)),
VcsBasePlugin(QLatin1String(Constants::COMMIT_ID)),
optionsPage(0),
m_client(0),
core(0),
......@@ -154,7 +156,7 @@ MercurialPlugin::~MercurialPlugin()
bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString * /*errorMessage */)
{
typedef VcsBase::VcsEditorFactory<MercurialEditor> MercurialEditorFactory;
typedef VcsEditorFactory<MercurialEditor> MercurialEditorFactory;
m_client = new MercurialClient(&mercurialSettings);
initializeVcs(new MercurialControl(m_client));
......@@ -169,11 +171,11 @@ bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString *
connect(m_client, SIGNAL(changed(QVariant)), versionControl(), SLOT(changed(QVariant)));
static const char *describeSlot = SLOT(view(QString,QString));
const int editorCount = sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters);
const int editorCount = sizeof(editorParameters)/sizeof(editorParameters[0]);
for (int i = 0; i < editorCount; i++)
addAutoReleasedObject(new MercurialEditorFactory(editorParameters + i, m_client, describeSlot));
addAutoReleasedObject(new VcsBase::VcsSubmitEditorFactory<CommitEditor>(&submitEditorParameters));
addAutoReleasedObject(new VcsSubmitEditorFactory<CommitEditor>(&submitEditorParameters));
addAutoReleasedObject(new CloneWizard);
......@@ -230,14 +232,14 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
{
Core::Command *command;
annotateFile = new Utils::ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
annotateFile = new ParameterAction(tr("Annotate Current File"), tr("Annotate \"%1\""), ParameterAction::EnabledWithParameter, this);
command = actionManager->registerAction(annotateFile, Core::Id(Constants::ANNOTATE), context);
command->setAttribute(Core::Command::CA_UpdateText);
connect(annotateFile, SIGNAL(triggered()), this, SLOT(annotateCurrentFile()));
mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command);
diffFile = new Utils::ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
diffFile = new ParameterAction(tr("Diff Current File"), tr("Diff \"%1\""), ParameterAction::EnabledWithParameter, this);
command = actionManager->registerAction(diffFile, Core::Id(Constants::DIFF), context);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+H,Alt+D")));
......@@ -245,7 +247,7 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command);
logFile = new Utils::ParameterAction(tr("Log Current File"), tr("Log \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
logFile = new ParameterAction(tr("Log Current File"), tr("Log \"%1\""), ParameterAction::EnabledWithParameter, this);
command = actionManager->registerAction(logFile, Core::Id(Constants::LOG), context);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+H,Alt+L")));
......@@ -253,7 +255,7 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command);
statusFile = new Utils::ParameterAction(tr("Status Current File"), tr("Status \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
statusFile = new ParameterAction(tr("Status Current File"), tr("Status \"%1\""), ParameterAction::EnabledWithParameter, this);
command = actionManager->registerAction(statusFile, Core::Id(Constants::STATUS), context);
command->setAttribute(Core::Command::CA_UpdateText);
command->setDefaultKeySequence(QKeySequence(tr("Alt+H,Alt+S")));
......@@ -263,21 +265,21 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
createSeparator(context, Core::Id("Mercurial.FileDirSeperator1"));
m_addAction = new Utils::ParameterAction(tr("Add"), tr("Add \"%1\""), Utils::ParameterAction::EnabledWithParameter, this);
m_addAction = new ParameterAction(tr("Add"), tr("Add \"%1\""), ParameterAction::EnabledWithParameter, this);
command = actionManager->registerAction(m_addAction, Core::Id(Constants::ADD), context);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_addAction, SIGNAL(triggered()), this, SLOT(addCurrentFile()));
mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command);
m_deleteAction = new Utils::ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this);
m_deleteAction = new ParameterAction(tr("Delete..."), tr("Delete \"%1\"..."), ParameterAction::EnabledWithParameter, this);
command = actionManager->registerAction(m_deleteAction, Core::Id(Constants::DELETE), context);
command->setAttribute(Core::Command::CA_UpdateText);
connect(m_deleteAction, SIGNAL(triggered()), this, SLOT(promptToDeleteCurrentFile()));
mercurialContainer->addAction(command);
m_commandLocator->appendCommand(command);
revertFile = new Utils::ParameterAction(tr("Revert Current File..."), tr("Revert \"%1\"..."), Utils::ParameterAction::EnabledWithParameter, this);
revertFile = new ParameterAction(tr("Revert Current File..."), tr("Revert \"%1\"..."), ParameterAction::EnabledWithParameter, this);
command = actionManager->registerAction(revertFile, Core::Id(Constants::REVERT), context);
command->setAttribute(Core::Command::CA_UpdateText);
connect(revertFile, SIGNAL(triggered()), this, SLOT(revertCurrentFile()));
......@@ -287,28 +289,28 @@ void MercurialPlugin::createFileActions(const Core::Context &context)
void MercurialPlugin::addCurrentFile()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile());
}
void MercurialPlugin::annotateCurrentFile()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->annotate(state.currentFileTopLevel(), state.relativeCurrentFile());
}
void MercurialPlugin::diffCurrentFile()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()));
}
void MercurialPlugin::logCurrentFile()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()),
QStringList(), true);
......@@ -316,7 +318,7 @@ void MercurialPlugin::logCurrentFile()
void MercurialPlugin::revertCurrentFile()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
RevertDialog reverter;
......@@ -327,7 +329,7 @@ void MercurialPlugin::revertCurrentFile()
void MercurialPlugin::statusCurrentFile()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasFile(), return)
m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile());
}
......@@ -369,21 +371,21 @@ void MercurialPlugin::createDirectoryActions(const Core::Context &context)
void MercurialPlugin::diffRepository()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
m_client->diff(state.topLevel());
}
void MercurialPlugin::logRepository()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
m_client->log(state.topLevel());
}
void MercurialPlugin::revertMulti()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
RevertDialog reverter;
......@@ -394,7 +396,7 @@ void MercurialPlugin::revertMulti()
void MercurialPlugin::statusMulti()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
m_client->status(state.topLevel());
......@@ -460,7 +462,7 @@ void MercurialPlugin::createRepositoryActions(const Core::Context &context)
void MercurialPlugin::pull()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
SrcDestDialog dialog;
......@@ -472,7 +474,7 @@ void MercurialPlugin::pull()
void MercurialPlugin::push()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
SrcDestDialog dialog;
......@@ -484,7 +486,7 @@ void MercurialPlugin::push()
void MercurialPlugin::update()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
RevertDialog updateDialog;
......@@ -496,7 +498,7 @@ void MercurialPlugin::update()
void MercurialPlugin::import()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
QFileDialog importDialog;
......@@ -512,7 +514,7 @@ void MercurialPlugin::import()
void MercurialPlugin::incoming()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
SrcDestDialog dialog;
......@@ -524,7 +526,7 @@ void MercurialPlugin::incoming()
void MercurialPlugin::outgoing()
{
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
m_client->outgoing(state.topLevel());
}
......@@ -534,12 +536,12 @@ void MercurialPlugin::createSubmitEditorActions()
Core::Context context(Constants::COMMIT_ID);
Core::Command *command;
editorCommit = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
editorCommit = new QAction(VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this);
command = actionManager->registerAction(editorCommit, Core::Id(Constants::COMMIT), context);
command->setAttribute(Core::Command::CA_UpdateText);
connect(editorCommit, SIGNAL(triggered()), this, SLOT(commitFromEditor()));
editorDiff = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
editorDiff = new QAction(VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this);
command = actionManager->registerAction(editorDiff, Core::Id(Constants::DIFFEDITOR), context);
editorUndo = new QAction(tr("&Undo"), this);
......@@ -551,26 +553,26 @@ void MercurialPlugin::createSubmitEditorActions()
void MercurialPlugin::commit()
{
if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor())
if (VcsBaseSubmitEditor::raiseSubmitEditor())
return;
const VcsBase::VcsBasePluginState state = currentState();
const VcsBasePluginState state = currentState();
QTC_ASSERT(state.hasTopLevel(), return)
m_submitRepository = state.topLevel();
connect(m_client, SIGNAL(parsedStatus(QList<VcsBase::VcsBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>)));
connect(m_client, SIGNAL(parsedStatus(QList<VcsBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VcsBaseClient::StatusItem>)));
m_client->emitParsedStatus(m_submitRepository);
}
void MercurialPlugin::showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status)
void MercurialPlugin::showCommitWidget(const QList<VcsBaseClient::StatusItem> &status)
{
VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance();
VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance();
//Once we receive our data release the connection so it can be reused elsewhere
disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBase::VcsBaseClient::StatusItem>)),
this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>)));
disconnect(m_client, SIGNAL(parsedStatus(QList<VcsBaseClient::StatusItem>)),