diff options
Diffstat (limited to 'src')
166 files changed, 1587 insertions, 1587 deletions
diff --git a/src/plugins/bazaar/annotationhighlighter.cpp b/src/plugins/bazaar/annotationhighlighter.cpp index 5c64625599..6dad6c709d 100644 --- a/src/plugins/bazaar/annotationhighlighter.cpp +++ b/src/plugins/bazaar/annotationhighlighter.cpp @@ -38,7 +38,7 @@ using namespace Bazaar; BazaarAnnotationHighlighter::BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) - : VCSBase::BaseAnnotationHighlighter(changeNumbers, document), + : VcsBase::BaseAnnotationHighlighter(changeNumbers, document), m_changeset(QLatin1String(Constants::CHANGESET_ID)) { } diff --git a/src/plugins/bazaar/annotationhighlighter.h b/src/plugins/bazaar/annotationhighlighter.h index a85349679e..ddae833556 100644 --- a/src/plugins/bazaar/annotationhighlighter.h +++ b/src/plugins/bazaar/annotationhighlighter.h @@ -39,7 +39,7 @@ namespace Bazaar { namespace Internal { -class BazaarAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter +class BazaarAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { public: explicit BazaarAnnotationHighlighter(const ChangeNumbers &changeNumbers, diff --git a/src/plugins/bazaar/bazaarclient.cpp b/src/plugins/bazaar/bazaarclient.cpp index 90a1545f2e..5dcbc1dc0b 100644 --- a/src/plugins/bazaar/bazaarclient.cpp +++ b/src/plugins/bazaar/bazaarclient.cpp @@ -49,13 +49,13 @@ namespace Bazaar { namespace Internal { BazaarClient::BazaarClient(BazaarSettings *settings) : - VCSBase::VCSBaseClient(settings) + VcsBase::VcsBaseClient(settings) { } BazaarSettings *BazaarClient::settings() const { - return dynamic_cast<BazaarSettings *>(VCSBase::VCSBaseClient::settings()); + return dynamic_cast<BazaarSettings *>(VcsBase::VcsBaseClient::settings()); } bool BazaarClient::synchronousSetUserId() @@ -97,7 +97,7 @@ BranchInfo BazaarClient::synchronousBranchQuery(const QString &repositoryRoot) c void BazaarClient::commit(const QString &repositoryRoot, const QStringList &files, const QString &commitMessageFile, const QStringList &extraOptions) { - VCSBaseClient::commit(repositoryRoot, files, commitMessageFile, + VcsBaseClient::commit(repositoryRoot, files, commitMessageFile, QStringList(extraOptions) << QLatin1String("-F") << commitMessageFile); } @@ -105,7 +105,7 @@ void BazaarClient::annotate(const QString &workingDir, const QString &file, const QString revision, int lineNumber, const QStringList &extraOptions) { - VCSBaseClient::annotate(workingDir, file, revision, lineNumber, + VcsBaseClient::annotate(workingDir, file, revision, lineNumber, QStringList(extraOptions) << QLatin1String("--long")); } @@ -114,9 +114,9 @@ QString BazaarClient::findTopLevelForFile(const QFileInfo &file) const const QString repositoryCheckFile = QLatin1String(Constants::BAZAARREPO) + QLatin1String("/branch-format"); return file.isDir() ? - VCSBase::VCSBasePlugin::findRepositoryForDirectory(file.absoluteFilePath(), + VcsBase::VcsBasePlugin::findRepositoryForDirectory(file.absoluteFilePath(), repositoryCheckFile) : - VCSBase::VCSBasePlugin::findRepositoryForDirectory(file.absolutePath(), + VcsBase::VcsBasePlugin::findRepositoryForDirectory(file.absolutePath(), repositoryCheckFile); } @@ -124,10 +124,10 @@ void BazaarClient::view(const QString &source, const QString &id, const QStringL { QStringList args(QLatin1String("log")); args << QLatin1String("-p") << QLatin1String("-v") << extraOptions; - VCSBaseClient::view(source, id, args); + VcsBaseClient::view(source, id, args); } -QString BazaarClient::vcsEditorKind(VCSCommand cmd) const +QString BazaarClient::vcsEditorKind(VcsCommand cmd) const { switch(cmd) { case AnnotateCommand: @@ -210,13 +210,13 @@ struct BazaarCommandParameters }; // Parameter widget controlling whitespace diff mode, associated with a parameter -class BazaarDiffParameterWidget : public VCSBase::VCSBaseEditorParameterWidget +class BazaarDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT public: BazaarDiffParameterWidget(BazaarClient *client, const BazaarCommandParameters &p, QWidget *parent = 0) : - VCSBase::VCSBaseEditorParameterWidget(parent), m_client(client), m_params(p) + VcsBase::VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p) { mapSetting(addToggleButton(QLatin1String("-w"), tr("Ignore whitespace")), client->settings()->boolPointer(BazaarSettings::diffIgnoreWhiteSpaceKey)); @@ -228,7 +228,7 @@ public: { QStringList args; // Bazaar wants "--diff-options=-w -B.." - const QStringList formatArguments = VCSBaseEditorParameterWidget::arguments(); + const QStringList formatArguments = VcsBaseEditorParameterWidget::arguments(); if (!formatArguments.isEmpty()) { const QString a = QLatin1String("--diff-options=") + formatArguments.join(QString(QLatin1Char(' '))); @@ -247,20 +247,20 @@ private: const BazaarCommandParameters m_params; }; -VCSBase::VCSBaseEditorParameterWidget *BazaarClient::createDiffEditor( +VcsBase::VcsBaseEditorParameterWidget *BazaarClient::createDiffEditor( const QString &workingDir, const QStringList &files, const QStringList &extraOptions) { const BazaarCommandParameters parameters(workingDir, files, extraOptions); return new BazaarDiffParameterWidget(this, parameters); } -class BazaarLogParameterWidget : public VCSBase::VCSBaseEditorParameterWidget +class BazaarLogParameterWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT public: BazaarLogParameterWidget(BazaarClient *client, const BazaarCommandParameters &p, QWidget *parent = 0) : - VCSBase::VCSBaseEditorParameterWidget(parent), m_client(client), m_params(p) + VcsBase::VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p) { mapSetting(addToggleButton(QLatin1String("--verbose"), tr("Verbose"), tr("Show files changed in each revision")), @@ -291,7 +291,7 @@ private: const BazaarCommandParameters m_params; }; -VCSBase::VCSBaseEditorParameterWidget *BazaarClient::createLogEditor( +VcsBase::VcsBaseEditorParameterWidget *BazaarClient::createLogEditor( const QString &workingDir, const QStringList &files, const QStringList &extraOptions) { const BazaarCommandParameters parameters(workingDir, files, extraOptions); diff --git a/src/plugins/bazaar/bazaarclient.h b/src/plugins/bazaar/bazaarclient.h index d309becd29..cdd4137871 100644 --- a/src/plugins/bazaar/bazaarclient.h +++ b/src/plugins/bazaar/bazaarclient.h @@ -42,7 +42,7 @@ namespace Internal { class BazaarSettings; -class BazaarClient : public VCSBase::VCSBaseClient +class BazaarClient : public VcsBase::VcsBaseClient { Q_OBJECT @@ -63,12 +63,12 @@ public: QString findTopLevelForFile(const QFileInfo &file) const; protected: - QString vcsEditorKind(VCSCommand cmd) const; + QString vcsEditorKind(VcsCommand cmd) const; QStringList revisionSpec(const QString &revision) const; - VCSBase::VCSBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, + VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, const QStringList &files, const QStringList &extraOptions); - VCSBase::VCSBaseEditorParameterWidget *createLogEditor(const QString &workingDir, + VcsBase::VcsBaseEditorParameterWidget *createLogEditor(const QString &workingDir, const QStringList &files, const QStringList &extraOptions); StatusItem parseStatusLine(const QString &line) const; diff --git a/src/plugins/bazaar/bazaarcontrol.cpp b/src/plugins/bazaar/bazaarcontrol.cpp index 0a2a36d448..4b93434c81 100644 --- a/src/plugins/bazaar/bazaarcontrol.cpp +++ b/src/plugins/bazaar/bazaarcontrol.cpp @@ -55,7 +55,7 @@ QString BazaarControl::displayName() const QString BazaarControl::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_BAZAAR); + return QLatin1String(VcsBase::Constants::VCS_ID_BAZAAR); } bool BazaarControl::managesDirectory(const QString &directory, QString *topLevel) const diff --git a/src/plugins/bazaar/bazaareditor.cpp b/src/plugins/bazaar/bazaareditor.cpp index 95e91a40ad..bf3f6caff6 100644 --- a/src/plugins/bazaar/bazaareditor.cpp +++ b/src/plugins/bazaar/bazaareditor.cpp @@ -53,8 +53,8 @@ using namespace Bazaar::Internal; using namespace Bazaar; -BazaarEditor::BazaarEditor(const VCSBase::VCSBaseEditorParameters *type, QWidget *parent) - : VCSBase::VCSBaseEditorWidget(type, parent), +BazaarEditor::BazaarEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent) + : VcsBase::VcsBaseEditorWidget(type, parent), m_exactChangesetId(QLatin1String(Constants::CHANGESET_ID_EXACT)), m_diffFileId(QLatin1String("^=== [a-z]+ [a-z]+ '(.*)'\\s*")) { @@ -96,12 +96,12 @@ QString BazaarEditor::changeUnderCursor(const QTextCursor &cursorIn) const return QString(); } -VCSBase::DiffHighlighter *BazaarEditor::createDiffHighlighter() const +VcsBase::DiffHighlighter *BazaarEditor::createDiffHighlighter() const { - return new VCSBase::DiffHighlighter(m_diffFileId); + return new VcsBase::DiffHighlighter(m_diffFileId); } -VCSBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *BazaarEditor::createAnnotationHighlighter(const QSet<QString> &changes) const { return new BazaarAnnotationHighlighter(changes); } diff --git a/src/plugins/bazaar/bazaareditor.h b/src/plugins/bazaar/bazaareditor.h index 9dd63461cf..333ab59d09 100644 --- a/src/plugins/bazaar/bazaareditor.h +++ b/src/plugins/bazaar/bazaareditor.h @@ -40,18 +40,18 @@ namespace Bazaar { namespace Internal { -class BazaarEditor : public VCSBase::VCSBaseEditorWidget +class BazaarEditor : public VcsBase::VcsBaseEditorWidget { Q_OBJECT public: - explicit BazaarEditor(const VCSBase::VCSBaseEditorParameters *type, QWidget *parent); + explicit BazaarEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent); private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &cursor) const; - virtual VCSBase::DiffHighlighter *createDiffHighlighter() const; - virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileSpec) const; const QRegExp m_exactChangesetId; diff --git a/src/plugins/bazaar/bazaarplugin.cpp b/src/plugins/bazaar/bazaarplugin.cpp index f1f0f8f778..80ddfa25da 100644 --- a/src/plugins/bazaar/bazaarplugin.cpp +++ b/src/plugins/bazaar/bazaarplugin.cpp @@ -79,30 +79,30 @@ using namespace Bazaar::Internal; using namespace Bazaar; -static const VCSBase::VCSBaseEditorParameters editorParameters[] = { +static const VcsBase::VcsBaseEditorParameters editorParameters[] = { { - VCSBase::RegularCommandOutput, //type + VcsBase::RegularCommandOutput, //type Constants::COMMANDLOG_ID, // id Constants::COMMANDLOG_DISPLAY_NAME, // display name Constants::COMMANDLOG, // context Constants::COMMANDAPP, // mime type Constants::COMMANDEXT}, //extension - { VCSBase::LogOutput, + { VcsBase::LogOutput, Constants::FILELOG_ID, Constants::FILELOG_DISPLAY_NAME, Constants::FILELOG, Constants::LOGAPP, Constants::LOGEXT}, - { VCSBase::AnnotateOutput, + { VcsBase::AnnotateOutput, Constants::ANNOTATELOG_ID, Constants::ANNOTATELOG_DISPLAY_NAME, Constants::ANNOTATELOG, Constants::ANNOTATEAPP, Constants::ANNOTATEEXT}, - { VCSBase::DiffOutput, + { VcsBase::DiffOutput, Constants::DIFFLOG_ID, Constants::DIFFLOG_DISPLAY_NAME, Constants::DIFFLOG, @@ -110,7 +110,7 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = { Constants::DIFFEXT} }; -static const VCSBase::VCSBaseSubmitEditorParameters submitEditorParameters = { +static const VcsBase::VcsBaseSubmitEditorParameters submitEditorParameters = { Constants::COMMITMIMETYPE, Constants::COMMIT_ID, Constants::COMMIT_DISPLAY_NAME, @@ -121,7 +121,7 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitEditorParameters = { BazaarPlugin *BazaarPlugin::m_instance = 0; BazaarPlugin::BazaarPlugin() - : VCSBase::VCSBasePlugin(QLatin1String(Constants::COMMIT_ID)), + : VcsBase::VcsBasePlugin(QLatin1String(Constants::COMMIT_ID)), m_optionsPage(0), m_client(0), m_core(0), @@ -151,7 +151,7 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag Q_UNUSED(arguments); Q_UNUSED(errorMessage); - typedef VCSBase::VCSEditorFactory<BazaarEditor> BazaarEditorFactory; + typedef VcsBase::VcsEditorFactory<BazaarEditor> BazaarEditorFactory; m_client = new BazaarClient(&m_bazaarSettings); initializeVcs(new BazaarControl(m_client)); @@ -166,11 +166,11 @@ bool BazaarPlugin::initialize(const QStringList &arguments, QString *errorMessag 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(VcsBase::VcsBaseEditorParameters); for (int i = 0; i < editorCount; i++) addAutoReleasedObject(new BazaarEditorFactory(editorParameters + i, m_client, describeSlot)); - addAutoReleasedObject(new VCSBase::VCSSubmitEditorFactory<CommitEditor>(&submitEditorParameters)); + addAutoReleasedObject(new VcsBase::VcsSubmitEditorFactory<CommitEditor>(&submitEditorParameters)); addAutoReleasedObject(new CloneWizard); @@ -294,28 +294,28 @@ void BazaarPlugin::createFileActions(const Core::Context &context) void BazaarPlugin::addCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client->synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile()); } void BazaarPlugin::annotateCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client->annotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } void BazaarPlugin::diffCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client->diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void BazaarPlugin::logCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), QStringList(), true); @@ -323,7 +323,7 @@ void BazaarPlugin::logCurrentFile() void BazaarPlugin::revertCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); QDialog dialog; @@ -338,7 +338,7 @@ void BazaarPlugin::revertCurrentFile() void BazaarPlugin::statusCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile()); } @@ -380,14 +380,14 @@ void BazaarPlugin::createDirectoryActions(const Core::Context &context) void BazaarPlugin::diffRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); m_client->diff(state.topLevel()); } void BazaarPlugin::logRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); QStringList extraOptions; extraOptions += QString("--limit=%1").arg(settings().intValue(BazaarSettings::logCountKey)); @@ -396,7 +396,7 @@ void BazaarPlugin::logRepository() void BazaarPlugin::revertAll() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); QDialog dialog; @@ -409,7 +409,7 @@ void BazaarPlugin::revertAll() void BazaarPlugin::statusMulti() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); m_client->status(state.topLevel()); } @@ -456,7 +456,7 @@ void BazaarPlugin::createRepositoryActions(const Core::Context &context) void BazaarPlugin::pull() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); PullOrPushDialog dialog(PullOrPushDialog::PullMode); @@ -476,7 +476,7 @@ void BazaarPlugin::pull() void BazaarPlugin::push() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); PullOrPushDialog dialog(PullOrPushDialog::PushMode); @@ -498,7 +498,7 @@ void BazaarPlugin::push() void BazaarPlugin::update() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); QDialog dialog; @@ -515,12 +515,12 @@ void BazaarPlugin::createSubmitEditorActions() Core::Context context(Constants::COMMIT_ID); Core::Command *command; - m_editorCommit = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this); + m_editorCommit = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this); command = m_actionManager->registerAction(m_editorCommit, Core::Id(Constants::COMMIT), context); command->setAttribute(Core::Command::CA_UpdateText); connect(m_editorCommit, SIGNAL(triggered()), this, SLOT(commitFromEditor())); - m_editorDiff = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); + m_editorDiff = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); command = m_actionManager->registerAction(m_editorDiff, Core::Id(Constants::DIFFEDITOR), context); m_editorUndo = new QAction(tr("&Undo"), this); @@ -532,26 +532,26 @@ void BazaarPlugin::createSubmitEditorActions() void BazaarPlugin::commit() { - if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor()) + if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor()) return; - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::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<VcsBase::VcsBaseClient::StatusItem>)), + this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>))); // The "--short" option allows to easily parse status output m_client->emitParsedStatus(m_submitRepository, QStringList(QLatin1String("--short"))); } -void BazaarPlugin::showCommitWidget(const QList<VCSBase::VCSBaseClient::StatusItem> &status) +void BazaarPlugin::showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status) { - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::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<VcsBase::VcsBaseClient::StatusItem>)), + this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>))); if (status.isEmpty()) { outputWindow->appendError(tr("There are no changes to commit.")); @@ -615,7 +615,7 @@ void BazaarPlugin::commitFromEditor() m_core->editorManager()->closeEditors(m_core->editorManager()->editorsForFileName(m_changeLog->fileName())); } -bool BazaarPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor) +bool BazaarPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) { if (!m_changeLog) return true; @@ -625,15 +625,15 @@ bool BazaarPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submit return true; bool dummyPrompt = m_bazaarSettings.boolValue(BazaarSettings::promptOnSubmitKey); - const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult response = + const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult response = commitEditor->promptSubmit(tr("Close Commit Editor"), tr("Do you want to commit the changes?"), tr("Message check failed. Do you want to proceed?"), &dummyPrompt, dummyPrompt); switch (response) { - case VCSBase::VCSBaseSubmitEditor::SubmitCanceled: + case VcsBase::VcsBaseSubmitEditor::SubmitCanceled: return false; - case VCSBase::VCSBaseSubmitEditor::SubmitDiscarded: + case VcsBase::VcsBaseSubmitEditor::SubmitDiscarded: deleteCommitLog(); return true; default: @@ -687,7 +687,7 @@ void BazaarPlugin::createSeparator(const Core::Context &context, const Core::Id m_bazaarContainer->addAction(m_actionManager->registerAction(action, id, context)); } -void BazaarPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) +void BazaarPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { if (!enableMenuAction(as, m_menuAction)) { m_commandLocator->setEnabled(false); diff --git a/src/plugins/bazaar/bazaarplugin.h b/src/plugins/bazaar/bazaarplugin.h index 8bbde69265..446914f7fd 100644 --- a/src/plugins/bazaar/bazaarplugin.h +++ b/src/plugins/bazaar/bazaarplugin.h @@ -63,8 +63,8 @@ namespace Utils { class ParameterAction; } //namespace Utils -namespace VCSBase { -class VCSBaseSubmitEditor; +namespace VcsBase { +class VcsBaseSubmitEditor; } namespace Locator { @@ -79,7 +79,7 @@ class BazaarClient; class BazaarControl; class BazaarEditor; -class BazaarPlugin : public VCSBase::VCSBasePlugin +class BazaarPlugin : public VcsBase::VcsBasePlugin { Q_OBJECT @@ -114,13 +114,13 @@ private slots: void push(); void update(); void commit(); - void showCommitWidget(const QList<VCSBase::VCSBaseClient::StatusItem> &status); + void showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status); void commitFromEditor(); void diffFromEditorSelected(const QStringList &files); protected: - void updateActions(VCSBase::VCSBasePlugin::ActionState); - bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor); + void updateActions(VcsBase::VcsBasePlugin::ActionState); + bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor); private: // Methods diff --git a/src/plugins/bazaar/bazaarsettings.h b/src/plugins/bazaar/bazaarsettings.h index 75d8d88b2e..e323efcb1b 100644 --- a/src/plugins/bazaar/bazaarsettings.h +++ b/src/plugins/bazaar/bazaarsettings.h @@ -38,7 +38,7 @@ namespace Bazaar { namespace Internal { -class BazaarSettings : public VCSBase::VCSBaseClientSettings +class BazaarSettings : public VcsBase::VcsBaseClientSettings { public: static const QLatin1String diffIgnoreWhiteSpaceKey; diff --git a/src/plugins/bazaar/clonewizard.cpp b/src/plugins/bazaar/clonewizard.cpp index 2bf8b0b7a2..d967f37e9f 100644 --- a/src/plugins/bazaar/clonewizard.cpp +++ b/src/plugins/bazaar/clonewizard.cpp @@ -47,10 +47,10 @@ using namespace Bazaar::Internal; CloneWizard::CloneWizard(QObject *parent) - : VCSBase::BaseCheckoutWizard(parent), + : VcsBase::BaseCheckoutWizard(parent), m_icon(QIcon(QLatin1String(":/bazaar/images/bazaar.png"))) { - setId(QLatin1String(VCSBase::Constants::VCS_ID_BAZAAR)); + setId(QLatin1String(VcsBase::Constants::VCS_ID_BAZAAR)); } QIcon CloneWizard::icon() const @@ -73,20 +73,20 @@ QList<QWizardPage *> CloneWizard::createParameterPages(const QString &path) QList<QWizardPage *> wizardPageList; const Core::IVersionControl *vc = BazaarPlugin::instance()->versionControl(); if (!vc->isConfigured()) - wizardPageList.append(new VCSBase::VcsConfigurationPage(vc)); + wizardPageList.append(new VcsBase::VcsConfigurationPage(vc)); CloneWizardPage *page = new CloneWizardPage; page->setPath(path); wizardPageList.append(page); return wizardPageList; } -QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage *> ¶meterPages, +QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage *> ¶meterPages, QString *checkoutPath) { const CloneWizardPage *page = qobject_cast<const CloneWizardPage *>(parameterPages.front()); if (!page) - return QSharedPointer<VCSBase::AbstractCheckoutJob>(); + return QSharedPointer<VcsBase::AbstractCheckoutJob>(); const BazaarSettings &settings = BazaarPlugin::instance()->settings(); *checkoutPath = page->path() + QLatin1Char('/') + page->directory(); @@ -114,7 +114,7 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QList< args << client->vcsCommandString(BazaarClient::CloneCommand) << extraOptions << page->repository() << page->directory(); - VCSBase::ProcessCheckoutJob *job = new VCSBase::ProcessCheckoutJob; + VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob; job->addStep(settings.stringValue(BazaarSettings::binaryPathKey), args, page->path()); - return QSharedPointer<VCSBase::AbstractCheckoutJob>(job); + return QSharedPointer<VcsBase::AbstractCheckoutJob>(job); } diff --git a/src/plugins/bazaar/clonewizard.h b/src/plugins/bazaar/clonewizard.h index 87effe06f1..4e96b35d67 100644 --- a/src/plugins/bazaar/clonewizard.h +++ b/src/plugins/bazaar/clonewizard.h @@ -40,7 +40,7 @@ namespace Bazaar { namespace Internal { -class CloneWizard : public VCSBase::BaseCheckoutWizard +class CloneWizard : public VcsBase::BaseCheckoutWizard { Q_OBJECT @@ -53,7 +53,7 @@ public: protected: QList<QWizardPage *> createParameterPages(const QString &path); - QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage *> ¶meterPages, + QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage *> ¶meterPages, QString *checkoutPath); private: diff --git a/src/plugins/bazaar/clonewizardpage.cpp b/src/plugins/bazaar/clonewizardpage.cpp index e49cf799de..deda082410 100644 --- a/src/plugins/bazaar/clonewizardpage.cpp +++ b/src/plugins/bazaar/clonewizardpage.cpp @@ -36,7 +36,7 @@ using namespace Bazaar::Internal; CloneWizardPage::CloneWizardPage(QWidget *parent) - : VCSBase::BaseCheckoutWizardPage(parent), + : VcsBase::BaseCheckoutWizardPage(parent), m_optionsPanel(new CloneOptionsPanel) { setTitle(tr("Location")); diff --git a/src/plugins/bazaar/clonewizardpage.h b/src/plugins/bazaar/clonewizardpage.h index 6e082e110b..f5e59bfd88 100644 --- a/src/plugins/bazaar/clonewizardpage.h +++ b/src/plugins/bazaar/clonewizardpage.h @@ -39,7 +39,7 @@ namespace Bazaar { namespace Internal { class CloneOptionsPanel; -class CloneWizardPage : public VCSBase::BaseCheckoutWizardPage +class CloneWizardPage : public VcsBase::BaseCheckoutWizardPage { Q_OBJECT diff --git a/src/plugins/bazaar/commiteditor.cpp b/src/plugins/bazaar/commiteditor.cpp index dda7dbed86..63d876024f 100644 --- a/src/plugins/bazaar/commiteditor.cpp +++ b/src/plugins/bazaar/commiteditor.cpp @@ -42,8 +42,8 @@ using namespace Bazaar::Internal; -CommitEditor::CommitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent) - : VCSBase::VCSBaseSubmitEditor(parameters, new BazaarCommitWidget(parent)), +CommitEditor::CommitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent) + : VcsBase::VcsBaseSubmitEditor(parameters, new BazaarCommitWidget(parent)), m_fileModel(0) { setDisplayName(tr("Commit Editor")); @@ -62,7 +62,7 @@ BazaarCommitWidget *CommitEditor::commitWidget() void CommitEditor::setFields(const QString &repositoryRoot, const BranchInfo &branch, const QString &userName, - const QString &email, const QList<VCSBase::VCSBaseClient::StatusItem> &repoStatus) + const QString &email, const QList<VcsBase::VcsBaseClient::StatusItem> &repoStatus) { BazaarCommitWidget *bazaarWidget = commitWidget(); if (!bazaarWidget) @@ -70,8 +70,8 @@ void CommitEditor::setFields(const QString &repositoryRoot, bazaarWidget->setFields(branch, userName, email); - m_fileModel = new VCSBase::SubmitFileModel(this); - foreach (const VCSBase::VCSBaseClient::StatusItem &item, repoStatus) + m_fileModel = new VcsBase::SubmitFileModel(this); + foreach (const VcsBase::VcsBaseClient::StatusItem &item, repoStatus) if (item.flags != QLatin1String("Unknown")) m_fileModel->addFile(item.file, item.flags, true); setFileModel(m_fileModel, repositoryRoot); diff --git a/src/plugins/bazaar/commiteditor.h b/src/plugins/bazaar/commiteditor.h index 2e1048a0dc..0e7c5a06d9 100644 --- a/src/plugins/bazaar/commiteditor.h +++ b/src/plugins/bazaar/commiteditor.h @@ -36,7 +36,7 @@ #include <vcsbase/vcsbaseclient.h> #include <vcsbase/vcsbasesubmiteditor.h> -namespace VCSBase { +namespace VcsBase { class SubmitFileModel; } @@ -46,23 +46,23 @@ namespace Internal { class BranchInfo; class BazaarCommitWidget; -class CommitEditor : public VCSBase::VCSBaseSubmitEditor +class CommitEditor : public VcsBase::VcsBaseSubmitEditor { Q_OBJECT public: - explicit CommitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, + explicit CommitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent); void setFields(const QString &repositoryRoot, const BranchInfo &branch, const QString &userName, const QString &email, - const QList<VCSBase::VCSBaseClient::StatusItem> &repoStatus); + const QList<VcsBase::VcsBaseClient::StatusItem> &repoStatus); const BazaarCommitWidget *commitWidget() const; private: BazaarCommitWidget *commitWidget(); - VCSBase::SubmitFileModel *m_fileModel; + VcsBase::SubmitFileModel *m_fileModel; }; } diff --git a/src/plugins/bazaar/optionspage.cpp b/src/plugins/bazaar/optionspage.cpp index e5ced3ec0f..7cc4de0399 100644 --- a/src/plugins/bazaar/optionspage.cpp +++ b/src/plugins/bazaar/optionspage.cpp @@ -99,7 +99,7 @@ OptionsPage::OptionsPage() QString OptionsPage::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_BAZAAR); + return QLatin1String(VcsBase::Constants::VCS_ID_BAZAAR); } QString OptionsPage::displayName() const diff --git a/src/plugins/bazaar/optionspage.h b/src/plugins/bazaar/optionspage.h index 5edfe6ebc5..9523bcd8b3 100644 --- a/src/plugins/bazaar/optionspage.h +++ b/src/plugins/bazaar/optionspage.h @@ -61,7 +61,7 @@ private: }; -class OptionsPage : public VCSBase::VCSBaseOptionsPage +class OptionsPage : public VcsBase::VcsBaseOptionsPage { Q_OBJECT diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index 463b5637e7..568cf1a5a2 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -78,7 +78,7 @@ namespace CodePaster { post() functionality. \sa ExtensionSystem::PluginManager::getObjectByClassName, ExtensionSystem::invoke - \sa VCSBase::VCSBaseEditorWidget + \sa VcsBase::VcsBaseEditorWidget */ CodePasterService::CodePasterService(QObject *parent) : diff --git a/src/plugins/cvs/annotationhighlighter.cpp b/src/plugins/cvs/annotationhighlighter.cpp index 1045c25aa2..4e1e1967b8 100644 --- a/src/plugins/cvs/annotationhighlighter.cpp +++ b/src/plugins/cvs/annotationhighlighter.cpp @@ -37,7 +37,7 @@ using namespace CVS::Internal; CVSAnnotationHighlighter::CVSAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) : - VCSBase::BaseAnnotationHighlighter(changeNumbers, document), + VcsBase::BaseAnnotationHighlighter(changeNumbers, document), m_blank(QLatin1Char(' ')) { } diff --git a/src/plugins/cvs/annotationhighlighter.h b/src/plugins/cvs/annotationhighlighter.h index 5ff0dc9a8a..e0cd303651 100644 --- a/src/plugins/cvs/annotationhighlighter.h +++ b/src/plugins/cvs/annotationhighlighter.h @@ -39,7 +39,7 @@ namespace CVS { namespace Internal { // Annotation highlighter for cvs triggering on 'changenumber ' -class CVSAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter +class CVSAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { Q_OBJECT public: diff --git a/src/plugins/cvs/checkoutwizard.cpp b/src/plugins/cvs/checkoutwizard.cpp index 126920b7ae..f7a93fe979 100644 --- a/src/plugins/cvs/checkoutwizard.cpp +++ b/src/plugins/cvs/checkoutwizard.cpp @@ -46,9 +46,9 @@ namespace CVS { namespace Internal { CheckoutWizard::CheckoutWizard(QObject *parent) : - VCSBase::BaseCheckoutWizard(parent) + VcsBase::BaseCheckoutWizard(parent) { - setId(QLatin1String(VCSBase::Constants::VCS_ID_CVS)); + setId(QLatin1String(VcsBase::Constants::VCS_ID_CVS)); } QIcon CheckoutWizard::icon() const @@ -71,20 +71,20 @@ QList<QWizardPage*> CheckoutWizard::createParameterPages(const QString &path) QList<QWizardPage*> rc; const Core::IVersionControl *vc = CVSPlugin::instance()->versionControl(); if (!vc->isConfigured()) - rc.append(new VCSBase::VcsConfigurationPage(vc)); + rc.append(new VcsBase::VcsConfigurationPage(vc)); CheckoutWizardPage *cwp = new CheckoutWizardPage; cwp->setPath(path); rc.push_back(cwp); return rc; } -QSharedPointer<VCSBase::AbstractCheckoutJob> CheckoutWizard::createJob(const QList<QWizardPage*> ¶meterPages, +QSharedPointer<VcsBase::AbstractCheckoutJob> CheckoutWizard::createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath) { // Collect parameters for the checkout command. // CVS does not allow for checking out into a different directory. const CheckoutWizardPage *cwp = qobject_cast<const CheckoutWizardPage *>(parameterPages.front()); - QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>()) + QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>()) const CVSSettings settings = CVSPlugin::instance()->settings(); const QString binary = settings.cvsCommand; QStringList args; @@ -93,9 +93,9 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CheckoutWizard::createJob(const QLi const QString workingDirectory = cwp->path(); *checkoutPath = workingDirectory + QLatin1Char('/') + repository; - VCSBase::ProcessCheckoutJob *job = new VCSBase::ProcessCheckoutJob; + VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob; job->addStep(binary, settings.addOptions(args), workingDirectory); - return QSharedPointer<VCSBase::AbstractCheckoutJob>(job); + return QSharedPointer<VcsBase::AbstractCheckoutJob>(job); } } // namespace Internal diff --git a/src/plugins/cvs/checkoutwizard.h b/src/plugins/cvs/checkoutwizard.h index f6ac630d27..0953a62e77 100644 --- a/src/plugins/cvs/checkoutwizard.h +++ b/src/plugins/cvs/checkoutwizard.h @@ -38,7 +38,7 @@ namespace CVS { namespace Internal { -class CheckoutWizard : public VCSBase::BaseCheckoutWizard +class CheckoutWizard : public VcsBase::BaseCheckoutWizard { Q_OBJECT public: @@ -52,7 +52,7 @@ public: protected: // BaseCheckoutWizard virtual QList<QWizardPage*> createParameterPages(const QString &path); - virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPage, + virtual QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPage, QString *checkoutPath); }; diff --git a/src/plugins/cvs/checkoutwizardpage.cpp b/src/plugins/cvs/checkoutwizardpage.cpp index 0a198f7e69..d4709e80d2 100644 --- a/src/plugins/cvs/checkoutwizardpage.cpp +++ b/src/plugins/cvs/checkoutwizardpage.cpp @@ -36,7 +36,7 @@ namespace CVS { namespace Internal { CheckoutWizardPage::CheckoutWizardPage(QWidget *parent) : - VCSBase::BaseCheckoutWizardPage(parent) + VcsBase::BaseCheckoutWizardPage(parent) { setTitle(tr("Location")); setSubTitle(tr("Specify repository and path.")); diff --git a/src/plugins/cvs/checkoutwizardpage.h b/src/plugins/cvs/checkoutwizardpage.h index b3c8dd9fe2..8a036bd739 100644 --- a/src/plugins/cvs/checkoutwizardpage.h +++ b/src/plugins/cvs/checkoutwizardpage.h @@ -38,7 +38,7 @@ namespace CVS { namespace Internal { -class CheckoutWizardPage : public VCSBase::BaseCheckoutWizardPage { +class CheckoutWizardPage : public VcsBase::BaseCheckoutWizardPage { Q_OBJECT public: CheckoutWizardPage(QWidget *parent = 0); diff --git a/src/plugins/cvs/cvscontrol.cpp b/src/plugins/cvs/cvscontrol.cpp index d0ae53016d..fcf96cdf68 100644 --- a/src/plugins/cvs/cvscontrol.cpp +++ b/src/plugins/cvs/cvscontrol.cpp @@ -53,7 +53,7 @@ QString CVSControl::displayName() const QString CVSControl::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_CVS); + return QLatin1String(VcsBase::Constants::VCS_ID_CVS); } bool CVSControl::isConfigured() const diff --git a/src/plugins/cvs/cvseditor.cpp b/src/plugins/cvs/cvseditor.cpp index 5c94bff43e..bbab07be37 100644 --- a/src/plugins/cvs/cvseditor.cpp +++ b/src/plugins/cvs/cvseditor.cpp @@ -50,9 +50,9 @@ namespace Internal { #define CVS_REVISION_PATTERN "[\\d\\.]+" #define CVS_REVISION_AT_START_PATTERN "^(" CVS_REVISION_PATTERN ") " -CVSEditor::CVSEditor(const VCSBase::VCSBaseEditorParameters *type, +CVSEditor::CVSEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent) : - VCSBase::VCSBaseEditorWidget(type, parent), + VcsBase::VcsBaseEditorWidget(type, parent), m_revisionAnnotationPattern(QLatin1String(CVS_REVISION_AT_START_PATTERN".*$")), m_revisionLogPattern(QLatin1String("^revision *(" CVS_REVISION_PATTERN ")$")) { @@ -94,10 +94,10 @@ QString CVSEditor::changeUnderCursor(const QTextCursor &c) const // Check if we are at the beginning of a line within a reasonable offset. // 2) Log: check for lines like "revision 1.1", cursor past "revision" switch (contentType()) { - case VCSBase::RegularCommandOutput: - case VCSBase::DiffOutput: + case VcsBase::RegularCommandOutput: + case VcsBase::DiffOutput: break; - case VCSBase::AnnotateOutput: { + case VcsBase::AnnotateOutput: { const QTextBlock block = c.block(); if (c.atBlockStart() || (c.position() - block.position() < 3)) { const QString line = block.text(); @@ -106,7 +106,7 @@ QString CVSEditor::changeUnderCursor(const QTextCursor &c) const } } break; - case VCSBase::LogOutput: { + case VcsBase::LogOutput: { const QTextBlock block = c.block(); if (c.position() - block.position() > 8 && m_revisionLogPattern.exactMatch(block.text())) return m_revisionLogPattern.cap(1); @@ -124,14 +124,14 @@ cvs diff -d -u -r1.1 -r1.2: \endcode */ -VCSBase::DiffHighlighter *CVSEditor::createDiffHighlighter() const +VcsBase::DiffHighlighter *CVSEditor::createDiffHighlighter() const { const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*1\\.[\\d\\.]+$")); QTC_CHECK(filePattern.isValid()); - return new VCSBase::DiffHighlighter(filePattern); + return new VcsBase::DiffHighlighter(filePattern); } -VCSBase::BaseAnnotationHighlighter *CVSEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *CVSEditor::createAnnotationHighlighter(const QSet<QString> &changes) const { return new CVSAnnotationHighlighter(changes); } diff --git a/src/plugins/cvs/cvseditor.h b/src/plugins/cvs/cvseditor.h index 0d7a8899e1..b758d1192b 100644 --- a/src/plugins/cvs/cvseditor.h +++ b/src/plugins/cvs/cvseditor.h @@ -40,19 +40,19 @@ namespace CVS { namespace Internal { -class CVSEditor : public VCSBase::VCSBaseEditorWidget +class CVSEditor : public VcsBase::VcsBaseEditorWidget { Q_OBJECT public: - explicit CVSEditor(const VCSBase::VCSBaseEditorParameters *type, + explicit CVSEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent); private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &) const; - virtual VCSBase::DiffHighlighter *createDiffHighlighter() const; - virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; virtual QStringList annotationPreviousVersions(const QString &revision) const; diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index 1418932eab..015df3425d 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -115,27 +115,27 @@ static const char CMD_ID_REPOSITORYSTATUS[] = "CVS.RepositoryStatus"; static const char CMD_ID_REPOSITORYUPDATE[] = "CVS.RepositoryUpdate"; static const char CMD_ID_SEPARATOR3[] = "CVS.Separator3"; -static const VCSBase::VCSBaseEditorParameters editorParameters[] = { +static const VcsBase::VcsBaseEditorParameters editorParameters[] = { { - VCSBase::RegularCommandOutput, + VcsBase::RegularCommandOutput, "CVS Command Log Editor", // id QT_TRANSLATE_NOOP("VCS", "CVS Command Log Editor"), // display name "CVS Command Log Editor", // context "application/vnd.nokia.text.scs_cvs_commandlog", "scslog"}, -{ VCSBase::LogOutput, +{ VcsBase::LogOutput, "CVS File Log Editor", // id QT_TRANSLATE_NOOP("VCS", "CVS File Log Editor"), // display name "CVS File Log Editor", // context "application/vnd.nokia.text.scs_cvs_filelog", "scsfilelog"}, -{ VCSBase::AnnotateOutput, +{ VcsBase::AnnotateOutput, "CVS Annotation Editor", // id QT_TRANSLATE_NOOP("VCS", "CVS Annotation Editor"), // display name "CVS Annotation Editor", // context "application/vnd.nokia.text.scs_cvs_annotation", "scsannotate"}, -{ VCSBase::DiffOutput, +{ VcsBase::DiffOutput, "CVS Diff Editor", // id QT_TRANSLATE_NOOP("VCS", "CVS Diff Editor"), // display name "CVS Diff Editor", // context @@ -143,10 +143,10 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = { }; // Utility to find a parameter set by type -static inline const VCSBase::VCSBaseEditorParameters *findType(int ie) +static inline const VcsBase::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 VcsBase::EditorContentType et = static_cast<VcsBase::EditorContentType>(ie); + return VcsBase::VcsBaseEditorWidget::findType(editorParameters, sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters), et); } static inline QString debugCodec(const QTextCodec *c) @@ -163,7 +163,7 @@ static inline bool messageBoxQuestion(const QString &title, const QString &quest CVSPlugin *CVSPlugin::m_cvsPluginInstance = 0; CVSPlugin::CVSPlugin() : - VCSBase::VCSBasePlugin(QLatin1String(CVS::Constants::CVSCOMMITEDITOR_ID)), + VcsBase::VcsBasePlugin(QLatin1String(CVS::Constants::CVSCOMMITEDITOR_ID)), m_commandLocator(0), m_addAction(0), m_deleteAction(0), @@ -213,7 +213,7 @@ bool CVSPlugin::isCommitEditorOpen() const return !m_commitMessageFileName.isEmpty(); } -static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { +static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = { CVS::Constants::CVS_SUBMIT_MIMETYPE, CVS::Constants::CVSCOMMITEDITOR_ID, CVS::Constants::CVSCOMMITEDITOR_DISPLAY_NAME, @@ -232,8 +232,8 @@ static inline Core::Command *createSeparator(QObject *parent, bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMessage) { - typedef VCSBase::VCSSubmitEditorFactory<CVSSubmitEditor> CVSSubmitEditorFactory; - typedef VCSBase::VCSEditorFactory<CVSEditor> CVSEditorFactory; + typedef VcsBase::VcsSubmitEditorFactory<CVSSubmitEditor> CVSSubmitEditorFactory; + typedef VcsBase::VcsEditorFactory<CVSEditor> CVSEditorFactory; using namespace Constants; using namespace Core::Constants; @@ -255,7 +255,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes addAutoReleasedObject(new CVSSubmitEditorFactory(&submitParameters)); static const char *describeSlotC = SLOT(slotDescribe(QString,QString)); - const int editorCount = sizeof(editorParameters)/sizeof(VCSBase::VCSBaseEditorParameters); + const int editorCount = sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters); for (int i = 0; i < editorCount; i++) addAutoReleasedObject(new CVSEditorFactory(editorParameters + i, this, describeSlotC)); @@ -445,12 +445,12 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes // Actions of the submit editor Core::Context cvscommitcontext(Constants::CVSCOMMITEDITOR); - m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this); + m_submitCurrentLogAction = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this); command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, cvscommitcontext); command->setAttribute(Core::Command::CA_UpdateText); connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog())); - m_submitDiffAction = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); + m_submitDiffAction = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); command = ami->registerAction(m_submitDiffAction , Constants::DIFF_SELECTED, cvscommitcontext); m_submitUndoAction = new QAction(tr("&Undo"), this); @@ -461,7 +461,7 @@ bool CVSPlugin::initialize(const QStringList & /*arguments */, QString *errorMes return true; } -bool CVSPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor) +bool CVSPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) { if (!isCommitEditorOpen()) return true; @@ -481,16 +481,16 @@ bool CVSPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi // Prompt user. Force a prompt unless submit was actually invoked (that // is, the editor was closed or shutdown). CVSSettings newSettings = m_settings; - const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer = + const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer = editor->promptSubmit(tr("Closing CVS Editor"), tr("Do you want to commit the change?"), tr("The commit message check failed. Do you want to commit the change?"), &newSettings.promptToSubmit, !m_submitActionTriggered); m_submitActionTriggered = false; switch (answer) { - case VCSBase::VCSBaseSubmitEditor::SubmitCanceled: + case VcsBase::VcsBaseSubmitEditor::SubmitCanceled: return false; // Keep editing and change file - case VCSBase::VCSBaseSubmitEditor::SubmitDiscarded: + case VcsBase::VcsBaseSubmitEditor::SubmitDiscarded: cleanCommitMessageFile(); return true; // Cancel all default: @@ -517,7 +517,7 @@ void CVSPlugin::diffCommitFiles(const QStringList &files) static inline void setDiffBaseDirectory(Core::IEditor *editor, const QString &db) { - if (VCSBase::VCSBaseEditorWidget *ve = qobject_cast<VCSBase::VCSBaseEditorWidget*>(editor->widget())) + if (VcsBase::VcsBaseEditorWidget *ve = qobject_cast<VcsBase::VcsBaseEditorWidget*>(editor->widget())) ve->setDiffBaseDirectory(db); } @@ -532,7 +532,7 @@ struct CvsDiffParameters // Parameter widget controlling whitespace diff mode, associated with a parameter // struct. -class CvsDiffParameterWidget : public VCSBase::VCSBaseEditorParameterWidget +class CvsDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT public: @@ -549,7 +549,7 @@ private: }; CvsDiffParameterWidget::CvsDiffParameterWidget(const CvsDiffParameters &p, QWidget *parent) : - VCSBase::VCSBaseEditorParameterWidget(parent), m_parameters(p) + VcsBase::VcsBaseEditorParameterWidget(parent), m_parameters(p) { setBaseArguments(p.arguments); addToggleButton(QLatin1String("-w"), tr("Ignore whitespace")); @@ -578,9 +578,9 @@ void CVSPlugin::cvsDiff(const CvsDiffParameters &p) { if (CVS::Constants::debug) qDebug() << Q_FUNC_INFO << p.files; - const QString source = VCSBase::VCSBaseEditorWidget::getSource(p.workingDir, p.files); - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(p.workingDir, p.files); - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(p.workingDir, p.files); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(p.workingDir, p.files); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(p.workingDir, p.files); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(p.workingDir, p.files); QStringList args(QLatin1String("diff")); args.append(p.arguments); @@ -604,16 +604,16 @@ void CVSPlugin::cvsDiff(const CvsDiffParameters &p) // diff of a single file? re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file // Show in the same editor if diff has been executed before - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::DiffOutput, p.workingDir, p.files); - if (Core::IEditor *existingEditor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag)) { + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::DiffOutput, p.workingDir, p.files); + if (Core::IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { existingEditor->createNew(output); Core::EditorManager::instance()->activateEditor(existingEditor, Core::EditorManager::ModeSwitch); setDiffBaseDirectory(existingEditor, p.workingDir); return; } const QString title = QString::fromLatin1("cvs diff %1").arg(id); - Core::IEditor *editor = showOutputInEditor(title, output, VCSBase::DiffOutput, source, codec); - VCSBase::VCSBaseEditorWidget::tagEditor(editor, tag); + Core::IEditor *editor = showOutputInEditor(title, output, VcsBase::DiffOutput, source, codec); + VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag); setDiffBaseDirectory(editor, p.workingDir); CVSEditor *diffEditorWidget = qobject_cast<CVSEditor*>(editor->widget()); QTC_ASSERT(diffEditorWidget, return ; ) @@ -624,7 +624,7 @@ void CVSPlugin::cvsDiff(const CvsDiffParameters &p) CvsDiffParameterWidget *pw = new CvsDiffParameterWidget(p); connect(pw, SIGNAL(reRunDiff(CVS::Internal::CvsDiffParameters)), this, SLOT(cvsDiff(CVS::Internal::CvsDiffParameters))); - connect(diffEditorWidget, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), + connect(diffEditorWidget, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), pw, SLOT(triggerReRun())); diffEditorWidget->setConfigurationWidget(pw); } @@ -641,7 +641,7 @@ CVSSubmitEditor *CVSPlugin::openCVSSubmitEditor(const QString &fileName) return submitEditor; } -void CVSPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) +void CVSPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { if (!enableMenuAction(as, m_menuAction)) { m_commandLocator->setEnabled(false); @@ -679,14 +679,14 @@ void CVSPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) void CVSPlugin::addCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) vcsAdd(state.currentFileTopLevel(), state.relativeCurrentFile()); } void CVSPlugin::revertAll() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) const QString title = tr("Revert repository"); if (!messageBoxQuestion(title, tr("Revert all pending changes to the repository?"))) @@ -705,7 +705,7 @@ void CVSPlugin::revertAll() void CVSPlugin::revertCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) QStringList args; args << QLatin1String("diff") << state.relativeCurrentFile(); @@ -741,28 +741,28 @@ void CVSPlugin::revertCurrentFile() void CVSPlugin::diffProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) cvsDiff(state.currentProjectTopLevel(), state.relativeCurrentProject()); } void CVSPlugin::diffCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) cvsDiff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void CVSPlugin::startCommitCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) startCommit(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void CVSPlugin::startCommitAll() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) startCommit(state.topLevel()); } @@ -772,10 +772,10 @@ void CVSPlugin::startCommitAll() * commit will start. */ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files) { - if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor()) + if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor()) return; if (isCommitEditorOpen()) { - VCSBase::VCSBaseOutputWindow::instance()->appendWarning(tr("Another commit is currently being executed.")); + VcsBase::VcsBaseOutputWindow::instance()->appendWarning(tr("Another commit is currently being executed.")); return; } @@ -799,7 +799,7 @@ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files) } } if (statusOutput.empty()) { - VCSBase::VCSBaseOutputWindow::instance()->append(tr("There are no modified files.")); + VcsBase::VcsBaseOutputWindow::instance()->append(tr("There are no modified files.")); return; } m_commitRepository = workingDir; @@ -812,7 +812,7 @@ void CVSPlugin::startCommit(const QString &workingDir, const QStringList &files) // Create a submit saver.write(submitTemplate.toUtf8()); if (!saver.finalize()) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(saver.errorString()); + VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString()); return; } m_commitMessageFileName = saver.fileName(); @@ -838,21 +838,21 @@ bool CVSPlugin::commit(const QString &messageFile, void CVSPlugin::filelogCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) filelog(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true); } void CVSPlugin::logProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) filelog(state.currentProjectTopLevel(), state.relativeCurrentProject()); } void CVSPlugin::logRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) filelog(state.topLevel()); } @@ -861,10 +861,10 @@ void CVSPlugin::filelog(const QString &workingDir, const QStringList &files, bool enableAnnotationContextMenu) { - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(workingDir, files); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(workingDir, files); // no need for temp file - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, files); - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, files); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); QStringList args; args << QLatin1String("log"); args.append(files); @@ -876,22 +876,22 @@ void CVSPlugin::filelog(const QString &workingDir, // Re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::LogOutput, workingDir, files); - if (Core::IEditor *editor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag)) { + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::LogOutput, workingDir, files); + if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { editor->createNew(response.stdOut); Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch); } else { const QString title = QString::fromLatin1("cvs log %1").arg(id); - Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, source, codec); - VCSBase::VCSBaseEditorWidget::tagEditor(newEditor, tag); + Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VcsBase::LogOutput, source, codec); + VcsBase::VcsBaseEditorWidget::tagEditor(newEditor, tag); if (enableAnnotationContextMenu) - VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(newEditor)->setFileLogAnnotateEnabled(true); + VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(newEditor)->setFileLogAnnotateEnabled(true); } } void CVSPlugin::updateProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) update(state.currentProjectTopLevel(), state.relativeCurrentProject()); } @@ -912,28 +912,28 @@ bool CVSPlugin::update(const QString &topLevel, const QStringList &files) void CVSPlugin::editCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) edit(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void CVSPlugin::uneditCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) unedit(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void CVSPlugin::uneditCurrentRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) unedit(state.topLevel(), QStringList()); } void CVSPlugin::annotateCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) annotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } @@ -999,9 +999,9 @@ void CVSPlugin::annotate(const QString &workingDir, const QString &file, int lineNumber /* = -1 */) { const QStringList files(file); - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(workingDir, files); - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, files, revision); - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, file); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(workingDir, files); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files, revision); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, file); QStringList args; args << QLatin1String("annotate"); if (!revision.isEmpty()) @@ -1016,18 +1016,18 @@ void CVSPlugin::annotate(const QString &workingDir, const QString &file, // Re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file if (lineNumber < 1) - lineNumber = VCSBase::VCSBaseEditorWidget::lineNumberOfCurrentEditor(file); + lineNumber = VcsBase::VcsBaseEditorWidget::lineNumberOfCurrentEditor(file); - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::AnnotateOutput, workingDir, QStringList(file), revision); - if (Core::IEditor *editor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag)) { + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::AnnotateOutput, workingDir, QStringList(file), revision); + if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { editor->createNew(response.stdOut); - VCSBase::VCSBaseEditorWidget::gotoLineOfEditor(editor, lineNumber); + VcsBase::VcsBaseEditorWidget::gotoLineOfEditor(editor, lineNumber); Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch); } else { const QString title = QString::fromLatin1("cvs annotate %1").arg(id); - Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, source, codec); - VCSBase::VCSBaseEditorWidget::tagEditor(newEditor, tag); - VCSBase::VCSBaseEditorWidget::gotoLineOfEditor(newEditor, lineNumber); + Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VcsBase::AnnotateOutput, source, codec); + VcsBase::VcsBaseEditorWidget::tagEditor(newEditor, tag); + VcsBase::VcsBaseEditorWidget::gotoLineOfEditor(newEditor, lineNumber); } } @@ -1039,41 +1039,41 @@ bool CVSPlugin::status(const QString &topLevel, const QStringList &files, const runCVS(topLevel, args, m_settings.timeOutMS(), 0); const bool ok = response.result == CVSResponse::Ok; if (ok) - showOutputInEditor(title, response.stdOut, VCSBase::RegularCommandOutput, topLevel, 0); + showOutputInEditor(title, response.stdOut, VcsBase::RegularCommandOutput, topLevel, 0); return ok; } void CVSPlugin::projectStatus() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) status(state.currentProjectTopLevel(), state.relativeCurrentProject(), tr("Project status")); } void CVSPlugin::commitProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) startCommit(state.currentProjectTopLevel(), state.relativeCurrentProject()); } void CVSPlugin::diffRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) cvsDiff(state.topLevel(), QStringList()); } void CVSPlugin::statusRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) status(state.topLevel(), QStringList(), tr("Repository status")); } void CVSPlugin::updateRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) update(state.topLevel(), QStringList()); @@ -1083,7 +1083,7 @@ void CVSPlugin::slotDescribe(const QString &source, const QString &changeNr) { QString errorMessage; if (!describe(source, changeNr, &errorMessage)) - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); } bool CVSPlugin::describe(const QString &file, const QString &changeNr, QString *errorMessage) @@ -1173,7 +1173,7 @@ bool CVSPlugin::describe(const QString &repositoryPath, for (QList<CVS_LogEntry>::iterator it = entries.begin(); it != lend; ++it) { // Before fiddling file names, try to find codec if (!codec) - codec = VCSBase::VCSBaseEditorWidget::getCodec(repositoryPath, QStringList(it->file)); + codec = VcsBase::VcsBaseEditorWidget::getCodec(repositoryPath, QStringList(it->file)); // Run log QStringList args(QLatin1String("log")); args << (QLatin1String("-r") + it->revisions.front().revision) << it->file; @@ -1215,14 +1215,14 @@ bool CVSPlugin::describe(const QString &repositoryPath, // Re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file const QString commitId = entries.front().revisions.front().commitId; - if (Core::IEditor *editor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(commitId)) { + if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(commitId)) { editor->createNew(output); Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch); setDiffBaseDirectory(editor, repositoryPath); } else { const QString title = QString::fromLatin1("cvs describe %1").arg(commitId); - Core::IEditor *newEditor = showOutputInEditor(title, output, VCSBase::DiffOutput, entries.front().file, codec); - VCSBase::VCSBaseEditorWidget::tagEditor(newEditor, commitId); + Core::IEditor *newEditor = showOutputInEditor(title, output, VcsBase::DiffOutput, entries.front().file, codec); + VcsBase::VcsBaseEditorWidget::tagEditor(newEditor, commitId); setDiffBaseDirectory(newEditor, repositoryPath); } return true; @@ -1252,7 +1252,7 @@ CVSResponse CVSPlugin::runCVS(const QString &workingDirectory, } // Run, connect stderr to the output window const Utils::SynchronousProcessResponse sp_resp = - runVCS(workingDirectory, executable, + runVcs(workingDirectory, executable, m_settings.addOptions(arguments), timeOut, flags, outputCodec); @@ -1282,7 +1282,7 @@ Core::IEditor * CVSPlugin::showOutputInEditor(const QString& title, const QStrin int editorType, const QString &source, QTextCodec *codec) { - const VCSBase::VCSBaseEditorParameters *params = findType(editorType); + const VcsBase::VcsBaseEditorParameters *params = findType(editorType); QTC_ASSERT(params, return 0); const Core::Id id = params->id; if (CVS::Constants::debug) diff --git a/src/plugins/cvs/cvsplugin.h b/src/plugins/cvs/cvsplugin.h index 1301c465ad..28be7b4ba0 100644 --- a/src/plugins/cvs/cvsplugin.h +++ b/src/plugins/cvs/cvsplugin.h @@ -53,8 +53,8 @@ namespace Utils { class ParameterAction; } -namespace VCSBase { - class VCSBaseSubmitEditor; +namespace VcsBase { + class VcsBaseSubmitEditor; } namespace Locator { @@ -78,7 +78,7 @@ struct CVSResponse QString message; }; -class CVSPlugin : public VCSBase::VCSBasePlugin +class CVSPlugin : public VcsBase::VcsBasePlugin { Q_OBJECT @@ -134,8 +134,8 @@ private slots: void cvsDiff(const CVS::Internal::CvsDiffParameters &p); protected: - virtual void updateActions(VCSBase::VCSBasePlugin::ActionState); - virtual bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor); + virtual void updateActions(VcsBase::VcsBasePlugin::ActionState); + virtual bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor); private: bool isCommitEditorOpen() const; diff --git a/src/plugins/cvs/cvssubmiteditor.cpp b/src/plugins/cvs/cvssubmiteditor.cpp index d458c494ac..3cf6eb615a 100644 --- a/src/plugins/cvs/cvssubmiteditor.cpp +++ b/src/plugins/cvs/cvssubmiteditor.cpp @@ -38,9 +38,9 @@ using namespace CVS::Internal; -CVSSubmitEditor::CVSSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, +CVSSubmitEditor::CVSSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parentWidget) : - VCSBase::VCSBaseSubmitEditor(parameters, new Utils::SubmitEditorWidget(parentWidget)), + VcsBase::VcsBaseSubmitEditor(parameters, new Utils::SubmitEditorWidget(parentWidget)), m_msgAdded(tr("Added")), m_msgRemoved(tr("Removed")), m_msgModified(tr("Modified")) @@ -63,7 +63,7 @@ QString CVSSubmitEditor::stateName(State st) const void CVSSubmitEditor::setStateList(const QList<StateFilePair> &statusOutput) { typedef QList<StateFilePair>::const_iterator ConstIterator; - VCSBase::SubmitFileModel *model = new VCSBase::SubmitFileModel(this); + VcsBase::SubmitFileModel *model = new VcsBase::SubmitFileModel(this); const ConstIterator cend = statusOutput.constEnd(); for (ConstIterator it = statusOutput.constBegin(); it != cend; ++it) diff --git a/src/plugins/cvs/cvssubmiteditor.h b/src/plugins/cvs/cvssubmiteditor.h index 41a72f2e23..17f54474f6 100644 --- a/src/plugins/cvs/cvssubmiteditor.h +++ b/src/plugins/cvs/cvssubmiteditor.h @@ -41,7 +41,7 @@ namespace CVS { namespace Internal { -class CVSSubmitEditor : public VCSBase::VCSBaseSubmitEditor +class CVSSubmitEditor : public VcsBase::VcsBaseSubmitEditor { Q_OBJECT public: @@ -49,7 +49,7 @@ public: // A list of state indicators and file names. typedef QPair<State, QString> StateFilePair; - explicit CVSSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, + explicit CVSSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parentWidget = 0); void setStateList(const QList<StateFilePair> &statusOutput); diff --git a/src/plugins/cvs/settingspage.cpp b/src/plugins/cvs/settingspage.cpp index 11d469d960..5fdbfbcc4a 100644 --- a/src/plugins/cvs/settingspage.cpp +++ b/src/plugins/cvs/settingspage.cpp @@ -100,7 +100,7 @@ SettingsPage::SettingsPage() QString SettingsPage::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_CVS); + return QLatin1String(VcsBase::Constants::VCS_ID_CVS); } QString SettingsPage::displayName() const diff --git a/src/plugins/cvs/settingspage.h b/src/plugins/cvs/settingspage.h index 5b3701d039..0438f0947a 100644 --- a/src/plugins/cvs/settingspage.h +++ b/src/plugins/cvs/settingspage.h @@ -67,7 +67,7 @@ private: }; -class SettingsPage : public VCSBase::VCSBaseOptionsPage +class SettingsPage : public VcsBase::VcsBaseOptionsPage { Q_OBJECT diff --git a/src/plugins/git/annotationhighlighter.cpp b/src/plugins/git/annotationhighlighter.cpp index 4d8c023397..964e686f74 100644 --- a/src/plugins/git/annotationhighlighter.cpp +++ b/src/plugins/git/annotationhighlighter.cpp @@ -39,7 +39,7 @@ namespace Internal { GitAnnotationHighlighter::GitAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) : - VCSBase::BaseAnnotationHighlighter(changeNumbers, document), + VcsBase::BaseAnnotationHighlighter(changeNumbers, document), m_blank(QLatin1Char(' ')) { } diff --git a/src/plugins/git/annotationhighlighter.h b/src/plugins/git/annotationhighlighter.h index b2e351c759..cee698237a 100644 --- a/src/plugins/git/annotationhighlighter.h +++ b/src/plugins/git/annotationhighlighter.h @@ -39,7 +39,7 @@ namespace Git { namespace Internal { // Annotation highlighter for p4 triggering on 'changenumber:' -class GitAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter +class GitAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { Q_OBJECT public: diff --git a/src/plugins/git/branchdialog.cpp b/src/plugins/git/branchdialog.cpp index dc6c4ac0ce..e26627832a 100644 --- a/src/plugins/git/branchdialog.cpp +++ b/src/plugins/git/branchdialog.cpp @@ -92,7 +92,7 @@ void BranchDialog::refresh(const QString &repository, bool force) m_ui->repositoryLabel->setText(StashDialog::msgRepositoryLabel(m_repository)); QString errorMessage; if (!m_model->refresh(m_repository, &errorMessage)) - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); m_ui->branchView->expandAll(); } diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 6a1e333d6f..01bade6d08 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -270,7 +270,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r << newFullName.last(), &output, &errorMessage)) { node->name = oldFullName.last(); - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); return false; } @@ -310,7 +310,7 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage << QLatin1String("-v") << QLatin1String("-a"); QString output; if (!m_client->synchronousBranchCmd(workingDirectory, branchArgs, &output, errorMessage)) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(*errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(*errorMessage); return false; } @@ -334,7 +334,7 @@ void BranchModel::renameBranch(const QString &oldName, const QString &newName) if (!m_client->synchronousBranchCmd(m_workingDirectory, QStringList() << QLatin1String("-m") << oldName << newName, &output, &errorMessage)) - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); else refresh(m_workingDirectory, &errorMessage); } @@ -417,7 +417,7 @@ void BranchModel::removeBranch(const QModelIndex &idx) args << QLatin1String("-D") << branch; if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); return; } @@ -443,7 +443,7 @@ void BranchModel::checkoutBranch(const QModelIndex &idx) case GitClient::StashCanceled: return; case GitClient::StashFailed: - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); return; } if (m_client->synchronousCheckoutBranch(m_workingDirectory, branch, &errorMessage)) { @@ -460,7 +460,7 @@ void BranchModel::checkoutBranch(const QModelIndex &idx) } } if (!errorMessage.isEmpty()) - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); } bool BranchModel::branchIsMerged(const QModelIndex &idx) @@ -475,7 +475,7 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx) args << QLatin1String("-a") << QLatin1String("--contains") << sha(idx); if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); return false; } @@ -503,7 +503,7 @@ QModelIndex BranchModel::addBranch(const QString &branchName, bool track, const args << branchName << startPoint; if (!m_client->synchronousBranchCmd(m_workingDirectory, args, &output, &errorMessage)) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); return QModelIndex(); } diff --git a/src/plugins/git/clonewizard.cpp b/src/plugins/git/clonewizard.cpp index 3f7e4e3d13..e71310ff88 100644 --- a/src/plugins/git/clonewizard.cpp +++ b/src/plugins/git/clonewizard.cpp @@ -47,9 +47,9 @@ namespace Git { namespace Internal { CloneWizard::CloneWizard(QObject *parent) : - VCSBase::BaseCheckoutWizard(parent) + VcsBase::BaseCheckoutWizard(parent) { - setId(QLatin1String(VCSBase::Constants::VCS_ID_GIT)); + setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT)); } QIcon CloneWizard::icon() const @@ -72,19 +72,19 @@ QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path) QList<QWizardPage*> rc; const Internal::GitVersionControl *vc = Internal::GitPlugin::instance()->gitVersionControl(); if (!vc->isConfigured()) - rc.append(new VCSBase::VcsConfigurationPage(vc)); + rc.append(new VcsBase::VcsConfigurationPage(vc)); CloneWizardPage *cwp = new CloneWizardPage; cwp->setPath(path); rc.push_back(cwp); return rc; } -QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage*> ¶meterPages, +QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath) { // Collect parameters for the clone command. const CloneWizardPage *cwp = qobject_cast<const CloneWizardPage *>(parameterPages.front()); - QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>()) + QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>()) return cwp->createCheckoutJob(checkoutPath); } diff --git a/src/plugins/git/clonewizard.h b/src/plugins/git/clonewizard.h index 34fdc13b19..19296b67d8 100644 --- a/src/plugins/git/clonewizard.h +++ b/src/plugins/git/clonewizard.h @@ -38,7 +38,7 @@ namespace Git { namespace Internal { -class CloneWizard : public VCSBase::BaseCheckoutWizard +class CloneWizard : public VcsBase::BaseCheckoutWizard { Q_OBJECT public: @@ -52,7 +52,7 @@ public: protected: // BaseCheckoutWizard virtual QList<QWizardPage*> createParameterPages(const QString &path); - virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages, + virtual QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath); }; diff --git a/src/plugins/git/clonewizardpage.cpp b/src/plugins/git/clonewizardpage.cpp index b5e1eb8071..d9a2abd4d3 100644 --- a/src/plugins/git/clonewizardpage.cpp +++ b/src/plugins/git/clonewizardpage.cpp @@ -71,7 +71,7 @@ bool CloneWizardPagePrivate::urlIsLocal(const QString &url) } CloneWizardPage::CloneWizardPage(QWidget *parent) : - VCSBase::BaseCheckoutWizardPage(parent), + VcsBase::BaseCheckoutWizardPage(parent), d(new CloneWizardPagePrivate) { setTitle(tr("Location")); @@ -137,7 +137,7 @@ QString CloneWizardPage::directoryFromRepository(const QString &urlIn) const return url; } -QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(QString *checkoutPath) const +QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob(QString *checkoutPath) const { const Internal::GitClient *client = Internal::GitPlugin::instance()->gitClient(); const QString workingDirectory = path(); @@ -146,7 +146,7 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob( const QString binary = client->gitBinaryPath(); - VCSBase::ProcessCheckoutJob *job = new VCSBase::ProcessCheckoutJob; + VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob; const QProcessEnvironment env = client->processEnvironment(); // 1) Basic checkout step @@ -176,7 +176,7 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizardPage::createCheckoutJob( job->addStep(binary, args, *checkoutPath, env); } - return QSharedPointer<VCSBase::AbstractCheckoutJob>(job); + return QSharedPointer<VcsBase::AbstractCheckoutJob>(job); } QStringList CloneWizardPage::branches(const QString &repository, int *current) diff --git a/src/plugins/git/clonewizardpage.h b/src/plugins/git/clonewizardpage.h index 7ce0bb3b79..5bceaac1af 100644 --- a/src/plugins/git/clonewizardpage.h +++ b/src/plugins/git/clonewizardpage.h @@ -37,7 +37,7 @@ #include <QtCore/QSharedPointer> -namespace VCSBase { +namespace VcsBase { class AbstractCheckoutJob; } @@ -46,7 +46,7 @@ namespace Git { struct CloneWizardPagePrivate; // Used by gitorious as well. -class CloneWizardPage : public VCSBase::BaseCheckoutWizardPage +class CloneWizardPage : public VcsBase::BaseCheckoutWizardPage { Q_OBJECT Q_PROPERTY(bool deleteMasterBranch READ deleteMasterBranch WRITE setDeleteMasterBranch) @@ -54,7 +54,7 @@ public: explicit CloneWizardPage(QWidget *parent = 0); virtual ~CloneWizardPage(); - QSharedPointer<VCSBase::AbstractCheckoutJob> createCheckoutJob(QString *checkoutPath) const; + QSharedPointer<VcsBase::AbstractCheckoutJob> createCheckoutJob(QString *checkoutPath) const; protected: virtual QString directoryFromRepository(const QString &r) const; diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index b176370bae..5956f08540 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -82,7 +82,7 @@ static const char GIT_DIRECTORY[] = ".git"; namespace Git { namespace Internal { -class BaseGitDiffArgumentsWidget : public VCSBase::VCSBaseEditorParameterWidget +class BaseGitDiffArgumentsWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT @@ -210,7 +210,7 @@ private: QString m_id; }; -class GitBlameArgumentsWidget : public VCSBase::VCSBaseEditorParameterWidget +class GitBlameArgumentsWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT @@ -235,7 +235,7 @@ public: setBaseArguments(args); } - void setEditor(VCSBase::VCSBaseEditorWidget *editor) + void setEditor(VcsBase::VcsBaseEditorWidget *editor) { Q_ASSERT(editor); m_editor = editor; @@ -250,7 +250,7 @@ public: } private: - VCSBase::VCSBaseEditorWidget *m_editor; + VcsBase::VcsBaseEditorWidget *m_editor; GitClient *m_client; QString m_workingDirectory; QString m_revision; @@ -322,9 +322,9 @@ static inline QStringList commandOutputLinesFromLocal8Bit(const QByteArray &a) return output.split(newLine); } -static inline VCSBase::VCSBaseOutputWindow *outputWindow() +static inline VcsBase::VcsBaseOutputWindow *outputWindow() { - return VCSBase::VCSBaseOutputWindow::instance(); + return VcsBase::VcsBaseOutputWindow::instance(); } static inline QString msgRepositoryNotFound(const QString &dir) @@ -363,13 +363,13 @@ QString GitClient::findRepositoryForDirectory(const QString &dir) { // Check for ".git/config" const QString checkFile = QLatin1String(GIT_DIRECTORY) + QLatin1String("/config"); - return VCSBase::VCSBasePlugin::findRepositoryForDirectory(dir, checkFile); + return VcsBase::VcsBasePlugin::findRepositoryForDirectory(dir, checkFile); } -VCSBase::VCSBaseEditorWidget *GitClient::findExistingVCSEditor(const char *registerDynamicProperty, +VcsBase::VcsBaseEditorWidget *GitClient::findExistingVCSEditor(const char *registerDynamicProperty, const QString &dynamicPropertyValue) const { - VCSBase::VCSBaseEditorWidget *rc = 0; + VcsBase::VcsBaseEditorWidget *rc = 0; Core::IEditor *outputEditor = locateEditor(m_core, registerDynamicProperty, dynamicPropertyValue); if (!outputEditor) return 0; @@ -377,7 +377,7 @@ VCSBase::VCSBaseEditorWidget *GitClient::findExistingVCSEditor(const char *regis // Exists already Core::EditorManager::instance()->activateEditor(outputEditor, Core::EditorManager::ModeSwitch); outputEditor->createNew(m_msgWait); - rc = VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(outputEditor); + rc = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); return rc; } @@ -386,7 +386,7 @@ VCSBase::VCSBaseEditorWidget *GitClient::findExistingVCSEditor(const char *regis * (using the file's codec). Makes use of a dynamic property to find an * existing instance and to reuse it (in case, say, 'git diff foo' is * already open). */ -VCSBase::VCSBaseEditorWidget *GitClient::createVCSEditor(const Core::Id &id, +VcsBase::VcsBaseEditorWidget *GitClient::createVcsEditor(const Core::Id &id, QString title, // Source file or directory const QString &source, @@ -396,19 +396,19 @@ VCSBase::VCSBaseEditorWidget *GitClient::createVCSEditor(const Core::Id &id, const QString &dynamicPropertyValue, QWidget *configWidget) const { - VCSBase::VCSBaseEditorWidget *rc = 0; + VcsBase::VcsBaseEditorWidget *rc = 0; Q_ASSERT(!findExistingVCSEditor(registerDynamicProperty, dynamicPropertyValue)); // Create new, set wait message, set up with source and codec Core::IEditor *outputEditor = m_core->editorManager()->openEditorWithContents(id, &title, m_msgWait); outputEditor->file()->setProperty(registerDynamicProperty, dynamicPropertyValue); - rc = VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(outputEditor); + rc = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); connect(rc, SIGNAL(annotateRevisionRequested(QString,QString,int)), this, SLOT(slotBlameRevisionRequested(QString,QString,int))); QTC_ASSERT(rc, return 0); rc->setSource(source); if (codecType == CodecSource) { - rc->setCodec(VCSBase::VCSBaseEditorWidget::getCodec(source)); + rc->setCodec(VcsBase::VcsBaseEditorWidget::getCodec(source)); } else if (codecType == CodecLogOutput) { QString encodingName = readConfigValue(source, QLatin1String("i18n.logOutputEncoding")); if (encodingName.isEmpty()) @@ -434,15 +434,15 @@ void GitClient::diff(const QString &workingDirectory, const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID; const QString title = tr("Git Diff"); - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", workingDirectory); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", workingDirectory); if (!editor) { GitCommitDiffArgumentsWidget *argWidget = new GitCommitDiffArgumentsWidget(this, workingDirectory, diffArgs, unstagedFileNames, stagedFileNames); - editor = createVCSEditor(editorId, title, + editor = createVcsEditor(editorId, title, workingDirectory, CodecSource, "originalFileName", workingDirectory, argWidget); - connect(editor, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), argWidget, SLOT(executeCommand())); + connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), argWidget, SLOT(executeCommand())); editor->setRevertDiffChunkEnabled(true); } @@ -453,7 +453,7 @@ void GitClient::diff(const QString &workingDirectory, // Create a batch of 2 commands to be run after each other in case // we have a mixture of staged/unstaged files as is the case // when using the submit dialog. - VCSBase::Command *command = createCommand(workingDirectory, editor); + VcsBase::Command *command = createCommand(workingDirectory, editor); // Directory diff? QStringList cmdArgs; @@ -492,15 +492,15 @@ void GitClient::diff(const QString &workingDirectory, { const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID; const QString title = tr("Git Diff \"%1\"").arg(fileName); - const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, fileName); + const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileName); - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", sourceFile); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("originalFileName", sourceFile); if (!editor) { GitFileDiffArgumentsWidget *argWidget = new GitFileDiffArgumentsWidget(this, workingDirectory, diffArgs, fileName); - editor = createVCSEditor(editorId, title, sourceFile, CodecSource, "originalFileName", sourceFile, argWidget); - connect(editor, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), argWidget, SLOT(executeCommand())); + editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "originalFileName", sourceFile, argWidget); + connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), argWidget, SLOT(executeCommand())); editor->setRevertDiffChunkEnabled(true); } @@ -522,11 +522,11 @@ void GitClient::diffBranch(const QString &workingDirectory, { const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID; const QString title = tr("Git Diff Branch \"%1\"").arg(branchName); - const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, QStringList()); + const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, QStringList()); - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("BranchName", branchName); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("BranchName", branchName); if (!editor) - editor = createVCSEditor(editorId, title, sourceFile, CodecSource, "BranchName", branchName, + editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "BranchName", branchName, new GitBranchDiffArgumentsWidget(this, workingDirectory, diffArgs, branchName)); @@ -545,9 +545,9 @@ void GitClient::status(const QString &workingDirectory) // @TODO: Use "--no-color" once it is supported QStringList statusArgs(QLatin1String("status")); statusArgs << QLatin1String("-u"); - VCSBase::VCSBaseOutputWindow *outwin = outputWindow(); + VcsBase::VcsBaseOutputWindow *outwin = outputWindow(); outwin->setRepository(workingDirectory); - VCSBase::Command *command = executeGit(workingDirectory, statusArgs, 0, true); + VcsBase::Command *command = executeGit(workingDirectory, statusArgs, 0, true); connect(command, SIGNAL(finished(bool,int,QVariant)), outwin, SLOT(clearRepository()), Qt::QueuedConnection); } @@ -574,10 +574,10 @@ void GitClient::graphLog(const QString &workingDirectory, const QString & branch arguments << branch; } const Core::Id editorId = Git::Constants::GIT_LOG_EDITOR_ID; - const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, QStringList()); - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile); + const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, QStringList()); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile); if (!editor) - editor = createVCSEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile, 0); + editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile, 0); executeGit(workingDirectory, arguments, editor); } @@ -588,10 +588,10 @@ void GitClient::log(const QString &workingDirectory, const QStringList &fileName fileNames.join(QString(", ")); const QString title = tr("Git Log \"%1\"").arg(msgArg); const Core::Id editorId = Git::Constants::GIT_LOG_EDITOR_ID; - const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, fileNames); - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile); + const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileNames); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("logFileName", sourceFile); if (!editor) - editor = createVCSEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile, + editor = createVcsEditor(editorId, title, sourceFile, CodecLogOutput, "logFileName", sourceFile, new GitLogArgumentsWidget(this, workingDirectory, enableAnnotationContextMenu, args, fileNames)); @@ -640,9 +640,9 @@ void GitClient::show(const QString &source, const QString &id, const QStringList const QString title = tr("Git Show \"%1\"").arg(id); const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID; - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("show", id); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("show", id); if (!editor) - editor = createVCSEditor(editorId, title, source, CodecSource, "show", id, + editor = createVcsEditor(editorId, title, source, CodecSource, "show", id, new GitShowArgumentsWidget(this, source, args, id)); GitShowArgumentsWidget *argWidget = qobject_cast<GitShowArgumentsWidget *>(editor->configurationWidget()); @@ -682,16 +682,16 @@ void GitClient::blame(const QString &workingDirectory, int lineNumber) { const Core::Id editorId = Git::Constants::GIT_BLAME_EDITOR_ID; - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDirectory, QStringList(fileName), revision); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDirectory, QStringList(fileName), revision); const QString title = tr("Git Blame \"%1\"").arg(id); - const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, fileName); + const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, fileName); - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("blameFileName", id); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("blameFileName", id); if (!editor) { GitBlameArgumentsWidget *argWidget = new GitBlameArgumentsWidget(this, workingDirectory, args, revision, fileName); - editor = createVCSEditor(editorId, title, sourceFile, CodecSource, "blameFileName", id, argWidget); + editor = createVcsEditor(editorId, title, sourceFile, CodecSource, "blameFileName", id, argWidget); argWidget->setEditor(editor); } @@ -704,14 +704,14 @@ void GitClient::blame(const QString &workingDirectory, arguments << QLatin1String("--") << fileName; if (!revision.isEmpty()) arguments << revision; - executeGit(workingDirectory, arguments, editor, false, VCSBase::Command::NoReport, lineNumber); + executeGit(workingDirectory, arguments, editor, false, VcsBase::Command::NoReport, lineNumber); } void GitClient::checkoutBranch(const QString &workingDirectory, const QString &branch) { QStringList arguments(QLatin1String("checkout")); arguments << branch; - VCSBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true); + VcsBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true); connectRepositoryChanged(workingDirectory, cmd); } @@ -761,7 +761,7 @@ void GitClient::hardReset(const QString &workingDirectory, const QString &commit if (!commit.isEmpty()) arguments << commit; - VCSBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true); + VcsBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true); connectRepositoryChanged(workingDirectory, cmd); } @@ -881,7 +881,7 @@ bool GitClient::synchronousInit(const QString &workingDirectory) if (!rc) outputWindow()->appendError(commandOutputFromLocal8Bit(errorText)); else { - // TODO: Turn this into a VCSBaseClient and use resetCachedVcsInfo(...) + // TODO: Turn this into a VcsBaseClient and use resetCachedVcsInfo(...) Core::VcsManager *vcsManager = m_core->vcsManager(); vcsManager->resetVersionControlForDirectory(workingDirectory); } @@ -1314,12 +1314,12 @@ bool GitClient::synchronousApplyPatch(const QString &workingDirectory, } // Factory function to create an asynchronous command -VCSBase::Command *GitClient::createCommand(const QString &workingDirectory, - VCSBase::VCSBaseEditorWidget* editor, +VcsBase::Command *GitClient::createCommand(const QString &workingDirectory, + VcsBase::VcsBaseEditorWidget* editor, bool useOutputToWindow, int editorLineNumber) { - VCSBase::Command *command = new VCSBase::Command(gitBinaryPath(), workingDirectory, processEnvironment()); + VcsBase::Command *command = new VcsBase::Command(gitBinaryPath(), workingDirectory, processEnvironment()); command->setCookie(QVariant(editorLineNumber)); if (editor) connect(command, SIGNAL(finished(bool,int,QVariant)), editor, SLOT(commandFinishedGotoLine(bool,int,QVariant))); @@ -1339,16 +1339,16 @@ VCSBase::Command *GitClient::createCommand(const QString &workingDirectory, } // Execute a single command -VCSBase::Command *GitClient::executeGit(const QString &workingDirectory, +VcsBase::Command *GitClient::executeGit(const QString &workingDirectory, const QStringList &arguments, - VCSBase::VCSBaseEditorWidget* editor, + VcsBase::VcsBaseEditorWidget* editor, bool useOutputToWindow, - VCSBase::Command::TerminationReportMode tm, + VcsBase::Command::TerminationReportMode tm, int editorLineNumber, bool unixTerminalDisabled) { outputWindow()->appendCommand(workingDirectory, settings()->stringValue(GitSettings::binaryPathKey), arguments); - VCSBase::Command *command = createCommand(workingDirectory, editor, useOutputToWindow, editorLineNumber); + VcsBase::Command *command = createCommand(workingDirectory, editor, useOutputToWindow, editorLineNumber); command->addJob(arguments, settings()->intValue(GitSettings::timeoutKey)); command->setTerminationReportMode(tm); command->setUnixTerminalDisabled(unixTerminalDisabled); @@ -1367,7 +1367,7 @@ QProcessEnvironment GitClient::processEnvironment() const environment.insert(QLatin1String("HOME"), QDir::toNativeSeparators(QDir::homePath())); #endif // Q_OS_WIN // Set up SSH and C locale (required by git using perl). - VCSBase::VCSBasePlugin::setProcessEnvironment(&environment, false); + VcsBase::VcsBasePlugin::setProcessEnvironment(&environment, false); return environment; } @@ -1378,7 +1378,7 @@ Utils::SynchronousProcessResponse GitClient::synchronousGit(const QString &worki unsigned flags, QTextCodec *stdOutCodec) { - return VCSBase::VCSBasePlugin::runVCS(workingDirectory, gitBinaryPath(), gitArguments, + return VcsBase::VcsBasePlugin::runVcs(workingDirectory, gitBinaryPath(), gitArguments, settings()->intValue(GitSettings::timeoutKey) * 1000, processEnvironment(), flags, stdOutCodec); @@ -1390,7 +1390,7 @@ bool GitClient::fullySynchronousGit(const QString &workingDirectory, QByteArray* errorText, bool logCommandToWindow) const { - return VCSBase::VCSBasePlugin::runFullySynchronous(workingDirectory, gitBinaryPath(), gitArguments, + return VcsBase::VcsBasePlugin::runFullySynchronous(workingDirectory, gitBinaryPath(), gitArguments, processEnvironment(), outputText, errorText, settings()->intValue(GitSettings::timeoutKey) * 1000, logCommandToWindow); @@ -1506,9 +1506,9 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR QStringList arguments(QLatin1String("ls-remote")); arguments << repositoryURL << QLatin1String("HEAD") << QLatin1String("refs/heads/*"); const unsigned flags = - VCSBase::VCSBasePlugin::SshPasswordPrompt| - VCSBase::VCSBasePlugin::SuppressStdErrInLogWindow| - VCSBase::VCSBasePlugin::SuppressFailMessageInLogWindow; + VcsBase::VcsBasePlugin::SshPasswordPrompt| + VcsBase::VcsBasePlugin::SuppressStdErrInLogWindow| + VcsBase::VcsBasePlugin::SuppressFailMessageInLogWindow; const Utils::SynchronousProcessResponse resp = synchronousGit(QString(), arguments, flags); QStringList branches; branches << "<detached HEAD>"; @@ -1564,7 +1564,7 @@ bool GitClient::tryLauchingGitK(const QProcessEnvironment &env, const QString binary = gitBinDirectory + QLatin1String("/gitk"); QStringList arguments; #endif - VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance(); const QString gitkOpts = settings()->stringValue(GitSettings::gitkOptionsKey); if (!gitkOpts.isEmpty()) arguments.append(Utils::QtcProcess::splitArgs(gitkOpts)); @@ -1667,7 +1667,7 @@ bool GitClient::getCommitData(const QString &workingDirectory, // Filter out untracked files that are not part of the project QStringList untrackedFiles = commitData->filterFiles(CommitData::UntrackedFile); - VCSBase::VCSBaseSubmitEditor::filterUntrackedFilesOfProject(repoDirectory, &untrackedFiles); + VcsBase::VcsBaseSubmitEditor::filterUntrackedFilesOfProject(repoDirectory, &untrackedFiles); QList<CommitData::StateFilePair> filteredFiles; QList<CommitData::StateFilePair>::const_iterator it = commitData->files.constBegin(); for ( ; it != commitData->files.constEnd(); ++it) { @@ -1736,7 +1736,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory, const GitSubmitEditorPanelData &data, const QString &amendSHA1, const QString &messageFile, - VCSBase::SubmitFileModel *model) + VcsBase::SubmitFileModel *model) { const QString renameSeparator = QLatin1String(" -> "); const bool amend = !amendSHA1.isEmpty(); @@ -1827,7 +1827,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory, * files) or a single directory (revert all). Qt Creator currently has only * 'revert single' in its VCS menus, but the code is prepared to deal with * reverting a directory pending a sophisticated selection dialog in the - * VCSBase plugin. */ + * VcsBase plugin. */ GitClient::RevertResult GitClient::revertI(QStringList files, bool *ptrToIsDirectory, QString *errorMessage, @@ -1938,8 +1938,8 @@ bool GitClient::synchronousFetch(const QString &workingDirectory, const QString if (!remote.isEmpty()) arguments << remote; // Disable UNIX terminals to suppress SSH prompting. - const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow - |VCSBase::VCSBasePlugin::ShowSuccessMessage; + const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow + |VcsBase::VcsBasePlugin::ShowSuccessMessage; const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags); return resp.result == Utils::SynchronousProcessResponse::Finished; } @@ -1955,7 +1955,7 @@ bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase) if (rebase) arguments << QLatin1String("--rebase"); // Disable UNIX terminals to suppress SSH prompting. - const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow; + const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow; const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, arguments, flags); // Notify about changed files or abort the rebase. const bool ok = resp.result == Utils::SynchronousProcessResponse::Finished; @@ -1971,7 +1971,7 @@ bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase) void GitClient::syncAbortPullRebase(const QString &workingDir) { // Abort rebase to clean if something goes wrong - VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance(); outwin->appendError(tr("The command 'git pull --rebase' failed, aborting rebase.")); QStringList arguments; arguments << QLatin1String("rebase") << QLatin1String("--abort"); @@ -1989,8 +1989,8 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory) QStringList args; args << QLatin1String("svn") << QLatin1String("fetch"); // Disable UNIX terminals to suppress SSH prompting. - const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow - |VCSBase::VCSBasePlugin::ShowSuccessMessage; + const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow + |VcsBase::VcsBasePlugin::ShowSuccessMessage; const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory, args, flags); // Notify about changes. if (resp.result == Utils::SynchronousProcessResponse::Finished) @@ -2008,18 +2008,18 @@ void GitClient::subversionLog(const QString &workingDirectory) // Create a command editor, no highlighting or interaction. const QString title = tr("Git SVN Log"); const Core::Id editorId = Git::Constants::C_GIT_COMMAND_LOG_EDITOR; - const QString sourceFile = VCSBase::VCSBaseEditorWidget::getSource(workingDirectory, QStringList()); - VCSBase::VCSBaseEditorWidget *editor = findExistingVCSEditor("svnLog", sourceFile); + const QString sourceFile = VcsBase::VcsBaseEditorWidget::getSource(workingDirectory, QStringList()); + VcsBase::VcsBaseEditorWidget *editor = findExistingVCSEditor("svnLog", sourceFile); if (!editor) - editor = createVCSEditor(editorId, title, sourceFile, CodecNone, "svnLog", sourceFile, 0); + editor = createVcsEditor(editorId, title, sourceFile, CodecNone, "svnLog", sourceFile, 0); executeGit(workingDirectory, arguments, editor); } bool GitClient::synchronousPush(const QString &workingDirectory, const QString &remote) { // Disable UNIX terminals to suppress SSH prompting. - const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt|VCSBase::VCSBasePlugin::ShowStdOutInLogWindow - |VCSBase::VCSBasePlugin::ShowSuccessMessage; + const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt|VcsBase::VcsBasePlugin::ShowStdOutInLogWindow + |VcsBase::VcsBasePlugin::ShowSuccessMessage; QStringList arguments(QLatin1String("push")); if (!remote.isEmpty()) arguments << remote; @@ -2037,7 +2037,7 @@ void GitClient::stashPop(const QString &workingDirectory) { QStringList arguments(QLatin1String("stash")); arguments << QLatin1String("pop"); - VCSBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true); + VcsBase::Command *cmd = executeGit(workingDirectory, arguments, 0, true); connectRepositoryChanged(workingDirectory, cmd); } @@ -2171,9 +2171,9 @@ QString GitClient::readConfigValue(const QString &workingDirectory, const QStrin bool GitClient::cloneRepository(const QString &directory,const QByteArray &url) { QDir workingDirectory(directory); - const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt | - VCSBase::VCSBasePlugin::ShowStdOutInLogWindow| - VCSBase::VCSBasePlugin::ShowSuccessMessage; + const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt | + VcsBase::VcsBasePlugin::ShowStdOutInLogWindow| + VcsBase::VcsBasePlugin::ShowSuccessMessage; if (workingDirectory.exists()) { if (!synchronousInit(workingDirectory.path())) @@ -2212,7 +2212,7 @@ bool GitClient::cloneRepository(const QString &directory,const QByteArray &url) workingDirectory.cdUp(); const Utils::SynchronousProcessResponse resp = synchronousGit(workingDirectory.path(), arguments, flags); - // TODO: Turn this into a VCSBaseClient and use resetCachedVcsInfo(...) + // TODO: Turn this into a VcsBaseClient and use resetCachedVcsInfo(...) Core::VcsManager *vcsManager = m_core->vcsManager(); vcsManager->resetVersionControlForDirectory(workingDirectory.absolutePath()); return (resp.result == Utils::SynchronousProcessResponse::Finished); @@ -2236,7 +2236,7 @@ GitSettings *GitClient::settings() const return m_settings; } -void GitClient::connectRepositoryChanged(const QString & repository, VCSBase::Command *cmd) +void GitClient::connectRepositoryChanged(const QString & repository, VcsBase::Command *cmd) { // Bind command success termination with repository to changed signal if (!m_repositoryChangedSignalMapper) { diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 8688c1e2f5..3746b420cc 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -55,8 +55,8 @@ namespace Core { class ICore; } -namespace VCSBase { - class VCSBaseEditorWidget; +namespace VcsBase { + class VcsBaseEditorWidget; class SubmitFileModel; } @@ -205,7 +205,7 @@ public: const GitSubmitEditorPanelData &data, const QString &amendSHA1, const QString &messageFile, - VCSBase::SubmitFileModel *model); + VcsBase::SubmitFileModel *model); enum StatusResult { StatusChanged, StatusUnchanged, StatusFailed }; StatusResult gitStatus(const QString &workingDirectory, @@ -233,10 +233,10 @@ private slots: void slotBlameRevisionRequested(const QString &source, QString change, int lineNumber); private: - VCSBase::VCSBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty, + VcsBase::VcsBaseEditorWidget *findExistingVCSEditor(const char *registerDynamicProperty, const QString &dynamicPropertyValue) const; enum CodecType { CodecSource, CodecLogOutput, CodecNone }; - VCSBase::VCSBaseEditorWidget *createVCSEditor(const Core::Id &kind, + VcsBase::VcsBaseEditorWidget *createVcsEditor(const Core::Id &kind, QString title, const QString &source, CodecType codecType, @@ -244,16 +244,16 @@ private: const QString &dynamicPropertyValue, QWidget *configWidget) const; - VCSBase::Command *createCommand(const QString &workingDirectory, - VCSBase::VCSBaseEditorWidget* editor = 0, + VcsBase::Command *createCommand(const QString &workingDirectory, + VcsBase::VcsBaseEditorWidget* editor = 0, bool useOutputToWindow = false, int editorLineNumber = -1); - VCSBase::Command *executeGit(const QString &workingDirectory, + VcsBase::Command *executeGit(const QString &workingDirectory, const QStringList &arguments, - VCSBase::VCSBaseEditorWidget* editor = 0, + VcsBase::VcsBaseEditorWidget* editor = 0, bool useOutputToWindow = false, - VCSBase::Command::TerminationReportMode tm = VCSBase::Command::NoReport, + VcsBase::Command::TerminationReportMode tm = VcsBase::Command::NoReport, int editorLineNumber = -1, bool unixTerminalDisabled = false); @@ -265,7 +265,7 @@ private: bool logCommandToWindow = true) const; // Synchronous git execution using Utils::SynchronousProcess, with - // log windows updating (using VCSBasePlugin::runVCS with flags). + // log windows updating (using VcsBasePlugin::runVcs with flags). inline Utils::SynchronousProcessResponse synchronousGit(const QString &workingDirectory, const QStringList &arguments, unsigned flags = 0, QTextCodec *outputCodec = 0); @@ -278,7 +278,7 @@ private: bool *isDirectory, QString *errorMessage, bool revertStaging); - void connectRepositoryChanged(const QString & repository, VCSBase::Command *cmd); + void connectRepositoryChanged(const QString & repository, VcsBase::Command *cmd); bool synchronousPull(const QString &workingDirectory, bool rebase); void syncAbortPullRebase(const QString &workingDir); bool tryLauchingGitK(const QProcessEnvironment &env, diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index 8c933a8ee4..42dd3afccf 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -61,9 +61,9 @@ namespace Git { namespace Internal { // ------------ GitEditor -GitEditor::GitEditor(const VCSBase::VCSBaseEditorParameters *type, +GitEditor::GitEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent) : - VCSBase::VCSBaseEditorWidget(type, parent), + VcsBase::VcsBaseEditorWidget(type, parent), m_changeNumberPattern8(QLatin1String(CHANGE_PATTERN_8C)), m_changeNumberPattern40(QLatin1String(CHANGE_PATTERN_40C)) { @@ -110,13 +110,13 @@ QString GitEditor::changeUnderCursor(const QTextCursor &c) const return QString(); } -VCSBase::DiffHighlighter *GitEditor::createDiffHighlighter() const +VcsBase::DiffHighlighter *GitEditor::createDiffHighlighter() const { const QRegExp filePattern(QLatin1String("^(diff --git a/|index |[+-][+-][+-] [ab]).*$")); - return new VCSBase::DiffHighlighter(filePattern); + return new VcsBase::DiffHighlighter(filePattern); } -VCSBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *GitEditor::createAnnotationHighlighter(const QSet<QString> &changes) const { return new GitAnnotationHighlighter(changes); } @@ -196,7 +196,7 @@ void GitEditor::setPlainTextDataFiltered(const QByteArray &a) { QByteArray array = a; // If desired, filter out the date from annotation - const bool omitAnnotationDate = contentType() == VCSBase::AnnotateOutput + const bool omitAnnotationDate = contentType() == VcsBase::AnnotateOutput && GitPlugin::instance()->settings().boolValue(GitSettings::omitAnnotationDateKey); if (omitAnnotationDate) array = removeAnnotationDate(a); @@ -222,13 +222,13 @@ QStringList GitEditor::annotationPreviousVersions(const QString &revision) const // Get the SHA1's of the file. if (!client->synchronousParentRevisions(workingDirectory, QStringList(fi.fileName()), revision, &revisions, &errorMessage)) { - VCSBase::VCSBaseOutputWindow::instance()->appendSilently(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendSilently(errorMessage); return QStringList(); } // Format verbose, SHA1 being first token QStringList descriptions; if (!client->synchronousShortDescriptions(workingDirectory, revisions, &descriptions, &errorMessage)) { - VCSBase::VCSBaseOutputWindow::instance()->appendSilently(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendSilently(errorMessage); return QStringList(); } return descriptions; diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h index 8a39a45b46..e29c74b30f 100644 --- a/src/plugins/git/giteditor.h +++ b/src/plugins/git/giteditor.h @@ -44,12 +44,12 @@ QT_END_NAMESPACE namespace Git { namespace Internal { -class GitEditor : public VCSBase::VCSBaseEditorWidget +class GitEditor : public VcsBase::VcsBaseEditorWidget { Q_OBJECT public: - explicit GitEditor(const VCSBase::VCSBaseEditorParameters *type, + explicit GitEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent); public slots: @@ -60,8 +60,8 @@ public slots: private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &) const; - virtual VCSBase::DiffHighlighter *createDiffHighlighter() const; - virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; virtual QStringList annotationPreviousVersions(const QString &revision) const; diff --git a/src/plugins/git/gitorious/gitoriousclonewizard.cpp b/src/plugins/git/gitorious/gitoriousclonewizard.cpp index 6685dae76d..e49d7e29ac 100644 --- a/src/plugins/git/gitorious/gitoriousclonewizard.cpp +++ b/src/plugins/git/gitorious/gitoriousclonewizard.cpp @@ -75,9 +75,9 @@ void GitoriousCloneWizardPage::initializePage() // -------- GitoriousCloneWizard GitoriousCloneWizard::GitoriousCloneWizard(QObject *parent) : - VCSBase::BaseCheckoutWizard(parent) + VcsBase::BaseCheckoutWizard(parent) { - setId(QLatin1String(VCSBase::Constants::VCS_ID_GIT)); + setId(QLatin1String(VcsBase::Constants::VCS_ID_GIT)); } QIcon GitoriousCloneWizard::icon() const @@ -100,7 +100,7 @@ QList<QWizardPage*> GitoriousCloneWizard::createParameterPages(const QString &pa QList<QWizardPage*> rc; const Core::IVersionControl *vc = Git::Internal::GitPlugin::instance()->versionControl(); if (!vc->isConfigured()) - rc.append(new VCSBase::VcsConfigurationPage(vc)); + rc.append(new VcsBase::VcsConfigurationPage(vc)); GitoriousHostWizardPage *hostPage = new GitoriousHostWizardPage; GitoriousProjectWizardPage *projectPage = new GitoriousProjectWizardPage(hostPage); @@ -112,11 +112,11 @@ QList<QWizardPage*> GitoriousCloneWizard::createParameterPages(const QString &pa return rc; } -QSharedPointer<VCSBase::AbstractCheckoutJob> GitoriousCloneWizard::createJob(const QList<QWizardPage*> ¶meterPages, +QSharedPointer<VcsBase::AbstractCheckoutJob> GitoriousCloneWizard::createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath) { const Git::CloneWizardPage *cwp = qobject_cast<const Git::CloneWizardPage *>(parameterPages.back()); - QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>()) + QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>()) return cwp->createCheckoutJob(checkoutPath); } diff --git a/src/plugins/git/gitorious/gitoriousclonewizard.h b/src/plugins/git/gitorious/gitoriousclonewizard.h index c46a034f4e..47cc373618 100644 --- a/src/plugins/git/gitorious/gitoriousclonewizard.h +++ b/src/plugins/git/gitorious/gitoriousclonewizard.h @@ -40,7 +40,7 @@ namespace Internal { // GitoriousCloneWizard: A wizard allowing for browsing // Gitorious-hosted projects. -class GitoriousCloneWizard : public VCSBase::BaseCheckoutWizard +class GitoriousCloneWizard : public VcsBase::BaseCheckoutWizard { Q_OBJECT public: @@ -54,7 +54,7 @@ public: protected: // BaseCheckoutWizard virtual QList<QWizardPage*> createParameterPages(const QString &path); - virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages, + virtual QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath); }; diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 58b05c8571..c9d5f70d8a 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -82,27 +82,27 @@ #include <QtGui/QMenu> #include <QtGui/QMessageBox> -static const VCSBase::VCSBaseEditorParameters editorParameters[] = { +static const VcsBase::VcsBaseEditorParameters editorParameters[] = { { - VCSBase::RegularCommandOutput, + VcsBase::RegularCommandOutput, Git::Constants::GIT_COMMAND_LOG_EDITOR_ID, Git::Constants::GIT_COMMAND_LOG_EDITOR_DISPLAY_NAME, Git::Constants::C_GIT_COMMAND_LOG_EDITOR, "application/vnd.nokia.text.scs_git_commandlog", "gitlog"}, -{ VCSBase::LogOutput, +{ VcsBase::LogOutput, Git::Constants::GIT_LOG_EDITOR_ID, Git::Constants::GIT_LOG_EDITOR_DISPLAY_NAME, Git::Constants::C_GIT_LOG_EDITOR, "application/vnd.nokia.text.scs_git_filelog", "gitfilelog"}, -{ VCSBase::AnnotateOutput, +{ VcsBase::AnnotateOutput, Git::Constants::GIT_BLAME_EDITOR_ID, Git::Constants::GIT_BLAME_EDITOR_DISPLAY_NAME, Git::Constants::C_GIT_BLAME_EDITOR, "application/vnd.nokia.text.scs_git_annotation", "gitsannotate"}, -{ VCSBase::DiffOutput, +{ VcsBase::DiffOutput, Git::Constants::GIT_DIFF_EDITOR_ID, Git::Constants::GIT_DIFF_EDITOR_DISPLAY_NAME, Git::Constants::C_GIT_DIFF_EDITOR, @@ -110,10 +110,10 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = { }; // Utility to find a parameter set by type -static inline const VCSBase::VCSBaseEditorParameters *findType(int ie) +static inline const VcsBase::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 VcsBase::EditorContentType et = static_cast<VcsBase::EditorContentType>(ie); + return VcsBase::VcsBaseEditorWidget::findType(editorParameters, sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters), et); } Q_DECLARE_METATYPE(Git::Internal::GitClientMemberFunc) @@ -126,7 +126,7 @@ using namespace Git::Internal; GitPlugin *GitPlugin::m_instance = 0; GitPlugin::GitPlugin() : - VCSBase::VCSBasePlugin(QLatin1String(Git::Constants::GITSUBMITEDITOR_ID)), + VcsBase::VcsBasePlugin(QLatin1String(Git::Constants::GITSUBMITEDITOR_ID)), m_core(0), m_commandLocator(0), m_showAction(0), @@ -173,7 +173,7 @@ GitPlugin *GitPlugin::instance() return m_instance; } -static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { +static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = { Git::Constants::SUBMIT_MIMETYPE, Git::Constants::GITSUBMITEDITOR_ID, Git::Constants::GITSUBMITEDITOR_DISPLAY_NAME, @@ -286,8 +286,8 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_gitClient = new GitClient(&m_settings); - typedef VCSBase::VCSEditorFactory<GitEditor> GitEditorFactory; - typedef VCSBase::VCSSubmitEditorFactory<GitSubmitEditor> GitSubmitEditorFactory; + typedef VcsBase::VcsEditorFactory<GitEditor> GitEditorFactory; + typedef VcsBase::VcsSubmitEditorFactory<GitSubmitEditor> GitSubmitEditorFactory; initializeVcs(new GitVersionControl(m_gitClient)); @@ -298,7 +298,7 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) addAutoReleasedObject(new SettingsPage()); static const char *describeSlot = SLOT(show(QString,QString)); - const int editorCount = sizeof(editorParameters)/sizeof(VCSBase::VCSBaseEditorParameters); + const int editorCount = sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters); for (int i = 0; i < editorCount; i++) addAutoReleasedObject(new GitEditorFactory(editorParameters + i, m_gitClient, describeSlot)); @@ -549,12 +549,12 @@ bool GitPlugin::initialize(const QStringList &arguments, QString *errorMessage) // Submit editor Core::Context submitContext(Constants::C_GITSUBMITEDITOR); - m_submitCurrentAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this); + m_submitCurrentAction = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this); Core::Command *command = actionManager->registerAction(m_submitCurrentAction, Constants::SUBMIT_CURRENT, submitContext); command->setAttribute(Core::Command::CA_UpdateText); connect(m_submitCurrentAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog())); - m_diffSelectedFilesAction = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); + m_diffSelectedFilesAction = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); command = actionManager->registerAction(m_diffSelectedFilesAction, Constants::DIFF_SELECTED, submitContext); m_undoAction = new QAction(tr("&Undo"), this); @@ -578,50 +578,50 @@ void GitPlugin::submitEditorDiff(const QStringList &unstaged, const QStringList void GitPlugin::diffCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_gitClient->diff(state.currentFileTopLevel(), QStringList(), state.relativeCurrentFile()); } void GitPlugin::diffCurrentProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) m_gitClient->diff(state.currentProjectTopLevel(), QStringList(), state.relativeCurrentProject()); } void GitPlugin::diffRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) m_gitClient->diff(state.topLevel(), QStringList(), QStringList()); } void GitPlugin::logFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_gitClient->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true); } void GitPlugin::blameFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) - const int lineNumber = VCSBase::VCSBaseEditorWidget::lineNumberOfCurrentEditor(state.currentFile()); + const int lineNumber = VcsBase::VcsBaseEditorWidget::lineNumberOfCurrentEditor(state.currentFile()); m_gitClient->blame(state.currentFileTopLevel(), QStringList(), state.relativeCurrentFile(), QString(), lineNumber); } void GitPlugin::logProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) m_gitClient->log(state.currentProjectTopLevel(), state.relativeCurrentProject()); } void GitPlugin::undoFileChanges(bool revertStaging) { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) Core::FileChangeBlocker fcb(state.currentFile()); m_gitClient->revert(QStringList(state.currentFile()), revertStaging); @@ -634,7 +634,7 @@ void GitPlugin::undoUnstagedFileChanges() void GitPlugin::undoRepositoryChanges() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) const QString msg = tr("Undo all pending changes to the repository\n%1?").arg(QDir::toNativeSeparators(state.topLevel())); const QMessageBox::StandardButton answer @@ -649,14 +649,14 @@ void GitPlugin::undoRepositoryChanges() void GitPlugin::stageFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_gitClient->addFile(state.currentFileTopLevel(), state.relativeCurrentFile()); } void GitPlugin::unstageFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_gitClient->synchronousReset(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } @@ -673,20 +673,20 @@ void GitPlugin::startCommit() void GitPlugin::startCommit(bool amend) { - if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor()) + if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor()) return; if (isCommitEditorOpen()) { - VCSBase::VCSBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently being executed.")); + VcsBase::VcsBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently being executed.")); return; } - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) QString errorMessage, commitTemplate; CommitData data; if (!m_gitClient->getCommitData(state.topLevel(), amend, &commitTemplate, &data, &errorMessage)) { - VCSBase::VCSBaseOutputWindow::instance()->append(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->append(errorMessage); return; } @@ -701,7 +701,7 @@ void GitPlugin::startCommit(bool amend) saver.setAutoRemove(false); saver.write(commitTemplate.toLocal8Bit()); if (!saver.finalize()) { - VCSBase::VCSBaseOutputWindow::instance()->append(saver.errorString()); + VcsBase::VcsBaseOutputWindow::instance()->append(saver.errorString()); return; } m_commitMessageFileName = saver.fileName(); @@ -736,7 +736,7 @@ void GitPlugin::submitCurrentLog() m_core->editorManager()->closeEditors(editors); } -bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor) +bool GitPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) { if (!isCommitEditorOpen()) return false; @@ -754,16 +754,16 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi // Prompt user. Force a prompt unless submit was actually invoked (that // is, the editor was closed or shutdown). bool *promptData = m_settings.boolPointer(GitSettings::promptOnSubmitKey); - const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer = + const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer = editor->promptSubmit(tr("Closing Git Editor"), tr("Do you want to commit the change?"), tr("Git will not accept this commit. Do you want to continue to edit it?"), promptData, !m_submitActionTriggered, false); m_submitActionTriggered = false; switch (answer) { - case VCSBase::VCSBaseSubmitEditor::SubmitCanceled: + case VcsBase::VcsBaseSubmitEditor::SubmitCanceled: return false; // Keep editing and change file - case VCSBase::VCSBaseSubmitEditor::SubmitDiscarded: + case VcsBase::VcsBaseSubmitEditor::SubmitDiscarded: cleanCommitMessageFile(); return true; // Cancel all default: @@ -772,7 +772,7 @@ bool GitPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEdi // Go ahead! - VCSBase::SubmitFileModel *model = qobject_cast<VCSBase::SubmitFileModel *>(editor->fileModel()); + VcsBase::SubmitFileModel *model = qobject_cast<VcsBase::SubmitFileModel *>(editor->fileModel()); bool closeEditor = true; if (model->hasCheckedFiles() || !m_commitAmendSHA1.isEmpty()) { // get message & commit @@ -794,7 +794,7 @@ void GitPlugin::fetch() void GitPlugin::pull() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) switch (m_gitClient->ensureStash(state.topLevel())) { @@ -809,7 +809,7 @@ void GitPlugin::pull() void GitPlugin::push() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) m_gitClient->synchronousPush(state.topLevel()); } @@ -829,7 +829,7 @@ static inline GitClientMemberFunc memberFunctionFromAction(const QObject *o) void GitPlugin::gitClientMemberFuncRepositoryAction() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) // Retrieve member function and invoke on repository GitClientMemberFunc func = memberFunctionFromAction(sender()); @@ -839,14 +839,14 @@ void GitPlugin::gitClientMemberFuncRepositoryAction() void GitPlugin::cleanProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) cleanRepository(state.currentProjectPath()); } void GitPlugin::cleanRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); cleanRepository(state.topLevel()); } @@ -879,7 +879,7 @@ void GitPlugin::cleanRepository(const QString &directory) it->truncate(it->size() - 1); // Show in dialog - VCSBase::CleanDialog dialog(parent); + VcsBase::CleanDialog dialog(parent); dialog.setFileList(directory, files); dialog.exec(); } @@ -903,7 +903,7 @@ static bool ensureFileSaved(const QString &fileName) void GitPlugin::applyCurrentFilePatch() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasPatchFile() && state.hasTopLevel(), return); const QString patchFile = state.currentPatchFile(); if (!ensureFileSaved(patchFile)) @@ -913,7 +913,7 @@ void GitPlugin::applyCurrentFilePatch() void GitPlugin::promptApplyPatch() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); applyPatch(state.topLevel(), QString()); } @@ -939,7 +939,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file) return; } // Run! - VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance(); QString errorMessage; if (m_gitClient->synchronousApplyPatch(workingDirectory, file, &errorMessage)) { if (errorMessage.isEmpty()) { @@ -955,7 +955,7 @@ void GitPlugin::applyPatch(const QString &workingDirectory, QString file) void GitPlugin::stash() { // Simple stash without prompt, reset repo. - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) const QString id = m_gitClient->synchronousStash(state.topLevel(), QString(), 0); if (!id.isEmpty() && m_stashDialog) @@ -965,7 +965,7 @@ void GitPlugin::stash() void GitPlugin::stashSnapshot() { // Prompt for description, restore immediately and keep on working. - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) const QString id = m_gitClient->synchronousStash(state.topLevel(), QString(), GitClient::StashImmediateRestore|GitClient::StashPromptDescription); if (!id.isEmpty() && m_stashDialog) @@ -1002,7 +1002,7 @@ void GitPlugin::stashList() showNonModalDialog(currentState().topLevel(), m_stashDialog); } -void GitPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) +void GitPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { const bool repositoryEnabled = currentState().hasTopLevel(); if (m_stashDialog) @@ -1036,7 +1036,7 @@ void GitPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) void GitPlugin::showCommit() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); if (!m_changeSelectionDialog) m_changeSelectionDialog = new ChangeSelectionDialog(); diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index b6c473d56a..4fe94546b3 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -84,7 +84,7 @@ typedef void (GitClient::*GitClientMemberFunc)(const QString &); typedef QPair<QAction *, Core::Command* > ActionCommandPair; typedef QPair<Utils::ParameterAction *, Core::Command* > ParameterActionCommandPair; -class GitPlugin : public VCSBase::VCSBasePlugin +class GitPlugin : public VcsBase::VcsBasePlugin { Q_OBJECT @@ -136,8 +136,8 @@ private slots: void push(); protected: - virtual void updateActions(VCSBase::VCSBasePlugin::ActionState); - virtual bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor); + virtual void updateActions(VcsBase::VcsBasePlugin::ActionState); + virtual bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor); private: inline ParameterActionCommandPair diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index ccf1e4ac28..296783d030 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -105,7 +105,7 @@ QString GitSettings::gitBinaryPath(bool *ok, QString *errorMessage) const GitSettings &GitSettings::operator = (const GitSettings &s) { - VCSBaseClientSettings::operator =(s); + VcsBaseClientSettings::operator =(s); m_binaryPath.clear(); return *this; } diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index d5956c2fcb..12c62d0f72 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -41,7 +41,7 @@ namespace Git { namespace Internal { // Todo: Add user name and password? -class GitSettings : public VCSBase::VCSBaseClientSettings +class GitSettings : public VcsBase::VcsBaseClientSettings { public: GitSettings(); diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index 3924c59179..71d662c2de 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -49,8 +49,8 @@ namespace Internal { * option for staged files. So, we sort apart the diff file lists * according to a type flag we add to the model. */ -GitSubmitEditor::GitSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent) : - VCSBaseSubmitEditor(parameters, new GitSubmitEditorWidget(parent)), +GitSubmitEditor::GitSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent) : + VcsBaseSubmitEditor(parameters, new GitSubmitEditorWidget(parent)), m_model(0) { connect(this, SIGNAL(diffSelectedFiles(QStringList)), this, SLOT(slotDiffSelected(QStringList))); @@ -68,7 +68,7 @@ void GitSubmitEditor::setCommitData(const CommitData &d) m_commitEncoding = d.commitEncoding; - m_model = new VCSBase::SubmitFileModel(this); + m_model = new VcsBase::SubmitFileModel(this); if (!d.files.isEmpty()) { for (QList<CommitData::StateFilePair>::const_iterator it = d.files.constBegin(); it != d.files.constEnd(); ++it) { diff --git a/src/plugins/git/gitsubmiteditor.h b/src/plugins/git/gitsubmiteditor.h index 9839a4d7bf..56cb18877c 100644 --- a/src/plugins/git/gitsubmiteditor.h +++ b/src/plugins/git/gitsubmiteditor.h @@ -37,7 +37,7 @@ #include <QtCore/QStringList> -namespace VCSBase { +namespace VcsBase { class SubmitFileModel; } @@ -48,11 +48,11 @@ class GitSubmitEditorWidget; class CommitData; struct GitSubmitEditorPanelData; -class GitSubmitEditor : public VCSBase::VCSBaseSubmitEditor +class GitSubmitEditor : public VcsBase::VcsBaseSubmitEditor { Q_OBJECT public: - explicit GitSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent); + explicit GitSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent); void setCommitData(const CommitData &); GitSubmitEditorPanelData panelData() const; @@ -69,7 +69,7 @@ private slots: private: inline GitSubmitEditorWidget *submitEditorWidget(); - VCSBase::SubmitFileModel *m_model; + VcsBase::SubmitFileModel *m_model; QString m_commitEncoding; }; diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index d0a050dae7..284b1e6129 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -59,7 +59,7 @@ QString GitVersionControl::displayName() const QString GitVersionControl::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_GIT); + return QLatin1String(VcsBase::Constants::VCS_ID_GIT); } bool GitVersionControl::isConfigured() const diff --git a/src/plugins/git/remotedialog.cpp b/src/plugins/git/remotedialog.cpp index 9dba3bd746..fd833dc82f 100644 --- a/src/plugins/git/remotedialog.cpp +++ b/src/plugins/git/remotedialog.cpp @@ -133,7 +133,7 @@ void RemoteDialog::refresh(const QString &repository, bool force) } else { QString errorMessage; if (!m_remoteModel->refresh(m_repository, &errorMessage)) - VCSBase::VCSBaseOutputWindow::instance()->appendError(errorMessage); + VcsBase::VcsBaseOutputWindow::instance()->appendError(errorMessage); } } diff --git a/src/plugins/git/settingspage.cpp b/src/plugins/git/settingspage.cpp index b2e5bb1820..93f8e9c1dd 100644 --- a/src/plugins/git/settingspage.cpp +++ b/src/plugins/git/settingspage.cpp @@ -128,7 +128,7 @@ SettingsPage::SettingsPage() : QString SettingsPage::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_GIT); + return QLatin1String(VcsBase::Constants::VCS_ID_GIT); } QString SettingsPage::displayName() const diff --git a/src/plugins/git/settingspage.h b/src/plugins/git/settingspage.h index 4eeee51516..99239689d7 100644 --- a/src/plugins/git/settingspage.h +++ b/src/plugins/git/settingspage.h @@ -66,7 +66,7 @@ private: Ui::SettingsPage m_ui; }; -class SettingsPage : public VCSBase::VCSBaseOptionsPage +class SettingsPage : public VcsBase::VcsBaseOptionsPage { Q_OBJECT diff --git a/src/plugins/mercurial/annotationhighlighter.cpp b/src/plugins/mercurial/annotationhighlighter.cpp index a34db87fd2..84003f3785 100644 --- a/src/plugins/mercurial/annotationhighlighter.cpp +++ b/src/plugins/mercurial/annotationhighlighter.cpp @@ -38,7 +38,7 @@ using namespace Mercurial; MercurialAnnotationHighlighter::MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) - : VCSBase::BaseAnnotationHighlighter(changeNumbers, document), + : VcsBase::BaseAnnotationHighlighter(changeNumbers, document), changeset(QLatin1String(Constants::CHANGESETID12)) { } diff --git a/src/plugins/mercurial/annotationhighlighter.h b/src/plugins/mercurial/annotationhighlighter.h index 5649ed32a5..d6379ecfd1 100644 --- a/src/plugins/mercurial/annotationhighlighter.h +++ b/src/plugins/mercurial/annotationhighlighter.h @@ -39,7 +39,7 @@ namespace Mercurial { namespace Internal { -class MercurialAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter +class MercurialAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { public: explicit MercurialAnnotationHighlighter(const ChangeNumbers &changeNumbers, diff --git a/src/plugins/mercurial/clonewizard.cpp b/src/plugins/mercurial/clonewizard.cpp index f64c8e154a..9eeea4286a 100644 --- a/src/plugins/mercurial/clonewizard.cpp +++ b/src/plugins/mercurial/clonewizard.cpp @@ -43,10 +43,10 @@ using namespace Mercurial::Internal; CloneWizard::CloneWizard(QObject *parent) - : VCSBase::BaseCheckoutWizard(parent), + : VcsBase::BaseCheckoutWizard(parent), m_icon(QIcon(QLatin1String(":/mercurial/images/hg.png"))) { - setId(QLatin1String(VCSBase::Constants::VCS_ID_MERCURIAL)); + setId(QLatin1String(VcsBase::Constants::VCS_ID_MERCURIAL)); } QIcon CloneWizard::icon() const @@ -69,20 +69,20 @@ QList<QWizardPage*> CloneWizard::createParameterPages(const QString &path) QList<QWizardPage*> wizardPageList; const Core::IVersionControl *vc = MercurialPlugin::instance()->versionControl(); if (!vc->isConfigured()) - wizardPageList.append(new VCSBase::VcsConfigurationPage(vc)); + wizardPageList.append(new VcsBase::VcsConfigurationPage(vc)); CloneWizardPage *page = new CloneWizardPage; page->setPath(path); wizardPageList.append(page); return wizardPageList; } -QSharedPointer<VCSBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage *> ¶meterPages, +QSharedPointer<VcsBase::AbstractCheckoutJob> CloneWizard::createJob(const QList<QWizardPage *> ¶meterPages, QString *checkoutPath) { const CloneWizardPage *page = qobject_cast<const CloneWizardPage *>(parameterPages.front()); if (!page) - return QSharedPointer<VCSBase::AbstractCheckoutJob>(); + return QSharedPointer<VcsBase::AbstractCheckoutJob>(); const MercurialSettings &settings = MercurialPlugin::instance()->settings(); @@ -92,7 +92,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; + VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob; job->addStep(settings.stringValue(MercurialSettings::binaryPathKey), args, path); - return QSharedPointer<VCSBase::AbstractCheckoutJob>(job); + return QSharedPointer<VcsBase::AbstractCheckoutJob>(job); } diff --git a/src/plugins/mercurial/clonewizard.h b/src/plugins/mercurial/clonewizard.h index 207758b09c..eea2b38196 100644 --- a/src/plugins/mercurial/clonewizard.h +++ b/src/plugins/mercurial/clonewizard.h @@ -40,7 +40,7 @@ namespace Mercurial { namespace Internal { -class CloneWizard : public VCSBase::BaseCheckoutWizard +class CloneWizard : public VcsBase::BaseCheckoutWizard { Q_OBJECT public: @@ -52,7 +52,7 @@ public: protected: QList<QWizardPage *> createParameterPages(const QString &path); - QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage *> ¶meterPages, + QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage *> ¶meterPages, QString *checkoutPath); private: diff --git a/src/plugins/mercurial/clonewizardpage.cpp b/src/plugins/mercurial/clonewizardpage.cpp index fc5c9d24c7..33336b853d 100644 --- a/src/plugins/mercurial/clonewizardpage.cpp +++ b/src/plugins/mercurial/clonewizardpage.cpp @@ -35,7 +35,7 @@ using namespace Mercurial::Internal; CloneWizardPage::CloneWizardPage(QWidget *parent) - : VCSBase::BaseCheckoutWizardPage(parent) + : VcsBase::BaseCheckoutWizardPage(parent) { setTitle(tr("Location")); setSubTitle(tr("Specify repository URL, checkout directory and path.")); diff --git a/src/plugins/mercurial/clonewizardpage.h b/src/plugins/mercurial/clonewizardpage.h index 287018551b..38df162d01 100644 --- a/src/plugins/mercurial/clonewizardpage.h +++ b/src/plugins/mercurial/clonewizardpage.h @@ -38,7 +38,7 @@ namespace Mercurial { namespace Internal { -class CloneWizardPage : public VCSBase::BaseCheckoutWizardPage +class CloneWizardPage : public VcsBase::BaseCheckoutWizardPage { Q_OBJECT public: diff --git a/src/plugins/mercurial/commiteditor.cpp b/src/plugins/mercurial/commiteditor.cpp index 5b1e975aa3..1c191ee03c 100644 --- a/src/plugins/mercurial/commiteditor.cpp +++ b/src/plugins/mercurial/commiteditor.cpp @@ -41,8 +41,8 @@ using namespace Mercurial::Internal; -CommitEditor::CommitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent) - : VCSBase::VCSBaseSubmitEditor(parameters, new MercurialCommitWidget(parent)), +CommitEditor::CommitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent) + : VcsBase::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<VcsBase::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 VcsBase::SubmitFileModel(this); //TODO Messy tidy this up QStringList shouldTrack; - foreach (const VCSBase::VCSBaseClient::StatusItem &item, repoStatus) { + foreach (const VcsBase::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(), + VcsBase::VcsBaseSubmitEditor::filterUntrackedFilesOfProject(repositoryRoot.absoluteFilePath(), &shouldTrack); foreach (const QString &track, shouldTrack) { - foreach (const VCSBase::VCSBaseClient::StatusItem &item, repoStatus) { + foreach (const VcsBase::VcsBaseClient::StatusItem &item, repoStatus) { if (item.file == track) fileModel->addFile(item.file, item.flags, false); } diff --git a/src/plugins/mercurial/commiteditor.h b/src/plugins/mercurial/commiteditor.h index e9e5921968..ea9a8a24cc 100644 --- a/src/plugins/mercurial/commiteditor.h +++ b/src/plugins/mercurial/commiteditor.h @@ -38,7 +38,7 @@ #include <QtCore/QFileInfo> -namespace VCSBase { +namespace VcsBase { class SubmitFileModel; } @@ -47,16 +47,16 @@ namespace Internal { class MercurialCommitWidget; -class CommitEditor : public VCSBase::VCSBaseSubmitEditor +class CommitEditor : public VcsBase::VcsBaseSubmitEditor { Q_OBJECT public: - explicit CommitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, + explicit CommitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent); void setFields(const QFileInfo &repositoryRoot, const QString &branch, const QString &userName, const QString &email, - const QList<VCSBase::VCSBaseClient::StatusItem> &repoStatus); + const QList<VcsBase::VcsBaseClient::StatusItem> &repoStatus); QString committerInfo(); QString repoRoot(); @@ -64,7 +64,7 @@ public: private: inline MercurialCommitWidget *commitWidget(); - VCSBase::SubmitFileModel *fileModel; + VcsBase::SubmitFileModel *fileModel; }; diff --git a/src/plugins/mercurial/mercurialclient.cpp b/src/plugins/mercurial/mercurialclient.cpp index e3da6a7a51..fc1dd9bfda 100644 --- a/src/plugins/mercurial/mercurialclient.cpp +++ b/src/plugins/mercurial/mercurialclient.cpp @@ -52,13 +52,13 @@ namespace Mercurial { namespace Internal { MercurialClient::MercurialClient(MercurialSettings *settings) : - VCSBase::VCSBaseClient(settings) + VcsBase::VcsBaseClient(settings) { } MercurialSettings *MercurialClient::settings() const { - return dynamic_cast<MercurialSettings *>(VCSBase::VCSBaseClient::settings()); + return dynamic_cast<MercurialSettings *>(VcsBase::VcsBaseClient::settings()); } bool MercurialClient::manifestSync(const QString &repository, const QString &relativeFilename) @@ -90,9 +90,9 @@ bool MercurialClient::synchronousClone(const QString &workingDir, Q_UNUSED(extraOptions); QDir workingDirectory(srcLocation); QByteArray output; - const unsigned flags = VCSBase::VCSBasePlugin::SshPasswordPrompt | - VCSBase::VCSBasePlugin::ShowStdOutInLogWindow | - VCSBase::VCSBasePlugin::ShowSuccessMessage; + const unsigned flags = VcsBase::VcsBasePlugin::SshPasswordPrompt | + VcsBase::VcsBasePlugin::ShowStdOutInLogWindow | + VcsBase::VcsBasePlugin::ShowSuccessMessage; if (workingDirectory.exists()) { // Let's make first init @@ -114,7 +114,7 @@ bool MercurialClient::synchronousClone(const QString &workingDir, Utils::FileSaver saver(workingDirectory.path()+"/.hg/hgrc"); saver.write(QString("[paths]\ndefault = %1\n").arg(dstLocation).toUtf8()); if (!saver.finalize()) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(saver.errorString()); + VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString()); return false; } @@ -176,7 +176,7 @@ changeset: 0:031a48610fba user: ... \endcode */ // Obtain first line and split by blank-delimited tokens - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); const QStringList lines = output.split(QLatin1Char('\n')); if (lines.size() < 1) { outputWindow->appendSilently(msgParentRevisionFailed(workingDirectory, revision, msgParseParentsOutputFailed(output))); @@ -275,10 +275,10 @@ void MercurialClient::incoming(const QString &repositoryRoot, const QString &rep const QString kind = QLatin1String(Constants::DIFFLOG); const QString title = tr("Hg incoming %1").arg(id); - VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, repositoryRoot, + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, repositoryRoot, true, "incoming", id); - VCSBase::Command *cmd = createCommand(repository, editor); - if (!repository.isEmpty() && VCSBase::VCSBasePlugin::isSshPromptConfigured()) + VcsBase::Command *cmd = createCommand(repository, editor); + if (!repository.isEmpty() && VcsBase::VcsBasePlugin::isSshPromptConfigured()) cmd->setUnixTerminalDisabled(true); enqueueJob(cmd, args); } @@ -292,11 +292,11 @@ void MercurialClient::outgoing(const QString &repositoryRoot) const QString title = tr("Hg outgoing %1"). arg(QDir::toNativeSeparators(repositoryRoot)); - VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, repositoryRoot, true, + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, repositoryRoot, true, "outgoing", repositoryRoot); - VCSBase::Command *cmd = createCommand(repositoryRoot, editor); - cmd->setUnixTerminalDisabled(VCSBase::VCSBasePlugin::isSshPromptConfigured()); + VcsBase::Command *cmd = createCommand(repositoryRoot, editor); + cmd->setUnixTerminalDisabled(VcsBase::VcsBasePlugin::isSshPromptConfigured()); enqueueJob(cmd, args); } @@ -306,7 +306,7 @@ void MercurialClient::annotate(const QString &workingDir, const QString &file, { QStringList args(extraOptions); args << QLatin1String("-u") << QLatin1String("-c") << QLatin1String("-d"); - VCSBaseClient::annotate(workingDir, file, revision, lineNumber, args); + VcsBaseClient::annotate(workingDir, file, revision, lineNumber, args); } void MercurialClient::commit(const QString &repositoryRoot, const QStringList &files, @@ -315,7 +315,7 @@ void MercurialClient::commit(const QString &repositoryRoot, const QStringList &f { QStringList args(extraOptions); args << QLatin1String("--noninteractive") << QLatin1String("-l") << commitMessageFile << QLatin1String("-A"); - VCSBaseClient::commit(repositoryRoot, files, commitMessageFile, args); + VcsBaseClient::commit(repositoryRoot, files, commitMessageFile, args); } void MercurialClient::diff(const QString &workingDir, const QStringList &files, @@ -323,20 +323,20 @@ void MercurialClient::diff(const QString &workingDir, const QStringList &files, { QStringList args(extraOptions); args << QLatin1String("-g") << QLatin1String("-p") << QLatin1String("-U 8"); - VCSBaseClient::diff(workingDir, files, args); + VcsBaseClient::diff(workingDir, files, args); } void MercurialClient::import(const QString &repositoryRoot, const QStringList &files, const QStringList &extraOptions) { - VCSBaseClient::import(repositoryRoot, files, + VcsBaseClient::import(repositoryRoot, files, QStringList(extraOptions) << QLatin1String("--no-commit")); } void MercurialClient::revertAll(const QString &workingDir, const QString &revision, const QStringList &extraOptions) { - VCSBaseClient::revertAll(workingDir, revision, + VcsBaseClient::revertAll(workingDir, revision, QStringList(extraOptions) << QLatin1String("--all")); } @@ -345,18 +345,18 @@ void MercurialClient::view(const QString &source, const QString &id, { QStringList args; args << QLatin1String("log") << QLatin1String("-p") << QLatin1String("-g"); - VCSBaseClient::view(source, id, args << extraOptions); + VcsBaseClient::view(source, id, args << extraOptions); } QString MercurialClient::findTopLevelForFile(const QFileInfo &file) const { const QString repositoryCheckFile = QLatin1String(Constants::MECURIALREPO) + QLatin1String("/requires"); return file.isDir() ? - VCSBase::VCSBasePlugin::findRepositoryForDirectory(file.absoluteFilePath(), repositoryCheckFile) : - VCSBase::VCSBasePlugin::findRepositoryForDirectory(file.absolutePath(), repositoryCheckFile); + VcsBase::VcsBasePlugin::findRepositoryForDirectory(file.absoluteFilePath(), repositoryCheckFile) : + VcsBase::VcsBasePlugin::findRepositoryForDirectory(file.absolutePath(), repositoryCheckFile); } -QString MercurialClient::vcsEditorKind(VCSCommand cmd) const +QString MercurialClient::vcsEditorKind(VcsCommand cmd) const { switch (cmd) { @@ -411,13 +411,13 @@ struct MercurialDiffParameters }; // Parameter widget controlling whitespace diff mode, associated with a parameter -class MercurialDiffParameterWidget : public VCSBase::VCSBaseEditorParameterWidget +class MercurialDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT public: MercurialDiffParameterWidget(MercurialClient *client, const MercurialDiffParameters &p, QWidget *parent = 0) : - VCSBase::VCSBaseEditorParameterWidget(parent), m_client(client), m_params(p) + VcsBase::VcsBaseEditorParameterWidget(parent), m_client(client), m_params(p) { mapSetting(addToggleButton(QLatin1String("-w"), tr("Ignore whitespace")), client->settings()->boolPointer(MercurialSettings::diffIgnoreWhiteSpaceKey)); @@ -435,7 +435,7 @@ private: const MercurialDiffParameters m_params; }; -VCSBase::VCSBaseEditorParameterWidget *MercurialClient::createDiffEditor( +VcsBase::VcsBaseEditorParameterWidget *MercurialClient::createDiffEditor( const QString &workingDir, const QStringList &files, const QStringList &extraOptions) { MercurialDiffParameters parameters; diff --git a/src/plugins/mercurial/mercurialclient.h b/src/plugins/mercurial/mercurialclient.h index c3c51f0fec..9cd6e798a4 100644 --- a/src/plugins/mercurial/mercurialclient.h +++ b/src/plugins/mercurial/mercurialclient.h @@ -40,7 +40,7 @@ namespace Mercurial { namespace Internal { struct MercurialDiffParameters; -class MercurialClient : public VCSBase::VCSBaseClient +class MercurialClient : public VcsBase::VcsBaseClient { Q_OBJECT public: @@ -87,9 +87,9 @@ public: QString findTopLevelForFile(const QFileInfo &file) const; protected: - QString vcsEditorKind(VCSCommand cmd) const; + QString vcsEditorKind(VcsCommand cmd) const; QStringList revisionSpec(const QString &revision) const; - VCSBase::VCSBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, + VcsBase::VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, const QStringList &files, const QStringList &extraOptions); StatusItem parseStatusLine(const QString &line) const; diff --git a/src/plugins/mercurial/mercurialcontrol.cpp b/src/plugins/mercurial/mercurialcontrol.cpp index b778256bf0..7129adb82a 100644 --- a/src/plugins/mercurial/mercurialcontrol.cpp +++ b/src/plugins/mercurial/mercurialcontrol.cpp @@ -55,7 +55,7 @@ QString MercurialControl::displayName() const QString MercurialControl::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_MERCURIAL); + return QLatin1String(VcsBase::Constants::VCS_ID_MERCURIAL); } bool MercurialControl::managesDirectory(const QString &directory, QString *topLevel) const diff --git a/src/plugins/mercurial/mercurialeditor.cpp b/src/plugins/mercurial/mercurialeditor.cpp index 1ebd9afa15..9d927d3368 100644 --- a/src/plugins/mercurial/mercurialeditor.cpp +++ b/src/plugins/mercurial/mercurialeditor.cpp @@ -49,8 +49,8 @@ using namespace Mercurial::Internal; using namespace Mercurial; -MercurialEditor::MercurialEditor(const VCSBase::VCSBaseEditorParameters *type, QWidget *parent) - : VCSBase::VCSBaseEditorWidget(type, parent), +MercurialEditor::MercurialEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent) + : VcsBase::VcsBaseEditorWidget(type, parent), exactIdentifier12(QLatin1String(Constants::CHANGEIDEXACT12)), exactIdentifier40(QLatin1String(Constants::CHANGEIDEXACT40)), changesetIdentifier12(QLatin1String(Constants::CHANGESETID12)), @@ -91,12 +91,12 @@ QString MercurialEditor::changeUnderCursor(const QTextCursor &cursorIn) const return QString(); } -VCSBase::DiffHighlighter *MercurialEditor::createDiffHighlighter() const +VcsBase::DiffHighlighter *MercurialEditor::createDiffHighlighter() const { - return new VCSBase::DiffHighlighter(diffIdentifier); + return new VcsBase::DiffHighlighter(diffIdentifier); } -VCSBase::BaseAnnotationHighlighter *MercurialEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *MercurialEditor::createAnnotationHighlighter(const QSet<QString> &changes) const { return new MercurialAnnotationHighlighter(changes); } diff --git a/src/plugins/mercurial/mercurialeditor.h b/src/plugins/mercurial/mercurialeditor.h index 96eb3f0161..a2ac2ff32a 100644 --- a/src/plugins/mercurial/mercurialeditor.h +++ b/src/plugins/mercurial/mercurialeditor.h @@ -40,17 +40,17 @@ namespace Mercurial { namespace Internal { -class MercurialEditor : public VCSBase::VCSBaseEditorWidget +class MercurialEditor : public VcsBase::VcsBaseEditorWidget { Q_OBJECT public: - explicit MercurialEditor(const VCSBase::VCSBaseEditorParameters *type, QWidget *parent); + explicit MercurialEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent); private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &cursor) const; - virtual VCSBase::DiffHighlighter *createDiffHighlighter() const; - virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileSpec) const; virtual QStringList annotationPreviousVersions(const QString &revision) const; diff --git a/src/plugins/mercurial/mercurialplugin.cpp b/src/plugins/mercurial/mercurialplugin.cpp index cb26788363..5f4ff2e332 100644 --- a/src/plugins/mercurial/mercurialplugin.cpp +++ b/src/plugins/mercurial/mercurialplugin.cpp @@ -77,30 +77,30 @@ using namespace Mercurial::Internal; using namespace Mercurial; -static const VCSBase::VCSBaseEditorParameters editorParameters[] = { +static const VcsBase::VcsBaseEditorParameters editorParameters[] = { { - VCSBase::RegularCommandOutput, //type + VcsBase::RegularCommandOutput, //type Constants::COMMANDLOG_ID, // id Constants::COMMANDLOG_DISPLAY_NAME, // display name Constants::COMMANDLOG, // context Constants::COMMANDAPP, // mime type Constants::COMMANDEXT}, //extension -{ VCSBase::LogOutput, +{ VcsBase::LogOutput, Constants::FILELOG_ID, Constants::FILELOG_DISPLAY_NAME, Constants::FILELOG, Constants::LOGAPP, Constants::LOGEXT}, -{ VCSBase::AnnotateOutput, +{ VcsBase::AnnotateOutput, Constants::ANNOTATELOG_ID, Constants::ANNOTATELOG_DISPLAY_NAME, Constants::ANNOTATELOG, Constants::ANNOTATEAPP, Constants::ANNOTATEEXT}, -{ VCSBase::DiffOutput, +{ VcsBase::DiffOutput, Constants::DIFFLOG_ID, Constants::DIFFLOG_DISPLAY_NAME, Constants::DIFFLOG, @@ -108,7 +108,7 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = { Constants::DIFFEXT} }; -static const VCSBase::VCSBaseSubmitEditorParameters submitEditorParameters = { +static const VcsBase::VcsBaseSubmitEditorParameters submitEditorParameters = { Constants::COMMITMIMETYPE, Constants::COMMIT_ID, Constants::COMMIT_DISPLAY_NAME, @@ -116,17 +116,17 @@ static const VCSBase::VCSBaseSubmitEditorParameters submitEditorParameters = { }; // Utility to find a parameter set by type -static inline const VCSBase::VCSBaseEditorParameters *findType(int ie) +static inline const VcsBase::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 VcsBase::EditorContentType et = static_cast<VcsBase::EditorContentType>(ie); + return VcsBase::VcsBaseEditorWidget::findType(editorParameters, + sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters), et); } MercurialPlugin *MercurialPlugin::m_instance = 0; MercurialPlugin::MercurialPlugin() : - VCSBase::VCSBasePlugin(QLatin1String(Constants::COMMIT_ID)), + VcsBase::VcsBasePlugin(QLatin1String(Constants::COMMIT_ID)), optionsPage(0), m_client(0), core(0), @@ -154,7 +154,7 @@ MercurialPlugin::~MercurialPlugin() bool MercurialPlugin::initialize(const QStringList & /* arguments */, QString * /*errorMessage */) { - typedef VCSBase::VCSEditorFactory<MercurialEditor> MercurialEditorFactory; + typedef VcsBase::VcsEditorFactory<MercurialEditor> MercurialEditorFactory; m_client = new MercurialClient(&mercurialSettings); initializeVcs(new MercurialControl(m_client)); @@ -169,11 +169,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(VcsBase::VcsBaseEditorParameters); for (int i = 0; i < editorCount; i++) addAutoReleasedObject(new MercurialEditorFactory(editorParameters + i, m_client, describeSlot)); - addAutoReleasedObject(new VCSBase::VCSSubmitEditorFactory<CommitEditor>(&submitEditorParameters)); + addAutoReleasedObject(new VcsBase::VcsSubmitEditorFactory<CommitEditor>(&submitEditorParameters)); addAutoReleasedObject(new CloneWizard); @@ -287,28 +287,28 @@ void MercurialPlugin::createFileActions(const Core::Context &context) void MercurialPlugin::addCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_client->synchronousAdd(state.currentFileTopLevel(), state.relativeCurrentFile()); } void MercurialPlugin::annotateCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_client->annotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } void MercurialPlugin::diffCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::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 VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_client->log(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), QStringList(), true); @@ -316,7 +316,7 @@ void MercurialPlugin::logCurrentFile() void MercurialPlugin::revertCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) RevertDialog reverter; @@ -327,7 +327,7 @@ void MercurialPlugin::revertCurrentFile() void MercurialPlugin::statusCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) m_client->status(state.currentFileTopLevel(), state.relativeCurrentFile()); } @@ -369,21 +369,21 @@ void MercurialPlugin::createDirectoryActions(const Core::Context &context) void MercurialPlugin::diffRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) m_client->diff(state.topLevel()); } void MercurialPlugin::logRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) m_client->log(state.topLevel()); } void MercurialPlugin::revertMulti() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) RevertDialog reverter; @@ -394,7 +394,7 @@ void MercurialPlugin::revertMulti() void MercurialPlugin::statusMulti() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) m_client->status(state.topLevel()); @@ -460,7 +460,7 @@ void MercurialPlugin::createRepositoryActions(const Core::Context &context) void MercurialPlugin::pull() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) SrcDestDialog dialog; @@ -472,7 +472,7 @@ void MercurialPlugin::pull() void MercurialPlugin::push() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) SrcDestDialog dialog; @@ -484,7 +484,7 @@ void MercurialPlugin::push() void MercurialPlugin::update() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) RevertDialog updateDialog; @@ -496,7 +496,7 @@ void MercurialPlugin::update() void MercurialPlugin::import() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) QFileDialog importDialog; @@ -512,7 +512,7 @@ void MercurialPlugin::import() void MercurialPlugin::incoming() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) SrcDestDialog dialog; @@ -524,7 +524,7 @@ void MercurialPlugin::incoming() void MercurialPlugin::outgoing() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) m_client->outgoing(state.topLevel()); } @@ -534,12 +534,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(VcsBase::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(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); command = actionManager->registerAction(editorDiff, Core::Id(Constants::DIFFEDITOR), context); editorUndo = new QAction(tr("&Undo"), this); @@ -551,26 +551,26 @@ void MercurialPlugin::createSubmitEditorActions() void MercurialPlugin::commit() { - if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor()) + if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor()) return; - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::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<VcsBase::VcsBaseClient::StatusItem>)), + this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>))); m_client->emitParsedStatus(m_submitRepository); } -void MercurialPlugin::showCommitWidget(const QList<VCSBase::VCSBaseClient::StatusItem> &status) +void MercurialPlugin::showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status) { - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::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<VcsBase::VcsBaseClient::StatusItem>)), + this, SLOT(showCommitWidget(QList<VcsBase::VcsBaseClient::StatusItem>))); if (status.isEmpty()) { outputWindow->appendError(tr("There are no changes to commit.")); @@ -630,7 +630,7 @@ void MercurialPlugin::commitFromEditor() core->editorManager()->closeEditors(core->editorManager()->editorsForFileName(changeLog->fileName())); } -bool MercurialPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor) +bool MercurialPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) { if (!changeLog) return true; @@ -640,15 +640,15 @@ bool MercurialPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *sub return true; bool dummyPrompt = mercurialSettings.boolValue(MercurialSettings::promptOnSubmitKey); - const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult response = + const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult response = commitEditor->promptSubmit(tr("Close Commit Editor"), tr("Do you want to commit the changes?"), tr("Message check failed. Do you want to proceed?"), &dummyPrompt, dummyPrompt); switch (response) { - case VCSBase::VCSBaseSubmitEditor::SubmitCanceled: + case VcsBase::VcsBaseSubmitEditor::SubmitCanceled: return false; - case VCSBase::VCSBaseSubmitEditor::SubmitDiscarded: + case VcsBase::VcsBaseSubmitEditor::SubmitDiscarded: deleteCommitLog(); return true; default: @@ -704,7 +704,7 @@ void MercurialPlugin::createSeparator(const Core::Context &context, const Core:: mercurialContainer->addAction(actionManager->registerAction(action, id, context)); } -void MercurialPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) +void MercurialPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { if (!enableMenuAction(as, m_menuAction)) { m_commandLocator->setEnabled(false); diff --git a/src/plugins/mercurial/mercurialplugin.h b/src/plugins/mercurial/mercurialplugin.h index 1df9c85eef..f3b7ef059a 100644 --- a/src/plugins/mercurial/mercurialplugin.h +++ b/src/plugins/mercurial/mercurialplugin.h @@ -62,8 +62,8 @@ namespace Utils { class ParameterAction; } //namespace Utils -namespace VCSBase { -class VCSBaseSubmitEditor; +namespace VcsBase { +class VcsBaseSubmitEditor; } namespace Locator { @@ -79,7 +79,7 @@ class MercurialControl; class MercurialEditor; class MercurialSettings; -class MercurialPlugin : public VCSBase::VCSBasePlugin +class MercurialPlugin : public VcsBase::VcsBasePlugin { Q_OBJECT @@ -117,7 +117,7 @@ private slots: void incoming(); void outgoing(); void commit(); - void showCommitWidget(const QList<VCSBase::VCSBaseClient::StatusItem> &status); + void showCommitWidget(const QList<VcsBase::VcsBaseClient::StatusItem> &status); void commitFromEditor(); void diffFromEditorSelected(const QStringList &files); @@ -136,8 +136,8 @@ private slots: void serve();*/ protected: - virtual void updateActions(VCSBase::VCSBasePlugin::ActionState); - virtual bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor); + virtual void updateActions(VcsBase::VcsBasePlugin::ActionState); + virtual bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor); private: //methods diff --git a/src/plugins/mercurial/mercurialsettings.h b/src/plugins/mercurial/mercurialsettings.h index 69c1ba0f33..842b43f473 100644 --- a/src/plugins/mercurial/mercurialsettings.h +++ b/src/plugins/mercurial/mercurialsettings.h @@ -38,7 +38,7 @@ namespace Mercurial { namespace Internal { -class MercurialSettings : public VCSBase::VCSBaseClientSettings +class MercurialSettings : public VcsBase::VcsBaseClientSettings { public: static const QLatin1String diffIgnoreWhiteSpaceKey; diff --git a/src/plugins/mercurial/optionspage.cpp b/src/plugins/mercurial/optionspage.cpp index 4c28a45122..2e7587a435 100644 --- a/src/plugins/mercurial/optionspage.cpp +++ b/src/plugins/mercurial/optionspage.cpp @@ -98,7 +98,7 @@ OptionsPage::OptionsPage() QString OptionsPage::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_MERCURIAL); + return QLatin1String(VcsBase::Constants::VCS_ID_MERCURIAL); } QString OptionsPage::displayName() const diff --git a/src/plugins/mercurial/optionspage.h b/src/plugins/mercurial/optionspage.h index fa1114a116..23fc70c653 100644 --- a/src/plugins/mercurial/optionspage.h +++ b/src/plugins/mercurial/optionspage.h @@ -61,7 +61,7 @@ private: }; -class OptionsPage : public VCSBase::VCSBaseOptionsPage +class OptionsPage : public VcsBase::VcsBaseOptionsPage { Q_OBJECT diff --git a/src/plugins/perforce/annotationhighlighter.cpp b/src/plugins/perforce/annotationhighlighter.cpp index 44b613972d..96d4e2d284 100644 --- a/src/plugins/perforce/annotationhighlighter.cpp +++ b/src/plugins/perforce/annotationhighlighter.cpp @@ -37,7 +37,7 @@ namespace Internal { PerforceAnnotationHighlighter::PerforceAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) : - VCSBase::BaseAnnotationHighlighter(changeNumbers, document), + VcsBase::BaseAnnotationHighlighter(changeNumbers, document), m_colon(QLatin1Char(':')) { } diff --git a/src/plugins/perforce/annotationhighlighter.h b/src/plugins/perforce/annotationhighlighter.h index be8e9cc803..cde65aa8b0 100644 --- a/src/plugins/perforce/annotationhighlighter.h +++ b/src/plugins/perforce/annotationhighlighter.h @@ -39,7 +39,7 @@ namespace Perforce { namespace Internal { // Annotation highlighter for p4 triggering on 'changenumber:' -class PerforceAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter +class PerforceAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { Q_OBJECT public: diff --git a/src/plugins/perforce/perforceeditor.cpp b/src/plugins/perforce/perforceeditor.cpp index e025abeb19..d58791400e 100644 --- a/src/plugins/perforce/perforceeditor.cpp +++ b/src/plugins/perforce/perforceeditor.cpp @@ -59,9 +59,9 @@ namespace Perforce { namespace Internal { // ------------ PerforceEditor -PerforceEditor::PerforceEditor(const VCSBase::VCSBaseEditorParameters *type, +PerforceEditor::PerforceEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent) : - VCSBase::VCSBaseEditorWidget(type, parent), + VcsBase::VcsBaseEditorWidget(type, parent), m_changeNumberPattern(QLatin1String("^\\d+$")), m_plugin(PerforcePlugin::perforcePluginInstance()) { @@ -106,13 +106,13 @@ QString PerforceEditor::changeUnderCursor(const QTextCursor &c) const return m_changeNumberPattern.exactMatch(change) ? change : QString(); } -VCSBase::DiffHighlighter *PerforceEditor::createDiffHighlighter() const +VcsBase::DiffHighlighter *PerforceEditor::createDiffHighlighter() const { const QRegExp filePattern(QLatin1String("^====.*")); - return new VCSBase::DiffHighlighter(filePattern); + return new VcsBase::DiffHighlighter(filePattern); } -VCSBase::BaseAnnotationHighlighter *PerforceEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *PerforceEditor::createAnnotationHighlighter(const QSet<QString> &changes) const { return new PerforceAnnotationHighlighter(changes); } diff --git a/src/plugins/perforce/perforceeditor.h b/src/plugins/perforce/perforceeditor.h index 99ef212096..18794d7445 100644 --- a/src/plugins/perforce/perforceeditor.h +++ b/src/plugins/perforce/perforceeditor.h @@ -42,19 +42,19 @@ namespace Internal { class PerforcePlugin; -class PerforceEditor : public VCSBase::VCSBaseEditorWidget +class PerforceEditor : public VcsBase::VcsBaseEditorWidget { Q_OBJECT public: - explicit PerforceEditor(const VCSBase::VCSBaseEditorParameters *type, + explicit PerforceEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent); private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &) const; - virtual VCSBase::DiffHighlighter *createDiffHighlighter() const; - virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; virtual QStringList annotationPreviousVersions(const QString &v) const; diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index c5486f9567..2efc7638a1 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -75,27 +75,27 @@ #include <QtGui/QMenu> #include <QtGui/QMessageBox> -static const VCSBase::VCSBaseEditorParameters editorParameters[] = { +static const VcsBase::VcsBaseEditorParameters editorParameters[] = { { - VCSBase::RegularCommandOutput, + VcsBase::RegularCommandOutput, Perforce::Constants::PERFORCE_COMMANDLOG_EDITOR_ID, Perforce::Constants::PERFORCE_COMMANDLOG_EDITOR_DISPLAY_NAME, Perforce::Constants::PERFORCE_COMMANDLOG_EDITOR_CONTEXT, "application/vnd.nokia.text.scs_commandlog", "scslog"}, -{ VCSBase::LogOutput, +{ VcsBase::LogOutput, Perforce::Constants::PERFORCE_LOG_EDITOR_ID, Perforce::Constants::PERFORCE_LOG_EDITOR_DISPLAY_NAME, Perforce::Constants::PERFORCE_LOG_EDITOR_CONTEXT, "application/vnd.nokia.text.scs_filelog", "scsfilelog"}, -{ VCSBase::AnnotateOutput, +{ VcsBase::AnnotateOutput, Perforce::Constants::PERFORCE_ANNOTATION_EDITOR_ID, Perforce::Constants::PERFORCE_ANNOTATION_EDITOR_DISPLAY_NAME, Perforce::Constants::PERFORCE_ANNOTATION_EDITOR_CONTEXT, "application/vnd.nokia.text.scs_annotation", "scsannotate"}, -{ VCSBase::DiffOutput, +{ VcsBase::DiffOutput, Perforce::Constants::PERFORCE_DIFF_EDITOR_ID, Perforce::Constants::PERFORCE_DIFF_EDITOR_DISPLAY_NAME, Perforce::Constants::PERFORCE_DIFF_EDITOR_CONTEXT, @@ -103,10 +103,10 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = { }; // Utility to find a parameter set by type -static inline const VCSBase::VCSBaseEditorParameters *findType(int ie) +static inline const VcsBase::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 VcsBase::EditorContentType et = static_cast<VcsBase::EditorContentType>(ie); + return VcsBase::VcsBaseEditorWidget::findType(editorParameters, sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters), et); } static inline QString debugCodec(const QTextCodec *c) @@ -126,7 +126,7 @@ static inline QStringList perforceRelativeFileArguments(const QStringList &args) return p4Args; } -static inline QStringList perforceRelativeProjectDirectory(const VCSBase::VCSBasePluginState &s) +static inline QStringList perforceRelativeProjectDirectory(const VcsBase::VcsBasePluginState &s) { return perforceRelativeFileArguments(s.relativeCurrentProject()); } @@ -182,7 +182,7 @@ PerforceResponse::PerforceResponse() : PerforcePlugin *PerforcePlugin::m_perforcePluginInstance = NULL; PerforcePlugin::PerforcePlugin() : - VCSBase::VCSBasePlugin(QLatin1String(Constants::PERFORCE_SUBMIT_EDITOR_ID)), + VcsBase::VcsBasePlugin(QLatin1String(Constants::PERFORCE_SUBMIT_EDITOR_ID)), m_commandLocator(0), m_editAction(0), m_addAction(0), @@ -213,7 +213,7 @@ PerforcePlugin::PerforcePlugin() : { } -static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { +static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = { Perforce::Constants::SUBMIT_MIMETYPE, Perforce::Constants::PERFORCE_SUBMIT_EDITOR_ID, Perforce::Constants::PERFORCE_SUBMIT_EDITOR_DISPLAY_NAME, @@ -232,8 +232,8 @@ static inline Core::Command *createSeparator(QObject *parent, bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *errorMessage) { - typedef VCSBase::VCSEditorFactory<PerforceEditor> PerforceEditorFactory; - typedef VCSBase::VCSSubmitEditorFactory<PerforceSubmitEditor> PerforceSubmitEditorFactory; + typedef VcsBase::VcsEditorFactory<PerforceEditor> PerforceEditorFactory; + typedef VcsBase::VcsSubmitEditorFactory<PerforceSubmitEditor> PerforceSubmitEditorFactory; initializeVcs(new PerforceVersionControl(this)); @@ -251,7 +251,7 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er addAutoReleasedObject(new PerforceSubmitEditorFactory(&submitParameters)); static const char *describeSlot = SLOT(describe(QString,QString)); - const int editorCount = sizeof(editorParameters)/sizeof(VCSBase::VCSBaseEditorParameters); + const int editorCount = sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters); for (int i = 0; i < editorCount; i++) addAutoReleasedObject(new PerforceEditorFactory(editorParameters + i, this, describeSlot)); @@ -438,12 +438,12 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er connect(m_filelogAction, SIGNAL(triggered()), this, SLOT(filelog())); mperforce->addAction(command); - m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Submit"), this); + m_submitCurrentLogAction = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Submit"), this); command = am->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, perforcesubmitcontext); command->setAttribute(Core::Command::CA_UpdateText); connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog())); - m_diffSelectedFiles = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); + m_diffSelectedFiles = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); command = am->registerAction(m_diffSelectedFiles, Constants::DIFF_SELECTED, perforcesubmitcontext); m_undoAction = new QAction(tr("&Undo"), this); @@ -457,30 +457,30 @@ bool PerforcePlugin::initialize(const QStringList & /* arguments */, QString *er void PerforcePlugin::extensionsInitialized() { - VCSBase::VCSBasePlugin::extensionsInitialized(); + VcsBase::VcsBasePlugin::extensionsInitialized(); getTopLevel(); } void PerforcePlugin::openCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) vcsOpen(state.currentFileTopLevel(), state.relativeCurrentFile()); } void PerforcePlugin::addCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) vcsAdd(state.currentFileTopLevel(), state.relativeCurrentFile()); } void PerforcePlugin::revertCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(state.currentFile()); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(state.currentFile()); QStringList args; args << QLatin1String("diff") << QLatin1String("-sa") << state.relativeCurrentFile(); PerforceResponse result = runP4Cmd(state.currentFileTopLevel(), args, @@ -512,14 +512,14 @@ void PerforcePlugin::revertCurrentFile() void PerforcePlugin::diffCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) p4Diff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void PerforcePlugin::diffCurrentProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) p4Diff(state.currentProjectTopLevel(), perforceRelativeProjectDirectory(state)); } @@ -531,7 +531,7 @@ void PerforcePlugin::diffAllOpened() void PerforcePlugin::updateCurrentProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) updateCheckout(state.currentProjectTopLevel(), perforceRelativeProjectDirectory(state)); } @@ -543,7 +543,7 @@ void PerforcePlugin::updateAll() void PerforcePlugin::revertCurrentProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) const QString msg = tr("Do you want to revert all changes to the project \"%1\"?").arg(state.currentProjectName()); @@ -555,7 +555,7 @@ void PerforcePlugin::revertCurrentProject() void PerforcePlugin::revertUnchangedCurrentProject() { // revert -a. - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) revertProject(state.currentProjectTopLevel(), perforceRelativeProjectDirectory(state), true); } @@ -596,7 +596,7 @@ void PerforcePlugin::printOpenedFileList() return; // reformat "//depot/file.cpp#1 - description" into "file.cpp # - description" // for context menu opening to work. This produces absolute paths, then. - VCSBase::VCSBaseOutputWindow *outWin = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outWin = VcsBase::VcsBaseOutputWindow::instance(); QString errorMessage; QString mapped; const QChar delimiter = QLatin1Char('#'); @@ -617,15 +617,15 @@ void PerforcePlugin::printOpenedFileList() void PerforcePlugin::startSubmitProject() { - if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor()) + if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor()) return; if (isCommitEditorOpen()) { - VCSBase::VCSBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently executed.")); + VcsBase::VcsBaseOutputWindow::instance()->appendWarning(tr("Another submit is currently executed.")); return; } - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) // Revert all unchanged files. @@ -646,7 +646,7 @@ void PerforcePlugin::startSubmitProject() saver.setAutoRemove(false); saver.write(result.stdOut.toAscii()); if (!saver.finalize()) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(saver.errorString()); + VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString()); cleanCommitMessageFile(); return; } @@ -669,7 +669,7 @@ void PerforcePlugin::startSubmitProject() depotFileNames.append(line.mid(14)); } if (depotFileNames.isEmpty()) { - VCSBase::VCSBaseOutputWindow::instance()->appendWarning(tr("Project has no files")); + VcsBase::VcsBaseOutputWindow::instance()->appendWarning(tr("Project has no files")); cleanCommitMessageFile(); return; } @@ -713,7 +713,7 @@ void PerforcePlugin::describeChange() void PerforcePlugin::annotateCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) annotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } @@ -739,9 +739,9 @@ void PerforcePlugin::annotate(const QString &workingDir, int lineNumber /* = -1 */) { const QStringList files = QStringList(fileName); - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(workingDir, files); - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, files, changeList); - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, files); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(workingDir, files); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files, changeList); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); QStringList args; args << QLatin1String("annotate") << QLatin1String("-cqi"); if (changeList.isEmpty()) { @@ -754,18 +754,18 @@ void PerforcePlugin::annotate(const QString &workingDir, QStringList(), QByteArray(), codec); if (!result.error) { if (lineNumber < 1) - lineNumber = VCSBase::VCSBaseEditorWidget::lineNumberOfCurrentEditor(); + lineNumber = VcsBase::VcsBaseEditorWidget::lineNumberOfCurrentEditor(); const QFileInfo fi(fileName); Core::IEditor *ed = showOutputInEditor(tr("p4 annotate %1").arg(id), - result.stdOut, VCSBase::AnnotateOutput, + result.stdOut, VcsBase::AnnotateOutput, source, codec); - VCSBase::VCSBaseEditorWidget::gotoLineOfEditor(ed, lineNumber); + VcsBase::VcsBaseEditorWidget::gotoLineOfEditor(ed, lineNumber); } } void PerforcePlugin::filelogCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) filelog(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true); } @@ -781,14 +781,14 @@ void PerforcePlugin::filelog() void PerforcePlugin::logProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) filelog(state.currentProjectTopLevel(), perforceRelativeFileArguments(state.relativeCurrentProject())); } void PerforcePlugin::logRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) filelog(state.topLevel(), perforceRelativeFileArguments(QStringList())); } @@ -796,8 +796,8 @@ void PerforcePlugin::logRepository() void PerforcePlugin::filelog(const QString &workingDir, const QStringList &fileNames, bool enableAnnotationContextMenu) { - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, fileNames); - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(workingDir, fileNames); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, fileNames); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(workingDir, fileNames); QStringList args; args << QLatin1String("filelog") << QLatin1String("-li"); if (m_settings.logCount() > 0) @@ -807,15 +807,15 @@ void PerforcePlugin::filelog(const QString &workingDir, const QStringList &fileN CommandToWindow|StdErrToWindow|ErrorToWindow, QStringList(), QByteArray(), codec); if (!result.error) { - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, fileNames); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, fileNames); Core::IEditor *editor = showOutputInEditor(tr("p4 filelog %1").arg(id), result.stdOut, - VCSBase::LogOutput, source, codec); + VcsBase::LogOutput, source, codec); if (enableAnnotationContextMenu) - VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(editor)->setFileLogAnnotateEnabled(true); + VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(editor)->setFileLogAnnotateEnabled(true); } } -void PerforcePlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) +void PerforcePlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { if (!enableMenuAction(as, m_menuAction)) { m_commandLocator->setEnabled(false); @@ -1008,7 +1008,7 @@ PerforceResponse PerforcePlugin::synchronousProcess(const QString &workingDir, { QTC_ASSERT(stdInput.isEmpty(), return PerforceResponse()) // Not supported here - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); // Run, connect stderr to the output window Utils::SynchronousProcess process; const int timeOut = (flags & LongTimeOut) ? m_settings.longTimeOutMS() : m_settings.timeOutMS(); @@ -1125,7 +1125,7 @@ PerforceResponse PerforcePlugin::fullySynchronousProcess(const QString &workingD response.stdErr.remove(cr); response.stdOut.remove(cr); // Logging - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); if ((flags & StdErrToWindow) && !response.stdErr.isEmpty()) outputWindow->append(response.stdErr); if ((flags & StdOutToWindow) && !response.stdOut.isEmpty()) @@ -1143,7 +1143,7 @@ PerforceResponse PerforcePlugin::runP4Cmd(const QString &workingDir, if (Perforce::Constants::debug) qDebug() << "PerforcePlugin::runP4Cmd [" << workingDir << ']' << args << extraArgs << stdInput << debugCodec(outputCodec); - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); if (!m_settings.isValid()) { PerforceResponse invalidConfigResponse; invalidConfigResponse.error = true; @@ -1191,7 +1191,7 @@ Core::IEditor *PerforcePlugin::showOutputInEditor(const QString &title, const QS const QString &source, QTextCodec *codec) { - const VCSBase::VCSBaseEditorParameters *params = findType(editorType); + const VcsBase::VcsBaseEditorParameters *params = findType(editorType); QTC_ASSERT(params, return 0); const Core::Id id(params->id); if (Perforce::Constants::debug) @@ -1228,7 +1228,7 @@ struct PerforceDiffParameters }; // Parameter widget controlling whitespace diff mode, associated with a parameter -class PerforceDiffParameterWidget : public VCSBase::VCSBaseEditorParameterWidget +class PerforceDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT public: @@ -1245,7 +1245,7 @@ private: }; PerforceDiffParameterWidget::PerforceDiffParameterWidget(const PerforceDiffParameters &p, QWidget *parent) : - VCSBase::VCSBaseEditorParameterWidget(parent), m_parameters(p) + VcsBase::VcsBaseEditorParameterWidget(parent), m_parameters(p) { setBaseArguments(p.diffArguments); addToggleButton(QLatin1String("w"), tr("Ignore whitespace")); @@ -1270,11 +1270,11 @@ void PerforcePlugin::p4Diff(const QString &workingDir, const QStringList &files) void PerforcePlugin::p4Diff(const PerforceDiffParameters &p) { - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(p.workingDir, p.files); - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(p.workingDir, p.files); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(p.workingDir, p.files); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(p.workingDir, p.files); // Reuse existing editors for that id - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::DiffOutput, p.workingDir, p.files); - Core::IEditor *existingEditor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag); + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::DiffOutput, p.workingDir, p.files); + Core::IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag); // Split arguments according to size QStringList args; args << QLatin1String("diff"); @@ -1298,31 +1298,31 @@ void PerforcePlugin::p4Diff(const PerforceDiffParameters &p) return; } // Create new editor - Core::IEditor *editor = showOutputInEditor(tr("p4 diff %1").arg(id), result.stdOut, VCSBase::DiffOutput, - VCSBase::VCSBaseEditorWidget::getSource(p.workingDir, p.files), + Core::IEditor *editor = showOutputInEditor(tr("p4 diff %1").arg(id), result.stdOut, VcsBase::DiffOutput, + VcsBase::VcsBaseEditorWidget::getSource(p.workingDir, p.files), codec); - VCSBase::VCSBaseEditorWidget::tagEditor(editor, tag); - VCSBase::VCSBaseEditorWidget *diffEditorWidget = qobject_cast<VCSBase::VCSBaseEditorWidget *>(editor->widget()); + VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag); + VcsBase::VcsBaseEditorWidget *diffEditorWidget = qobject_cast<VcsBase::VcsBaseEditorWidget *>(editor->widget()); // Wire up the parameter widget to trigger a re-run on // parameter change and 'revert' from inside the diff editor. diffEditorWidget->setRevertDiffChunkEnabled(true); PerforceDiffParameterWidget *pw = new PerforceDiffParameterWidget(p); connect(pw, SIGNAL(reRunDiff(Perforce::Internal::PerforceDiffParameters)), this, SLOT(p4Diff(Perforce::Internal::PerforceDiffParameters))); - connect(diffEditorWidget, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), + connect(diffEditorWidget, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), pw, SLOT(triggerReRun())); diffEditorWidget->setConfigurationWidget(pw); } void PerforcePlugin::describe(const QString & source, const QString &n) { - QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(0) : VCSBase::VCSBaseEditorWidget::getCodec(source); + QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(0) : VcsBase::VcsBaseEditorWidget::getCodec(source); QStringList args; args << QLatin1String("describe") << QLatin1String("-du") << n; const PerforceResponse result = runP4Cmd(m_settings.topLevel(), args, CommandToWindow|StdErrToWindow|ErrorToWindow, QStringList(), QByteArray(), codec); if (!result.error) - showOutputInEditor(tr("p4 describe %1").arg(n), result.stdOut, VCSBase::DiffOutput, source, codec); + showOutputInEditor(tr("p4 describe %1").arg(n), result.stdOut, VcsBase::DiffOutput, source, codec); } void PerforcePlugin::submitCurrentLog() @@ -1346,7 +1346,7 @@ bool PerforcePlugin::isCommitEditorOpen() const return !m_commitMessageFileName.isEmpty(); } -bool PerforcePlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor) +bool PerforcePlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) { if (!isCommitEditorOpen()) return true; @@ -1357,14 +1357,14 @@ bool PerforcePlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *subm // Prompt the user. Force a prompt unless submit was actually invoked (that // is, the editor was closed or shutdown). bool wantsPrompt = m_settings.promptToSubmit(); - const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer = + const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer = perforceEditor->promptSubmit(tr("Closing p4 Editor"), tr("Do you want to submit this change list?"), tr("The commit message check failed. Do you want to submit this change list?"), &wantsPrompt, !m_submitActionTriggered); m_submitActionTriggered = false; - if (answer == VCSBase::VCSBaseSubmitEditor::SubmitCanceled) + if (answer == VcsBase::VcsBaseSubmitEditor::SubmitCanceled) return false; // Set without triggering the checking mechanism @@ -1374,14 +1374,14 @@ bool PerforcePlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *subm } if (!Core::ICore::instance()->fileManager()->saveFile(fileIFace)) return false; - if (answer == VCSBase::VCSBaseSubmitEditor::SubmitDiscarded) { + if (answer == VcsBase::VcsBaseSubmitEditor::SubmitDiscarded) { cleanCommitMessageFile(); return true; } // Pipe file into p4 submit -i Utils::FileReader reader; if (!reader.fetch(m_commitMessageFileName, QIODevice::Text)) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(reader.errorString()); + VcsBase::VcsBaseOutputWindow::instance()->appendError(reader.errorString()); return false; } @@ -1391,10 +1391,10 @@ bool PerforcePlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *subm LongTimeOut|RunFullySynchronous|CommandToWindow|StdErrToWindow|ErrorToWindow|ShowBusyCursor, QStringList(), reader.data()); if (submitResponse.error) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(tr("p4 submit failed: %1").arg(submitResponse.message)); + VcsBase::VcsBaseOutputWindow::instance()->appendError(tr("p4 submit failed: %1").arg(submitResponse.message)); return false; } - VCSBase::VCSBaseOutputWindow::instance()->append(submitResponse.stdOut); + VcsBase::VcsBaseOutputWindow::instance()->append(submitResponse.stdOut); if (submitResponse.stdOut.contains(QLatin1String("Out of date files must be resolved or reverted)"))) QMessageBox::warning(submitEditor->widget(), tr("Pending change"), tr("Could not submit the change, because your workspace was out of date. Created a pending submit instead.")); @@ -1526,14 +1526,14 @@ void PerforcePlugin::slotTopLevelFound(const QString &t) m_settings.setTopLevel(t); const QString msg = tr("Perforce repository: %1"). arg(QDir::toNativeSeparators(t)); - VCSBase::VCSBaseOutputWindow::instance()->appendSilently(msg); + VcsBase::VcsBaseOutputWindow::instance()->appendSilently(msg); if (Perforce::Constants::debug) qDebug() << "P4: " << t; } void PerforcePlugin::slotTopLevelFailed(const QString &errorMessage) { - VCSBase::VCSBaseOutputWindow::instance()->appendSilently(tr("Perforce: Unable to determine the repository: %1").arg(errorMessage)); + VcsBase::VcsBaseOutputWindow::instance()->appendSilently(tr("Perforce: Unable to determine the repository: %1").arg(errorMessage)); if (Perforce::Constants::debug) qDebug() << errorMessage; } diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h index f6ec9e778a..f378eb050a 100644 --- a/src/plugins/perforce/perforceplugin.h +++ b/src/plugins/perforce/perforceplugin.h @@ -77,7 +77,7 @@ struct PerforceResponse QString message; }; -class PerforcePlugin : public VCSBase::VCSBasePlugin +class PerforcePlugin : public VcsBase::VcsBasePlugin { Q_OBJECT @@ -141,8 +141,8 @@ private slots: void slotTopLevelFailed(const QString &); protected: - virtual void updateActions(VCSBase::VCSBasePlugin::ActionState); - virtual bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor); + virtual void updateActions(VcsBase::VcsBasePlugin::ActionState); + virtual bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor); private: diff --git a/src/plugins/perforce/perforcesubmiteditor.cpp b/src/plugins/perforce/perforcesubmiteditor.cpp index 42d8291275..cfd81ac95b 100644 --- a/src/plugins/perforce/perforcesubmiteditor.cpp +++ b/src/plugins/perforce/perforcesubmiteditor.cpp @@ -45,9 +45,9 @@ namespace Internal { enum { FileSpecRole = Qt::UserRole + 1 }; -PerforceSubmitEditor::PerforceSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent) : - VCSBaseSubmitEditor(parameters, new PerforceSubmitEditorWidget(parent)), - m_fileModel(new VCSBase::SubmitFileModel(this)) +PerforceSubmitEditor::PerforceSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent) : + VcsBaseSubmitEditor(parameters, new PerforceSubmitEditorWidget(parent)), + m_fileModel(new VcsBase::SubmitFileModel(this)) { setDisplayName(tr("Perforce Submit")); setFileModel(m_fileModel); diff --git a/src/plugins/perforce/perforcesubmiteditor.h b/src/plugins/perforce/perforcesubmiteditor.h index 40d46eb306..4238c4e08f 100644 --- a/src/plugins/perforce/perforcesubmiteditor.h +++ b/src/plugins/perforce/perforcesubmiteditor.h @@ -38,7 +38,7 @@ #include <QtCore/QStringList> #include <QtCore/QMap> -namespace VCSBase { +namespace VcsBase { class SubmitFileModel; } @@ -55,12 +55,12 @@ class PerforcePlugin; * As a p4 submit starts with all opened files, there is API to restrict * the file list to current project files in question * (restrictToProjectFiles()). */ -class PerforceSubmitEditor : public VCSBase::VCSBaseSubmitEditor +class PerforceSubmitEditor : public VcsBase::VcsBaseSubmitEditor { Q_OBJECT public: - explicit PerforceSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, QWidget *parent); + explicit PerforceSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parent); /* The p4 submit starts with all opened files. Restrict * it to the current project files in question. */ @@ -79,7 +79,7 @@ private: void updateEntries(); QMap<QString, QString> m_entries; - VCSBase::SubmitFileModel *m_fileModel; + VcsBase::SubmitFileModel *m_fileModel; }; } // namespace Internal diff --git a/src/plugins/perforce/perforceversioncontrol.cpp b/src/plugins/perforce/perforceversioncontrol.cpp index 994271eb6e..44f947c191 100644 --- a/src/plugins/perforce/perforceversioncontrol.cpp +++ b/src/plugins/perforce/perforceversioncontrol.cpp @@ -55,7 +55,7 @@ QString PerforceVersionControl::displayName() const QString PerforceVersionControl::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_PERFORCE); + return QLatin1String(VcsBase::Constants::VCS_ID_PERFORCE); } bool PerforceVersionControl::isConfigured() const diff --git a/src/plugins/perforce/settingspage.cpp b/src/plugins/perforce/settingspage.cpp index 560d23c33d..5808a507e7 100644 --- a/src/plugins/perforce/settingspage.cpp +++ b/src/plugins/perforce/settingspage.cpp @@ -144,7 +144,7 @@ SettingsPage::SettingsPage() QString SettingsPage::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_PERFORCE); + return QLatin1String(VcsBase::Constants::VCS_ID_PERFORCE); } QString SettingsPage::displayName() const diff --git a/src/plugins/perforce/settingspage.h b/src/plugins/perforce/settingspage.h index 78d3e840b5..5065072c45 100644 --- a/src/plugins/perforce/settingspage.h +++ b/src/plugins/perforce/settingspage.h @@ -71,7 +71,7 @@ private: QPointer<PerforceChecker> m_checker; }; -class SettingsPage : public VCSBase::VCSBaseOptionsPage +class SettingsPage : public VcsBase::VcsBaseOptionsPage { Q_OBJECT diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp index efa50c8273..f2070bdd98 100644 --- a/src/plugins/projectexplorer/projectwizardpage.cpp +++ b/src/plugins/projectexplorer/projectwizardpage.cpp @@ -172,6 +172,6 @@ void ProjectWizardPage::slotProjectChanged(int index) void ProjectWizardPage::slotManageVcs() { Core::ICore *core = Core::ICore::instance(); - core->showOptionsDialog(VCSBase::Constants::VCS_SETTINGS_CATEGORY, - VCSBase::Constants::VCS_COMMON_SETTINGS_ID); + core->showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY, + VcsBase::Constants::VCS_COMMON_SETTINGS_ID); } diff --git a/src/plugins/subversion/annotationhighlighter.cpp b/src/plugins/subversion/annotationhighlighter.cpp index 1d5d029305..ffde3871a2 100644 --- a/src/plugins/subversion/annotationhighlighter.cpp +++ b/src/plugins/subversion/annotationhighlighter.cpp @@ -37,7 +37,7 @@ using namespace Subversion::Internal; SubversionAnnotationHighlighter::SubversionAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) : - VCSBase::BaseAnnotationHighlighter(changeNumbers, document), + VcsBase::BaseAnnotationHighlighter(changeNumbers, document), m_blank(QLatin1Char(' ')) { } diff --git a/src/plugins/subversion/annotationhighlighter.h b/src/plugins/subversion/annotationhighlighter.h index 003f1a1e50..48d8ac17d8 100644 --- a/src/plugins/subversion/annotationhighlighter.h +++ b/src/plugins/subversion/annotationhighlighter.h @@ -39,7 +39,7 @@ namespace Subversion { namespace Internal { // Annotation highlighter for subversion triggering on 'changenumber ' -class SubversionAnnotationHighlighter : public VCSBase::BaseAnnotationHighlighter +class SubversionAnnotationHighlighter : public VcsBase::BaseAnnotationHighlighter { Q_OBJECT public: diff --git a/src/plugins/subversion/checkoutwizard.cpp b/src/plugins/subversion/checkoutwizard.cpp index 41b6f87d42..06fbd4176c 100644 --- a/src/plugins/subversion/checkoutwizard.cpp +++ b/src/plugins/subversion/checkoutwizard.cpp @@ -46,9 +46,9 @@ namespace Subversion { namespace Internal { CheckoutWizard::CheckoutWizard(QObject *parent) : - VCSBase::BaseCheckoutWizard(parent) + VcsBase::BaseCheckoutWizard(parent) { - setId(QLatin1String(VCSBase::Constants::VCS_ID_SUBVERSION)); + setId(QLatin1String(VcsBase::Constants::VCS_ID_SUBVERSION)); } QIcon CheckoutWizard::icon() const @@ -71,19 +71,19 @@ QList<QWizardPage*> CheckoutWizard::createParameterPages(const QString &path) QList<QWizardPage*> rc; const Core::IVersionControl *vc = SubversionPlugin::instance()->versionControl(); if (!vc->isConfigured()) - rc.append(new VCSBase::VcsConfigurationPage(vc)); + rc.append(new VcsBase::VcsConfigurationPage(vc)); CheckoutWizardPage *cwp = new CheckoutWizardPage; cwp->setPath(path); rc.append(cwp); return rc; } -QSharedPointer<VCSBase::AbstractCheckoutJob> CheckoutWizard::createJob(const QList<QWizardPage*> ¶meterPages, +QSharedPointer<VcsBase::AbstractCheckoutJob> CheckoutWizard::createJob(const QList<QWizardPage*> ¶meterPages, QString *checkoutPath) { // Collect parameters for the checkout command. const CheckoutWizardPage *cwp = qobject_cast<const CheckoutWizardPage *>(parameterPages.front()); - QTC_ASSERT(cwp, return QSharedPointer<VCSBase::AbstractCheckoutJob>()) + QTC_ASSERT(cwp, return QSharedPointer<VcsBase::AbstractCheckoutJob>()) const SubversionSettings settings = SubversionPlugin::instance()->settings(); const QString binary = settings.svnCommand; const QString directory = cwp->directory(); @@ -94,9 +94,9 @@ QSharedPointer<VCSBase::AbstractCheckoutJob> CheckoutWizard::createJob(const QLi const QStringList completeArgs = settings.hasAuthentication() ? SubversionPlugin::addAuthenticationOptions(args, settings.user, settings.password) : args; - VCSBase::ProcessCheckoutJob *job = new VCSBase::ProcessCheckoutJob; + VcsBase::ProcessCheckoutJob *job = new VcsBase::ProcessCheckoutJob; job->addStep(binary, completeArgs, workingDirectory); - return QSharedPointer<VCSBase::AbstractCheckoutJob>(job); + return QSharedPointer<VcsBase::AbstractCheckoutJob>(job); } } // namespace Internal diff --git a/src/plugins/subversion/checkoutwizard.h b/src/plugins/subversion/checkoutwizard.h index ae36f5130d..37dc046991 100644 --- a/src/plugins/subversion/checkoutwizard.h +++ b/src/plugins/subversion/checkoutwizard.h @@ -38,7 +38,7 @@ namespace Subversion { namespace Internal { -class CheckoutWizard : public VCSBase::BaseCheckoutWizard +class CheckoutWizard : public VcsBase::BaseCheckoutWizard { Q_OBJECT public: @@ -52,7 +52,7 @@ public: protected: // BaseCheckoutWizard virtual QList<QWizardPage*> createParameterPages(const QString &path); - virtual QSharedPointer<VCSBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPage, + virtual QSharedPointer<VcsBase::AbstractCheckoutJob> createJob(const QList<QWizardPage*> ¶meterPage, QString *checkoutPath); }; diff --git a/src/plugins/subversion/checkoutwizardpage.cpp b/src/plugins/subversion/checkoutwizardpage.cpp index 2fd66ec40c..bfe31563cf 100644 --- a/src/plugins/subversion/checkoutwizardpage.cpp +++ b/src/plugins/subversion/checkoutwizardpage.cpp @@ -36,7 +36,7 @@ namespace Subversion { namespace Internal { CheckoutWizardPage::CheckoutWizardPage(QWidget *parent) : - VCSBase::BaseCheckoutWizardPage(parent) + VcsBase::BaseCheckoutWizardPage(parent) { setTitle(tr("Location")); setSubTitle(tr("Specify repository URL, checkout directory and path.")); diff --git a/src/plugins/subversion/checkoutwizardpage.h b/src/plugins/subversion/checkoutwizardpage.h index d1e2b7c73d..d0cf610f5d 100644 --- a/src/plugins/subversion/checkoutwizardpage.h +++ b/src/plugins/subversion/checkoutwizardpage.h @@ -38,7 +38,7 @@ namespace Subversion { namespace Internal { -class CheckoutWizardPage : public VCSBase::BaseCheckoutWizardPage { +class CheckoutWizardPage : public VcsBase::BaseCheckoutWizardPage { Q_OBJECT public: CheckoutWizardPage(QWidget *parent = 0); diff --git a/src/plugins/subversion/settingspage.cpp b/src/plugins/subversion/settingspage.cpp index 8f44463199..8ccd596d24 100644 --- a/src/plugins/subversion/settingspage.cpp +++ b/src/plugins/subversion/settingspage.cpp @@ -109,7 +109,7 @@ SettingsPage::SettingsPage() : QString SettingsPage::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_SUBVERSION); + return QLatin1String(VcsBase::Constants::VCS_ID_SUBVERSION); } QString SettingsPage::displayName() const diff --git a/src/plugins/subversion/settingspage.h b/src/plugins/subversion/settingspage.h index 51bfe00782..6fbc141242 100644 --- a/src/plugins/subversion/settingspage.h +++ b/src/plugins/subversion/settingspage.h @@ -67,7 +67,7 @@ private: }; -class SettingsPage : public VCSBase::VCSBaseOptionsPage +class SettingsPage : public VcsBase::VcsBaseOptionsPage { Q_OBJECT diff --git a/src/plugins/subversion/subversioncontrol.cpp b/src/plugins/subversion/subversioncontrol.cpp index 74d87ae558..92a32a8581 100644 --- a/src/plugins/subversion/subversioncontrol.cpp +++ b/src/plugins/subversion/subversioncontrol.cpp @@ -53,7 +53,7 @@ QString SubversionControl::displayName() const QString SubversionControl::id() const { - return QLatin1String(VCSBase::Constants::VCS_ID_SUBVERSION); + return QLatin1String(VcsBase::Constants::VCS_ID_SUBVERSION); } bool SubversionControl::isConfigured() const diff --git a/src/plugins/subversion/subversioneditor.cpp b/src/plugins/subversion/subversioneditor.cpp index 377c2ae8a3..27ae7a0448 100644 --- a/src/plugins/subversion/subversioneditor.cpp +++ b/src/plugins/subversion/subversioneditor.cpp @@ -47,9 +47,9 @@ using namespace Subversion; using namespace Subversion::Internal; -SubversionEditor::SubversionEditor(const VCSBase::VCSBaseEditorParameters *type, +SubversionEditor::SubversionEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent) : - VCSBase::VCSBaseEditorWidget(type, parent), + VcsBase::VcsBaseEditorWidget(type, parent), m_changeNumberPattern(QLatin1String("^\\d+$")), m_revisionNumberPattern(QLatin1String("^r\\d+$")) { @@ -110,14 +110,14 @@ QString SubversionEditor::changeUnderCursor(const QTextCursor &c) const \endcode */ -VCSBase::DiffHighlighter *SubversionEditor::createDiffHighlighter() const +VcsBase::DiffHighlighter *SubversionEditor::createDiffHighlighter() const { const QRegExp filePattern(QLatin1String("^[-+][-+][-+] .*|^Index: .*|^==*$")); QTC_CHECK(filePattern.isValid()); - return new VCSBase::DiffHighlighter(filePattern); + return new VcsBase::DiffHighlighter(filePattern); } -VCSBase::BaseAnnotationHighlighter *SubversionEditor::createAnnotationHighlighter(const QSet<QString> &changes) const +VcsBase::BaseAnnotationHighlighter *SubversionEditor::createAnnotationHighlighter(const QSet<QString> &changes) const { return new SubversionAnnotationHighlighter(changes); } diff --git a/src/plugins/subversion/subversioneditor.h b/src/plugins/subversion/subversioneditor.h index 2e2cb1baef..00653c8097 100644 --- a/src/plugins/subversion/subversioneditor.h +++ b/src/plugins/subversion/subversioneditor.h @@ -40,19 +40,19 @@ namespace Subversion { namespace Internal { -class SubversionEditor : public VCSBase::VCSBaseEditorWidget +class SubversionEditor : public VcsBase::VcsBaseEditorWidget { Q_OBJECT public: - explicit SubversionEditor(const VCSBase::VCSBaseEditorParameters *type, + explicit SubversionEditor(const VcsBase::VcsBaseEditorParameters *type, QWidget *parent); private: virtual QSet<QString> annotationChanges() const; virtual QString changeUnderCursor(const QTextCursor &) const; - virtual VCSBase::DiffHighlighter *createDiffHighlighter() const; - virtual VCSBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; + virtual VcsBase::DiffHighlighter *createDiffHighlighter() const; + virtual VcsBase::BaseAnnotationHighlighter *createAnnotationHighlighter(const QSet<QString> &changes) const; virtual QString fileNameFromDiffSpecification(const QTextBlock &diffFileName) const; virtual QStringList annotationPreviousVersions(const QString &) const; diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp index c8526105c5..1f8be8b7c5 100644 --- a/src/plugins/subversion/subversionplugin.cpp +++ b/src/plugins/subversion/subversionplugin.cpp @@ -114,27 +114,27 @@ static const char nonInteractiveOptionC[] = "--non-interactive"; -static const VCSBase::VCSBaseEditorParameters editorParameters[] = { +static const VcsBase::VcsBaseEditorParameters editorParameters[] = { { - VCSBase::RegularCommandOutput, + VcsBase::RegularCommandOutput, "Subversion Command Log Editor", // id QT_TRANSLATE_NOOP("VCS", "Subversion Command Log Editor"), // display name "Subversion Command Log Editor", // context "application/vnd.nokia.text.scs_svn_commandlog", "scslog"}, -{ VCSBase::LogOutput, +{ VcsBase::LogOutput, "Subversion File Log Editor", // id QT_TRANSLATE_NOOP("VCS", "Subversion File Log Editor"), // display_name "Subversion File Log Editor", // context "application/vnd.nokia.text.scs_svn_filelog", "scsfilelog"}, -{ VCSBase::AnnotateOutput, +{ VcsBase::AnnotateOutput, "Subversion Annotation Editor", // id QT_TRANSLATE_NOOP("VCS", "Subversion Annotation Editor"), // display_name "Subversion Annotation Editor", // context "application/vnd.nokia.text.scs_svn_annotation", "scsannotate"}, -{ VCSBase::DiffOutput, +{ VcsBase::DiffOutput, "Subversion Diff Editor", // id QT_TRANSLATE_NOOP("VCS", "Subversion Diff Editor"), // display_name "Subversion Diff Editor", // context @@ -142,10 +142,10 @@ static const VCSBase::VCSBaseEditorParameters editorParameters[] = { }; // Utility to find a parameter set by type -static inline const VCSBase::VCSBaseEditorParameters *findType(int ie) +static inline const VcsBase::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 VcsBase::EditorContentType et = static_cast<VcsBase::EditorContentType>(ie); + return VcsBase::VcsBaseEditorWidget::findType(editorParameters, sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters), et); } static inline QString debugCodec(const QTextCodec *c) @@ -191,7 +191,7 @@ static inline QStringList svnDirectories() SubversionPlugin *SubversionPlugin::m_subversionPluginInstance = 0; SubversionPlugin::SubversionPlugin() : - VCSBase::VCSBasePlugin(QLatin1String(Subversion::Constants::SUBVERSIONCOMMITEDITOR_ID)), + VcsBase::VcsBasePlugin(QLatin1String(Subversion::Constants::SUBVERSIONCOMMITEDITOR_ID)), m_svnDirectories(svnDirectories()), m_commandLocator(0), m_addAction(0), @@ -241,7 +241,7 @@ bool SubversionPlugin::isCommitEditorOpen() const return !m_commitMessageFileName.isEmpty(); } -static const VCSBase::VCSBaseSubmitEditorParameters submitParameters = { +static const VcsBase::VcsBaseSubmitEditorParameters submitParameters = { Subversion::Constants::SUBVERSION_SUBMIT_MIMETYPE, Subversion::Constants::SUBVERSIONCOMMITEDITOR_ID, Subversion::Constants::SUBVERSIONCOMMITEDITOR_DISPLAY_NAME, @@ -260,8 +260,8 @@ static inline Core::Command *createSeparator(QObject *parent, bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *errorMessage) { - typedef VCSBase::VCSSubmitEditorFactory<SubversionSubmitEditor> SubversionSubmitEditorFactory; - typedef VCSBase::VCSEditorFactory<SubversionEditor> SubversionEditorFactory; + typedef VcsBase::VcsSubmitEditorFactory<SubversionSubmitEditor> SubversionSubmitEditorFactory; + typedef VcsBase::VcsEditorFactory<SubversionEditor> SubversionEditorFactory; using namespace Constants; using namespace Core::Constants; @@ -283,7 +283,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e addAutoReleasedObject(new SubversionSubmitEditorFactory(&submitParameters)); static const char *describeSlot = SLOT(describe(QString,QString)); - const int editorCount = sizeof(editorParameters)/sizeof(VCSBase::VCSBaseEditorParameters); + const int editorCount = sizeof(editorParameters)/sizeof(VcsBase::VcsBaseEditorParameters); for (int i = 0; i < editorCount; i++) addAutoReleasedObject(new SubversionEditorFactory(editorParameters + i, this, describeSlot)); @@ -456,12 +456,12 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e // Actions of the submit editor Core::Context svncommitcontext(Constants::SUBVERSIONCOMMITEDITOR); - m_submitCurrentLogAction = new QAction(VCSBase::VCSBaseSubmitEditor::submitIcon(), tr("Commit"), this); + m_submitCurrentLogAction = new QAction(VcsBase::VcsBaseSubmitEditor::submitIcon(), tr("Commit"), this); command = ami->registerAction(m_submitCurrentLogAction, Constants::SUBMIT_CURRENT, svncommitcontext); command->setAttribute(Core::Command::CA_UpdateText); connect(m_submitCurrentLogAction, SIGNAL(triggered()), this, SLOT(submitCurrentLog())); - m_submitDiffAction = new QAction(VCSBase::VCSBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); + m_submitDiffAction = new QAction(VcsBase::VcsBaseSubmitEditor::diffIcon(), tr("Diff &Selected Files"), this); command = ami->registerAction(m_submitDiffAction , Constants::DIFF_SELECTED, svncommitcontext); m_submitUndoAction = new QAction(tr("&Undo"), this); @@ -473,7 +473,7 @@ bool SubversionPlugin::initialize(const QStringList & /*arguments */, QString *e return true; } -bool SubversionPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor) +bool SubversionPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor) { if (!isCommitEditorOpen()) return true; @@ -493,16 +493,16 @@ bool SubversionPlugin::submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *su // Prompt user. Force a prompt unless submit was actually invoked (that // is, the editor was closed or shutdown). SubversionSettings newSettings = m_settings; - const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer = + const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer = editor->promptSubmit(tr("Closing Subversion Editor"), tr("Do you want to commit the change?"), tr("The commit message check failed. Do you want to commit the change?"), &newSettings.promptToSubmit, !m_submitActionTriggered); m_submitActionTriggered = false; switch (answer) { - case VCSBase::VCSBaseSubmitEditor::SubmitCanceled: + case VcsBase::VcsBaseSubmitEditor::SubmitCanceled: return false; // Keep editing and change file - case VCSBase::VCSBaseSubmitEditor::SubmitDiscarded: + case VcsBase::VcsBaseSubmitEditor::SubmitDiscarded: cleanCommitMessageFile(); return true; // Cancel all default: @@ -538,7 +538,7 @@ struct SubversionDiffParameters }; // Parameter widget controlling whitespace diff mode, associated with a parameter -class SubversionDiffParameterWidget : public VCSBase::VCSBaseEditorParameterWidget +class SubversionDiffParameterWidget : public VcsBase::VcsBaseEditorParameterWidget { Q_OBJECT public: @@ -555,7 +555,7 @@ private: }; SubversionDiffParameterWidget::SubversionDiffParameterWidget(const SubversionDiffParameters &p, QWidget *parent) : - VCSBase::VCSBaseEditorParameterWidget(parent), m_parameters(p) + VcsBase::VcsBaseEditorParameterWidget(parent), m_parameters(p) { setBaseArguments(p.arguments); addToggleButton(QLatin1String("w"), tr("Ignore whitespace")); @@ -574,7 +574,7 @@ void SubversionDiffParameterWidget::triggerReRun() static inline void setDiffBaseDirectory(Core::IEditor *editor, const QString &db) { - if (VCSBase::VCSBaseEditorWidget *ve = qobject_cast<VCSBase::VCSBaseEditorWidget*>(editor->widget())) + if (VcsBase::VcsBaseEditorWidget *ve = qobject_cast<VcsBase::VcsBaseEditorWidget*>(editor->widget())) ve->setDiffBaseDirectory(db); } @@ -591,8 +591,8 @@ void SubversionPlugin::svnDiff(const Subversion::Internal::SubversionDiffParamet { if (Subversion::Constants::debug) qDebug() << Q_FUNC_INFO << p.files << p.diffName; - const QString source = VCSBase::VCSBaseEditorWidget::getSource(p.workingDir, p.files); - QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(0) : VCSBase::VCSBaseEditorWidget::getCodec(source); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(p.workingDir, p.files); + QTextCodec *codec = source.isEmpty() ? static_cast<QTextCodec *>(0) : VcsBase::VcsBaseEditorWidget::getCodec(source); const QString diffName = p.files.count() == 1 && p.diffName.isEmpty() ? QFileInfo(p.files.front()).fileName() : p.diffName; @@ -608,18 +608,18 @@ void SubversionPlugin::svnDiff(const Subversion::Internal::SubversionDiffParamet // diff of a single file? re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::DiffOutput, p.workingDir, p.files); + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::DiffOutput, p.workingDir, p.files); // Show in the same editor if diff has been executed before - if (Core::IEditor *existingEditor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag)) { + if (Core::IEditor *existingEditor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { existingEditor->createNew(response.stdOut); Core::EditorManager::instance()->activateEditor(existingEditor, Core::EditorManager::ModeSwitch); setDiffBaseDirectory(existingEditor, p.workingDir); return; } const QString title = QString::fromLatin1("svn diff %1").arg(diffName); - Core::IEditor *editor = showOutputInEditor(title, response.stdOut, VCSBase::DiffOutput, source, codec); + Core::IEditor *editor = showOutputInEditor(title, response.stdOut, VcsBase::DiffOutput, source, codec); setDiffBaseDirectory(editor, p.workingDir); - VCSBase::VCSBaseEditorWidget::tagEditor(editor, tag); + VcsBase::VcsBaseEditorWidget::tagEditor(editor, tag); SubversionEditor *diffEditorWidget = qobject_cast<SubversionEditor *>(editor->widget()); QTC_ASSERT(diffEditorWidget, return ; ) @@ -629,7 +629,7 @@ void SubversionPlugin::svnDiff(const Subversion::Internal::SubversionDiffParamet SubversionDiffParameterWidget *pw = new SubversionDiffParameterWidget(p); connect(pw, SIGNAL(reRunDiff(Subversion::Internal::SubversionDiffParameters)), this, SLOT(svnDiff(Subversion::Internal::SubversionDiffParameters))); - connect(diffEditorWidget, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), + connect(diffEditorWidget, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), pw, SLOT(triggerReRun())); diffEditorWidget->setConfigurationWidget(pw); } @@ -647,7 +647,7 @@ SubversionSubmitEditor *SubversionPlugin::openSubversionSubmitEditor(const QStri return submitEditor; } -void SubversionPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) +void SubversionPlugin::updateActions(VcsBase::VcsBasePlugin::ActionState as) { if (!enableMenuAction(as, m_menuAction)) { m_commandLocator->setEnabled(false); @@ -685,14 +685,14 @@ void SubversionPlugin::updateActions(VCSBase::VCSBasePlugin::ActionState as) void SubversionPlugin::addCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) vcsAdd(state.currentFileTopLevel(), state.relativeCurrentFile()); } void SubversionPlugin::revertAll() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) const QString title = tr("Revert repository"); if (QMessageBox::warning(0, title, tr("Revert all pending changes to the repository?"), @@ -713,7 +713,7 @@ void SubversionPlugin::revertAll() void SubversionPlugin::revertCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) QStringList args(QLatin1String("diff")); @@ -748,35 +748,35 @@ void SubversionPlugin::revertCurrentFile() void SubversionPlugin::diffProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) svnDiff(state.currentProjectTopLevel(), state.relativeCurrentProject(), state.currentProjectName()); } void SubversionPlugin::diffCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) svnDiff(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void SubversionPlugin::startCommitCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) startCommit(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile())); } void SubversionPlugin::startCommitAll() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); startCommit(state.topLevel()); } void SubversionPlugin::startCommitProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return); startCommit(state.currentProjectPath()); } @@ -786,10 +786,10 @@ void SubversionPlugin::startCommitProject() * commit will start. */ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList &files) { - if (VCSBase::VCSBaseSubmitEditor::raiseSubmitEditor()) + if (VcsBase::VcsBaseSubmitEditor::raiseSubmitEditor()) return; if (isCommitEditorOpen()) { - VCSBase::VCSBaseOutputWindow::instance()->appendWarning(tr("Another commit is currently being executed.")); + VcsBase::VcsBaseOutputWindow::instance()->appendWarning(tr("Another commit is currently being executed.")); return; } @@ -804,7 +804,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList // Get list of added/modified/deleted files const StatusList statusOutput = parseStatusOutput(response.stdOut); if (statusOutput.empty()) { - VCSBase::VCSBaseOutputWindow::instance()->appendWarning(tr("There are no modified files.")); + VcsBase::VcsBaseOutputWindow::instance()->appendWarning(tr("There are no modified files.")); return; } m_commitRepository = workingDir; @@ -816,7 +816,7 @@ void SubversionPlugin::startCommit(const QString &workingDir, const QStringList // Create a submit saver.write(submitTemplate.toUtf8()); if (!saver.finalize()) { - VCSBase::VCSBaseOutputWindow::instance()->appendError(saver.errorString()); + VcsBase::VcsBaseOutputWindow::instance()->appendError(saver.errorString()); return; } m_commitMessageFileName = saver.fileName(); @@ -844,54 +844,54 @@ bool SubversionPlugin::commit(const QString &messageFile, void SubversionPlugin::filelogCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) filelog(state.currentFileTopLevel(), QStringList(state.relativeCurrentFile()), true); } void SubversionPlugin::logProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return) filelog(state.currentProjectTopLevel(), state.relativeCurrentProject()); } void SubversionPlugin::logRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) filelog(state.topLevel()); } void SubversionPlugin::diffRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) svnDiff(state.topLevel(), QStringList()); } void SubversionPlugin::statusRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) svnStatus(state.topLevel()); } void SubversionPlugin::updateRepository() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) svnUpdate(state.topLevel()); } void SubversionPlugin::svnStatus(const QString &workingDir, const QStringList &relativePaths) { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return) QStringList args(QLatin1String("status")); if (!relativePaths.isEmpty()) args.append(relativePaths); - VCSBase::VCSBaseOutputWindow *outwin = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outwin = VcsBase::VcsBaseOutputWindow::instance(); outwin->setRepository(workingDir); runSvn(workingDir, args, m_settings.timeOutMS(), ShowStdOutInLogWindow|ShowSuccessMessage); @@ -920,24 +920,24 @@ void SubversionPlugin::filelog(const QString &workingDir, // Re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, files); - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::LogOutput, workingDir, files); - if (Core::IEditor *editor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag)) { + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files); + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::LogOutput, workingDir, files); + if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { editor->createNew(response.stdOut); Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch); } else { const QString title = QString::fromLatin1("svn log %1").arg(id); - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, files); - Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::LogOutput, source, /*codec*/0); - VCSBase::VCSBaseEditorWidget::tagEditor(newEditor, tag); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); + Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VcsBase::LogOutput, source, /*codec*/0); + VcsBase::VcsBaseEditorWidget::tagEditor(newEditor, tag); if (enableAnnotationContextMenu) - VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(newEditor)->setFileLogAnnotateEnabled(true); + VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(newEditor)->setFileLogAnnotateEnabled(true); } } void SubversionPlugin::updateProject() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return); svnUpdate(state.currentProjectTopLevel(), state.relativeCurrentProject()); } @@ -957,7 +957,7 @@ void SubversionPlugin::svnUpdate(const QString &workingDir, const QStringList &r void SubversionPlugin::annotateCurrentFile() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return); vcsAnnotate(state.currentFileTopLevel(), state.relativeCurrentFile()); } @@ -974,8 +974,8 @@ void SubversionPlugin::vcsAnnotate(const QString &workingDir, const QString &fil const QString &revision /* = QString() */, int lineNumber /* = -1 */) { - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, file); - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(source); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, file); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(source); QStringList args(QLatin1String("annotate")); if (m_settings.spaceIgnorantAnnotation) @@ -994,26 +994,26 @@ void SubversionPlugin::vcsAnnotate(const QString &workingDir, const QString &fil // Re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file if (lineNumber <= 0) - lineNumber = VCSBase::VCSBaseEditorWidget::lineNumberOfCurrentEditor(source); + lineNumber = VcsBase::VcsBaseEditorWidget::lineNumberOfCurrentEditor(source); // Determine id const QStringList files = QStringList(file); - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, files, revision); - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::AnnotateOutput, workingDir, files); - if (Core::IEditor *editor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag)) { + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files, revision); + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::AnnotateOutput, workingDir, files); + if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { editor->createNew(response.stdOut); - VCSBase::VCSBaseEditorWidget::gotoLineOfEditor(editor, lineNumber); + VcsBase::VcsBaseEditorWidget::gotoLineOfEditor(editor, lineNumber); Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch); } else { const QString title = QString::fromLatin1("svn annotate %1").arg(id); - Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VCSBase::AnnotateOutput, source, codec); - VCSBase::VCSBaseEditorWidget::tagEditor(newEditor, tag); - VCSBase::VCSBaseEditorWidget::gotoLineOfEditor(newEditor, lineNumber); + Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, VcsBase::AnnotateOutput, source, codec); + VcsBase::VcsBaseEditorWidget::tagEditor(newEditor, tag); + VcsBase::VcsBaseEditorWidget::gotoLineOfEditor(newEditor, lineNumber); } } void SubversionPlugin::projectStatus() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasProject(), return); svnStatus(state.currentFileTopLevel(), state.relativeCurrentProject()); } @@ -1053,7 +1053,7 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr) QTextStream(&diffArg) << (number - 1) << ':' << number; args.push_back(diffArg); - QTextCodec *codec = VCSBase::VCSBaseEditorWidget::getCodec(source); + QTextCodec *codec = VcsBase::VcsBaseEditorWidget::getCodec(source); const SubversionResponse response = runSvn(topLevel, args, m_settings.timeOutMS(), SshPasswordPrompt, codec); @@ -1064,20 +1064,20 @@ void SubversionPlugin::describe(const QString &source, const QString &changeNr) // Re-use an existing view if possible to support // the common usage pattern of continuously changing and diffing a file const QString id = diffArg + source; - const QString tag = VCSBase::VCSBaseEditorWidget::editorTag(VCSBase::DiffOutput, source, QStringList(), changeNr); - if (Core::IEditor *editor = VCSBase::VCSBaseEditorWidget::locateEditorByTag(tag)) { + const QString tag = VcsBase::VcsBaseEditorWidget::editorTag(VcsBase::DiffOutput, source, QStringList(), changeNr); + if (Core::IEditor *editor = VcsBase::VcsBaseEditorWidget::locateEditorByTag(tag)) { editor->createNew(description); Core::EditorManager::instance()->activateEditor(editor, Core::EditorManager::ModeSwitch); } else { const QString title = QString::fromLatin1("svn describe %1#%2").arg(fi.fileName(), changeNr); - Core::IEditor *newEditor = showOutputInEditor(title, description, VCSBase::DiffOutput, source, codec); - VCSBase::VCSBaseEditorWidget::tagEditor(newEditor, tag); + Core::IEditor *newEditor = showOutputInEditor(title, description, VcsBase::DiffOutput, source, codec); + VcsBase::VcsBaseEditorWidget::tagEditor(newEditor, tag); } } void SubversionPlugin::slotDescribe() { - const VCSBase::VCSBasePluginState state = currentState(); + const VcsBase::VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasTopLevel(), return); QInputDialog inputDialog(Core::ICore::instance()->mainWindow()); @@ -1151,7 +1151,7 @@ SubversionResponse SubversionPlugin::runSvn(const QString &workingDir, const QStringList completeArguments = SubversionPlugin::addAuthenticationOptions(arguments, userName, password); const Utils::SynchronousProcessResponse sp_resp = - VCSBase::VCSBasePlugin::runVCS(workingDir, executable, + VcsBase::VcsBasePlugin::runVcs(workingDir, executable, completeArguments, timeOut, flags, outputCodec); response.error = sp_resp.result != Utils::SynchronousProcessResponse::Finished; @@ -1166,7 +1166,7 @@ Core::IEditor *SubversionPlugin::showOutputInEditor(const QString &title, const int editorType, const QString &source, QTextCodec *codec) { - const VCSBase::VCSBaseEditorParameters *params = findType(editorType); + const VcsBase::VcsBaseEditorParameters *params = findType(editorType); QTC_ASSERT(params, return 0); const Core::Id id = params->id; if (Subversion::Constants::debug) @@ -1309,12 +1309,12 @@ bool SubversionPlugin::vcsCheckout(const QString &directory, const QByteArray &u args << tempUrl.toEncoded() << directory; const SubversionResponse response = runSvn(directory, username, password, args, m_settings.longTimeOutMS(), - VCSBase::VCSBasePlugin::SshPasswordPrompt); + VcsBase::VcsBasePlugin::SshPasswordPrompt); return !response.error; } else { args << url << directory; const SubversionResponse response = runSvn(directory, args, m_settings.longTimeOutMS(), - VCSBase::VCSBasePlugin::SshPasswordPrompt); + VcsBase::VcsBasePlugin::SshPasswordPrompt); return !response.error; } } diff --git a/src/plugins/subversion/subversionplugin.h b/src/plugins/subversion/subversionplugin.h index 7f9386269e..c6dc905e01 100644 --- a/src/plugins/subversion/subversionplugin.h +++ b/src/plugins/subversion/subversionplugin.h @@ -52,8 +52,8 @@ namespace Utils { class ParameterAction; } -namespace VCSBase { - class VCSBaseSubmitEditor; +namespace VcsBase { + class VcsBaseSubmitEditor; } namespace Locator { @@ -76,7 +76,7 @@ struct SubversionResponse QString message; }; -class SubversionPlugin : public VCSBase::VCSBasePlugin +class SubversionPlugin : public VcsBase::VcsBasePlugin { Q_OBJECT @@ -140,8 +140,8 @@ private slots: void updateRepository(); protected: - virtual void updateActions(VCSBase::VCSBasePlugin::ActionState); - virtual bool submitEditorAboutToClose(VCSBase::VCSBaseSubmitEditor *submitEditor); + virtual void updateActions(VcsBase::VcsBasePlugin::ActionState); + virtual bool submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEditor); private: inline bool isCommitEditorOpen() const; diff --git a/src/plugins/subversion/subversionsubmiteditor.cpp b/src/plugins/subversion/subversionsubmiteditor.cpp index 6e17d683e4..5889b7a7e3 100644 --- a/src/plugins/subversion/subversionsubmiteditor.cpp +++ b/src/plugins/subversion/subversionsubmiteditor.cpp @@ -38,9 +38,9 @@ using namespace Subversion::Internal; -SubversionSubmitEditor::SubversionSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, +SubversionSubmitEditor::SubversionSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parentWidget) : - VCSBase::VCSBaseSubmitEditor(parameters, new Utils::SubmitEditorWidget(parentWidget)) + VcsBase::VcsBaseSubmitEditor(parameters, new Utils::SubmitEditorWidget(parentWidget)) { setDisplayName(tr("Subversion Submit")); } @@ -48,7 +48,7 @@ SubversionSubmitEditor::SubversionSubmitEditor(const VCSBase::VCSBaseSubmitEdito void SubversionSubmitEditor::setStatusList(const QList<StatusFilePair> &statusOutput) { typedef QList<StatusFilePair>::const_iterator ConstIterator; - VCSBase::SubmitFileModel *model = new VCSBase::SubmitFileModel(this); + VcsBase::SubmitFileModel *model = new VcsBase::SubmitFileModel(this); const ConstIterator cend = statusOutput.constEnd(); for (ConstIterator it = statusOutput.constBegin(); it != cend; ++it) diff --git a/src/plugins/subversion/subversionsubmiteditor.h b/src/plugins/subversion/subversionsubmiteditor.h index d58a9ad02b..80d2657de4 100644 --- a/src/plugins/subversion/subversionsubmiteditor.h +++ b/src/plugins/subversion/subversionsubmiteditor.h @@ -41,11 +41,11 @@ namespace Subversion { namespace Internal { -class SubversionSubmitEditor : public VCSBase::VCSBaseSubmitEditor +class SubversionSubmitEditor : public VcsBase::VcsBaseSubmitEditor { Q_OBJECT public: - explicit SubversionSubmitEditor(const VCSBase::VCSBaseSubmitEditorParameters *parameters, + explicit SubversionSubmitEditor(const VcsBase::VcsBaseSubmitEditorParameters *parameters, QWidget *parentWidget = 0); static QString fileFromStatusLine(const QString &statusLine); diff --git a/src/plugins/vcsbase/baseannotationhighlighter.cpp b/src/plugins/vcsbase/baseannotationhighlighter.cpp index 5b7764696b..4ebddc6a72 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.cpp +++ b/src/plugins/vcsbase/baseannotationhighlighter.cpp @@ -43,7 +43,7 @@ typedef QMap<QString, QTextCharFormat> ChangeNumberFormatMap; /*! - \class VCSBase::BaseAnnotationHighlighter + \class VcsBase::BaseAnnotationHighlighter \brief Base for a highlighter for annotation lines of the form 'changenumber:XXXX'. @@ -55,7 +55,7 @@ typedef QMap<QString, QTextCharFormat> ChangeNumberFormatMap; \endcode */ -namespace VCSBase { +namespace VcsBase { namespace Internal { class BaseAnnotationHighlighterPrivate @@ -116,4 +116,4 @@ void BaseAnnotationHighlighter::highlightBlock(const QString &text) setFormat(0, text.length(), it.value()); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/baseannotationhighlighter.h b/src/plugins/vcsbase/baseannotationhighlighter.h index d5ee5c78dd..c28b4ca6ae 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.h +++ b/src/plugins/vcsbase/baseannotationhighlighter.h @@ -37,7 +37,7 @@ #include <texteditor/syntaxhighlighter.h> -namespace VCSBase { +namespace VcsBase { namespace Internal { class BaseAnnotationHighlighterPrivate; } // namespace Internal @@ -63,6 +63,6 @@ private: Internal::BaseAnnotationHighlighterPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // BASEANNOTATIONHIGHLIGHTER_H diff --git a/src/plugins/vcsbase/basecheckoutwizard.cpp b/src/plugins/vcsbase/basecheckoutwizard.cpp index f99fd2285e..3514613a17 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.cpp +++ b/src/plugins/vcsbase/basecheckoutwizard.cpp @@ -44,7 +44,7 @@ #include <QtGui/QMessageBox> /*! - \class VCSBase::BaseCheckoutWizard + \class VcsBase::BaseCheckoutWizard \brief A Core::IWizard implementing a wizard for initially checking out a project using a version control system. @@ -61,10 +61,10 @@ On success, the wizard tries to locate a project file and open it. - \sa VCSBase::BaseCheckoutWizardPage + \sa VcsBase::BaseCheckoutWizardPage */ -namespace VCSBase { +namespace VcsBase { namespace Internal { class BaseCheckoutWizardPrivate @@ -208,4 +208,4 @@ void BaseCheckoutWizard::slotProgressPageShown() d->dialog->start(job); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/basecheckoutwizard.h b/src/plugins/vcsbase/basecheckoutwizard.h index 7665bedb42..57a0388781 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.h +++ b/src/plugins/vcsbase/basecheckoutwizard.h @@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE class QWizardPage; QT_END_NAMESPACE -namespace VCSBase { +namespace VcsBase { namespace Internal { class BaseCheckoutWizardPrivate; } @@ -83,6 +83,6 @@ private: Internal::BaseCheckoutWizardPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // BASECHECKOUTWIZARD_H diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.cpp b/src/plugins/vcsbase/basecheckoutwizardpage.cpp index 2a00670162..33aca6bf3f 100644 --- a/src/plugins/vcsbase/basecheckoutwizardpage.cpp +++ b/src/plugins/vcsbase/basecheckoutwizardpage.cpp @@ -36,7 +36,7 @@ #include <QtGui/QIcon> /*! - \class VCSBase::BaseCheckoutWizardPage + \class VcsBase::BaseCheckoutWizardPage \brief Base class for a parameter page of a checkout wizard. @@ -44,10 +44,10 @@ the path. Contains a virtual to derive the checkout directory from the repository as it is entered. - \sa VCSBase::BaseCheckoutWizard + \sa VcsBase::BaseCheckoutWizard */ -namespace VCSBase { +namespace VcsBase { namespace Internal { class BaseCheckoutWizardPagePrivate @@ -260,4 +260,4 @@ void BaseCheckoutWizardPage::slotChanged() } } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.h b/src/plugins/vcsbase/basecheckoutwizardpage.h index b1efd7f9df..9b61b51e37 100644 --- a/src/plugins/vcsbase/basecheckoutwizardpage.h +++ b/src/plugins/vcsbase/basecheckoutwizardpage.h @@ -37,7 +37,7 @@ #include <QtGui/QWizardPage> -namespace VCSBase { +namespace VcsBase { namespace Internal { class BaseCheckoutWizardPagePrivate; @@ -111,6 +111,6 @@ private: Internal::BaseCheckoutWizardPagePrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASE_CHECKOUTWIZARDPAGE_H diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.ui b/src/plugins/vcsbase/basecheckoutwizardpage.ui index 2cd0124ca8..2ae4b6e19d 100644 --- a/src/plugins/vcsbase/basecheckoutwizardpage.ui +++ b/src/plugins/vcsbase/basecheckoutwizardpage.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>VCSBase::Internal::BaseCheckoutWizardPage</class> - <widget class="QWizardPage" name="VCSBase::Internal::BaseCheckoutWizardPage"> + <class>VcsBase::Internal::BaseCheckoutWizardPage</class> + <widget class="QWizardPage" name="VcsBase::Internal::BaseCheckoutWizardPage"> <property name="geometry"> <rect> <x>0</x> diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp index 59c3c453d6..47c284118f 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.cpp +++ b/src/plugins/vcsbase/basevcseditorfactory.cpp @@ -41,29 +41,29 @@ #include <QtCore/QCoreApplication> /*! - \class VCSBase::BaseVCSEditorFactory + \class VcsBase::BaseVCSEditorFactory - \brief Base class for editor factories creating instances of VCSBaseEditor subclasses. + \brief Base class for editor factories creating instances of VcsBaseEditor subclasses. - \sa VCSBase::VCSBaseEditorWidget + \sa VcsBase::VcsBaseEditorWidget */ -namespace VCSBase { +namespace VcsBase { namespace Internal { -class BaseVCSEditorFactoryPrivate +class BaseVcsEditorFactoryPrivate { public: - BaseVCSEditorFactoryPrivate(const VCSBaseEditorParameters *t); + BaseVcsEditorFactoryPrivate(const VcsBaseEditorParameters *t); - const VCSBaseEditorParameters *m_type; + const VcsBaseEditorParameters *m_type; const Core::Id m_id; QString m_displayName; const QStringList m_mimeTypes; TextEditor::TextEditorActionHandler *m_editorHandler; }; -BaseVCSEditorFactoryPrivate::BaseVCSEditorFactoryPrivate(const VCSBaseEditorParameters *t) : +BaseVcsEditorFactoryPrivate::BaseVcsEditorFactoryPrivate(const VcsBaseEditorParameters *t) : m_type(t), m_id(t->id), m_mimeTypes(QStringList(QLatin1String(t->mimeType))), @@ -73,41 +73,41 @@ BaseVCSEditorFactoryPrivate::BaseVCSEditorFactoryPrivate(const VCSBaseEditorPara } // namespace Internal -BaseVCSEditorFactory::BaseVCSEditorFactory(const VCSBaseEditorParameters *t) - : d(new Internal::BaseVCSEditorFactoryPrivate(t)) +BaseVcsEditorFactory::BaseVcsEditorFactory(const VcsBaseEditorParameters *t) + : d(new Internal::BaseVcsEditorFactoryPrivate(t)) { d->m_displayName = QCoreApplication::translate("VCS", t->displayName); } -BaseVCSEditorFactory::~BaseVCSEditorFactory() +BaseVcsEditorFactory::~BaseVcsEditorFactory() { delete d; } -QStringList BaseVCSEditorFactory::mimeTypes() const +QStringList BaseVcsEditorFactory::mimeTypes() const { return d->m_mimeTypes; } -Core::Id BaseVCSEditorFactory::id() const +Core::Id BaseVcsEditorFactory::id() const { return d->m_id; } -QString BaseVCSEditorFactory::displayName() const +QString BaseVcsEditorFactory::displayName() const { return d->m_displayName; } -Core::IFile *BaseVCSEditorFactory::open(const QString &fileName) +Core::IFile *BaseVcsEditorFactory::open(const QString &fileName) { Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, id()); return iface ? iface->file() : 0; } -Core::IEditor *BaseVCSEditorFactory::createEditor(QWidget *parent) +Core::IEditor *BaseVcsEditorFactory::createEditor(QWidget *parent) { - VCSBaseEditorWidget *vcsEditor = createVCSBaseEditor(d->m_type, parent); + VcsBaseEditorWidget *vcsEditor = createVcsBaseEditor(d->m_type, parent); vcsEditor ->setMimeType(d->m_mimeTypes.front()); d->m_editorHandler->setupActions(vcsEditor); @@ -120,4 +120,4 @@ Core::IEditor *BaseVCSEditorFactory::createEditor(QWidget *parent) return vcsEditor->editor(); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/basevcseditorfactory.h b/src/plugins/vcsbase/basevcseditorfactory.h index 01c381ae4f..dbfb188bd2 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.h +++ b/src/plugins/vcsbase/basevcseditorfactory.h @@ -40,17 +40,17 @@ #include <QtCore/QStringList> -namespace VCSBase { +namespace VcsBase { namespace Internal { -class BaseVCSEditorFactoryPrivate; +class BaseVcsEditorFactoryPrivate; } // namespace Internal -class VCSBASE_EXPORT BaseVCSEditorFactory : public Core::IEditorFactory +class VCSBASE_EXPORT BaseVcsEditorFactory : public Core::IEditorFactory { Q_OBJECT public: - explicit BaseVCSEditorFactory(const VCSBaseEditorParameters *type); - ~BaseVCSEditorFactory(); + explicit BaseVcsEditorFactory(const VcsBaseEditorParameters *type); + ~BaseVcsEditorFactory(); QStringList mimeTypes() const; // IEditorFactory @@ -63,44 +63,44 @@ public: private: // Implement to create and initialize (call init()) a - // VCSBaseEditor subclass - virtual VCSBaseEditorWidget *createVCSBaseEditor(const VCSBaseEditorParameters *type, + // VcsBaseEditor subclass + virtual VcsBaseEditorWidget *createVcsBaseEditor(const VcsBaseEditorParameters *type, QWidget *parent) = 0; - Internal::BaseVCSEditorFactoryPrivate *const d; + Internal::BaseVcsEditorFactoryPrivate *const d; }; // Utility template to create an editor. template <class Editor> -class VCSEditorFactory : public BaseVCSEditorFactory +class VcsEditorFactory : public BaseVcsEditorFactory { public: - explicit VCSEditorFactory(const VCSBaseEditorParameters *type, + explicit VcsEditorFactory(const VcsBaseEditorParameters *type, QObject *describeReceiver = 0, const char *describeSlot = 0); private: - VCSBaseEditorWidget *createVCSBaseEditor(const VCSBaseEditorParameters *type, + VcsBaseEditorWidget *createVcsBaseEditor(const VcsBaseEditorParameters *type, QWidget *parent); QObject *m_describeReceiver; const char *m_describeSlot; }; template <class Editor> -VCSEditorFactory<Editor>::VCSEditorFactory(const VCSBaseEditorParameters *type, +VcsEditorFactory<Editor>::VcsEditorFactory(const VcsBaseEditorParameters *type, QObject *describeReceiver, const char *describeSlot) : - BaseVCSEditorFactory(type), + BaseVcsEditorFactory(type), m_describeReceiver(describeReceiver), m_describeSlot(describeSlot) { } template <class Editor> -VCSBaseEditorWidget *VCSEditorFactory<Editor>::createVCSBaseEditor(const VCSBaseEditorParameters *type, +VcsBaseEditorWidget *VcsEditorFactory<Editor>::createVcsBaseEditor(const VcsBaseEditorParameters *type, QWidget *parent) { - VCSBaseEditorWidget *rc = new Editor(type, parent); + VcsBaseEditorWidget *rc = new Editor(type, parent); rc->init(); if (m_describeReceiver) connect(rc, SIGNAL(describeRequested(QString,QString)), m_describeReceiver, m_describeSlot); @@ -108,7 +108,7 @@ VCSBaseEditorWidget *VCSEditorFactory<Editor>::createVCSBaseEditor(const VCSBase } -} // namespace VCSBase +} // namespace VcsBase #endif // BASEVCSEDITORFACTORY_H diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp index b401b1e106..3ee50d03c8 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp @@ -35,22 +35,22 @@ #include <coreplugin/editormanager/editormanager.h> -namespace VCSBase { +namespace VcsBase { namespace Internal { -class BaseVCSSubmitEditorFactoryPrivate +class BaseVcsSubmitEditorFactoryPrivate { public: - BaseVCSSubmitEditorFactoryPrivate(const VCSBaseSubmitEditorParameters *parameters); + BaseVcsSubmitEditorFactoryPrivate(const VcsBaseSubmitEditorParameters *parameters); - const VCSBaseSubmitEditorParameters *m_parameters; + const VcsBaseSubmitEditorParameters *m_parameters; const Core::Id m_id; const QString m_displayName; const QStringList m_mimeTypes; }; -BaseVCSSubmitEditorFactoryPrivate::BaseVCSSubmitEditorFactoryPrivate(const VCSBaseSubmitEditorParameters *parameters) : +BaseVcsSubmitEditorFactoryPrivate::BaseVcsSubmitEditorFactoryPrivate(const VcsBaseSubmitEditorParameters *parameters) : m_parameters(parameters), m_id(parameters->id), m_displayName(parameters->displayName), @@ -60,42 +60,42 @@ BaseVCSSubmitEditorFactoryPrivate::BaseVCSSubmitEditorFactoryPrivate(const VCSBa } // namespace Internal -BaseVCSSubmitEditorFactory::BaseVCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters) : - d(new Internal::BaseVCSSubmitEditorFactoryPrivate(parameters)) +BaseVcsSubmitEditorFactory::BaseVcsSubmitEditorFactory(const VcsBaseSubmitEditorParameters *parameters) : + d(new Internal::BaseVcsSubmitEditorFactoryPrivate(parameters)) { } -BaseVCSSubmitEditorFactory::~BaseVCSSubmitEditorFactory() +BaseVcsSubmitEditorFactory::~BaseVcsSubmitEditorFactory() { delete d; } -Core::IEditor *BaseVCSSubmitEditorFactory::createEditor(QWidget *parent) +Core::IEditor *BaseVcsSubmitEditorFactory::createEditor(QWidget *parent) { return createBaseSubmitEditor(d->m_parameters, parent); } -Core::Id BaseVCSSubmitEditorFactory::id() const +Core::Id BaseVcsSubmitEditorFactory::id() const { return d->m_id; } -QString BaseVCSSubmitEditorFactory::displayName() const +QString BaseVcsSubmitEditorFactory::displayName() const { return d->m_displayName; } -QStringList BaseVCSSubmitEditorFactory::mimeTypes() const +QStringList BaseVcsSubmitEditorFactory::mimeTypes() const { return d->m_mimeTypes; } -Core::IFile *BaseVCSSubmitEditorFactory::open(const QString &fileName) +Core::IFile *BaseVcsSubmitEditorFactory::open(const QString &fileName) { if (Core::IEditor *iface = Core::EditorManager::instance()->openEditor(fileName, id())) return iface->file(); return 0; } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.h b/src/plugins/vcsbase/basevcssubmiteditorfactory.h index 85ad2486e5..a884d709ab 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.h +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.h @@ -37,26 +37,26 @@ #include <coreplugin/editormanager/ieditorfactory.h> -namespace VCSBase { +namespace VcsBase { -class VCSBaseSubmitEditor; -class VCSBaseSubmitEditorParameters; +class VcsBaseSubmitEditor; +class VcsBaseSubmitEditorParameters; namespace Internal { -class BaseVCSSubmitEditorFactoryPrivate; +class BaseVcsSubmitEditorFactoryPrivate; } // namespace Internal // Parametrizable base class for editor factories creating instances of -// VCSBaseSubmitEditor subclasses. -class VCSBASE_EXPORT BaseVCSSubmitEditorFactory : public Core::IEditorFactory +// VcsBaseSubmitEditor subclasses. +class VCSBASE_EXPORT BaseVcsSubmitEditorFactory : public Core::IEditorFactory { Q_OBJECT protected: - explicit BaseVCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters); + explicit BaseVcsSubmitEditorFactory(const VcsBaseSubmitEditorParameters *parameters); public: - ~BaseVCSSubmitEditorFactory(); + ~BaseVcsSubmitEditorFactory(); Core::IEditor *createEditor(QWidget *parent); Core::Id id() const; @@ -65,33 +65,33 @@ public: Core::IFile *open(const QString &fileName); private: - virtual VCSBaseSubmitEditor - *createBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters, + virtual VcsBaseSubmitEditor + *createBaseSubmitEditor(const VcsBaseSubmitEditorParameters *parameters, QWidget *parent) = 0; - Internal::BaseVCSSubmitEditorFactoryPrivate *const d; + Internal::BaseVcsSubmitEditorFactoryPrivate *const d; }; // Utility template to create an editor that has a constructor taking the // parameter struct and a parent widget. template <class Editor> -class VCSSubmitEditorFactory : public BaseVCSSubmitEditorFactory +class VcsSubmitEditorFactory : public BaseVcsSubmitEditorFactory { public: - explicit VCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters) - : BaseVCSSubmitEditorFactory(parameters) + explicit VcsSubmitEditorFactory(const VcsBaseSubmitEditorParameters *parameters) + : BaseVcsSubmitEditorFactory(parameters) { } private: - VCSBaseSubmitEditor *createBaseSubmitEditor - (const VCSBaseSubmitEditorParameters *parameters, QWidget *parent) + VcsBaseSubmitEditor *createBaseSubmitEditor + (const VcsBaseSubmitEditorParameters *parameters, QWidget *parent) { return new Editor(parameters, parent); } }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASE_BASEEDITOR_H diff --git a/src/plugins/vcsbase/checkoutjobs.cpp b/src/plugins/vcsbase/checkoutjobs.cpp index cc98a88acc..c69b7ee5ec 100644 --- a/src/plugins/vcsbase/checkoutjobs.cpp +++ b/src/plugins/vcsbase/checkoutjobs.cpp @@ -44,15 +44,15 @@ enum { debug = 0 }; /*! - \class VCSBase::AbstractCheckoutJob + \class VcsBase::AbstractCheckoutJob \brief Abstract base class for a job creating an initial project checkout. It should be something that runs in the background producing log messages. - \sa VCSBase::BaseCheckoutWizard + \sa VcsBase::BaseCheckoutWizard */ -namespace VCSBase { +namespace VcsBase { namespace Internal { @@ -60,7 +60,7 @@ namespace Internal { static inline QSharedPointer<QProcess> createProcess() { unsigned flags = 0; - if (VCSBasePlugin::isSshPromptConfigured()) + if (VcsBasePlugin::isSshPromptConfigured()) flags = Utils::SynchronousProcess::UnixTerminalDisabled; return Utils::SynchronousProcess::createProcess(flags); } @@ -104,9 +104,9 @@ AbstractCheckoutJob::AbstractCheckoutJob(QObject *parent) : } /*! - \class VCSBase::ProcessCheckoutJob + \class VcsBase::ProcessCheckoutJob - \brief Convenience implementation of a VCSBase::AbstractCheckoutJob using a QProcess. + \brief Convenience implementation of a VcsBase::AbstractCheckoutJob using a QProcess. */ ProcessCheckoutJob::ProcessCheckoutJob(QObject *parent) : @@ -195,11 +195,11 @@ void ProcessCheckoutJob::slotNext() // Set up SSH correctly. QProcessEnvironment processEnv = step.environment; - VCSBasePlugin::setProcessEnvironment(&processEnv, false); + VcsBasePlugin::setProcessEnvironment(&processEnv, false); d->process->setProcessEnvironment(processEnv); d->binary = step.binary; - emit output(VCSBaseOutputWindow::msgExecutionLogEntry(step.workingDirectory, d->binary, step.arguments)); + emit output(VcsBaseOutputWindow::msgExecutionLogEntry(step.workingDirectory, d->binary, step.arguments)); d->process->start(d->binary, step.arguments); } @@ -212,4 +212,4 @@ void ProcessCheckoutJob::cancel() Utils::SynchronousProcess::stopProcess(*d->process); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/checkoutjobs.h b/src/plugins/vcsbase/checkoutjobs.h index d2d1446a8d..01ba08ec06 100644 --- a/src/plugins/vcsbase/checkoutjobs.h +++ b/src/plugins/vcsbase/checkoutjobs.h @@ -40,7 +40,7 @@ #include <QtCore/QProcess> #include <QtCore/QProcessEnvironment> -namespace VCSBase { +namespace VcsBase { namespace Internal { class ProcessCheckoutJobPrivate; } @@ -91,6 +91,6 @@ private: Internal::ProcessCheckoutJobPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // CHECKOUTJOB_H diff --git a/src/plugins/vcsbase/checkoutprogresswizardpage.cpp b/src/plugins/vcsbase/checkoutprogresswizardpage.cpp index 30ef57949a..f4ccce10d1 100644 --- a/src/plugins/vcsbase/checkoutprogresswizardpage.cpp +++ b/src/plugins/vcsbase/checkoutprogresswizardpage.cpp @@ -40,15 +40,15 @@ #include <QtGui/QCursor> /*! - \class VCSBase::CheckoutProgressWizardPage + \class VcsBase::CheckoutProgressWizardPage \brief Page showing the progress of an initial project checkout. Turns complete when the job succeeds. - \sa VCSBase::BaseCheckoutWizard + \sa VcsBase::BaseCheckoutWizard */ -namespace VCSBase { +namespace VcsBase { namespace Internal { CheckoutProgressWizardPage::CheckoutProgressWizardPage(QWidget *parent) : @@ -136,4 +136,4 @@ void CheckoutProgressWizardPage::changeEvent(QEvent *e) } } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/checkoutprogresswizardpage.h b/src/plugins/vcsbase/checkoutprogresswizardpage.h index adeb6fab4b..480bc5898a 100644 --- a/src/plugins/vcsbase/checkoutprogresswizardpage.h +++ b/src/plugins/vcsbase/checkoutprogresswizardpage.h @@ -36,7 +36,7 @@ #include <QtCore/QSharedPointer> #include <QtGui/QWizardPage> -namespace VCSBase { +namespace VcsBase { class AbstractCheckoutJob; namespace Internal { @@ -78,6 +78,6 @@ private: }; } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // CHECKOUTPROGRESSWIZARDPAGE_H diff --git a/src/plugins/vcsbase/checkoutprogresswizardpage.ui b/src/plugins/vcsbase/checkoutprogresswizardpage.ui index 02366375d0..c11ddbe46a 100644 --- a/src/plugins/vcsbase/checkoutprogresswizardpage.ui +++ b/src/plugins/vcsbase/checkoutprogresswizardpage.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>VCSBase::Internal::CheckoutProgressWizardPage</class> - <widget class="QWizardPage" name="VCSBase::Internal::CheckoutProgressWizardPage"> + <class>VcsBase::Internal::CheckoutProgressWizardPage</class> + <widget class="QWizardPage" name="VcsBase::Internal::CheckoutProgressWizardPage"> <property name="geometry"> <rect> <x>0</x> diff --git a/src/plugins/vcsbase/checkoutwizarddialog.cpp b/src/plugins/vcsbase/checkoutwizarddialog.cpp index 5d0c00eae9..f0dd7fd6ca 100644 --- a/src/plugins/vcsbase/checkoutwizarddialog.cpp +++ b/src/plugins/vcsbase/checkoutwizarddialog.cpp @@ -40,13 +40,13 @@ #include <QtGui/QPushButton> /*! - \class VCSBase::Internal::CheckoutWizardDialog + \class VcsBase::Internal::CheckoutWizardDialog - Dialog used by \sa VCSBase::BaseCheckoutWizard. Overwrites reject() to first + Dialog used by \sa VcsBase::BaseCheckoutWizard. Overwrites reject() to first kill the checkout and then close. */ -namespace VCSBase { +namespace VcsBase { namespace Internal { CheckoutWizardDialog::CheckoutWizardDialog(const QList<QWizardPage *> ¶meterPages, @@ -95,4 +95,4 @@ void CheckoutWizardDialog::reject() } } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/checkoutwizarddialog.h b/src/plugins/vcsbase/checkoutwizarddialog.h index 6ed9c9c13f..e126e346e8 100644 --- a/src/plugins/vcsbase/checkoutwizarddialog.h +++ b/src/plugins/vcsbase/checkoutwizarddialog.h @@ -37,7 +37,7 @@ #include <QtCore/QList> #include <utils/wizard.h> -namespace VCSBase { +namespace VcsBase { class AbstractCheckoutJob; namespace Internal { @@ -67,6 +67,6 @@ private: }; } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // CHECKOUTWIZARDDIALOG_H diff --git a/src/plugins/vcsbase/cleandialog.cpp b/src/plugins/vcsbase/cleandialog.cpp index c2a1aaaba4..1e78fb3e84 100644 --- a/src/plugins/vcsbase/cleandialog.cpp +++ b/src/plugins/vcsbase/cleandialog.cpp @@ -52,7 +52,7 @@ #include <QtCore/QFuture> #include <QtCore/QtConcurrentRun> -namespace VCSBase { +namespace VcsBase { namespace Internal { enum { nameColumn, columnCount }; @@ -71,14 +71,14 @@ static void removeFileRecursion(const QFileInfo &f, QString *errorMessage) removeFileRecursion(fi, errorMessage); QDir parent = f.absoluteDir(); if (!parent.rmdir(f.fileName())) - errorMessage->append(VCSBase::CleanDialog::tr("The directory %1 could not be deleted."). + errorMessage->append(VcsBase::CleanDialog::tr("The directory %1 could not be deleted."). arg(QDir::toNativeSeparators(f.absoluteFilePath()))); return; } if (!QFile::remove(f.absoluteFilePath())) { if (!errorMessage->isEmpty()) errorMessage->append(QLatin1Char('\n')); - errorMessage->append(VCSBase::CleanDialog::tr("The file %1 could not be deleted."). + errorMessage->append(VcsBase::CleanDialog::tr("The file %1 could not be deleted."). arg(QDir::toNativeSeparators(f.absoluteFilePath()))); } } @@ -145,7 +145,7 @@ CleanDialogPrivate::CleanDialogPrivate() : } // namespace Internal /*! - \class VCSBase::CleanDialog + \class VcsBase::CleanDialog \brief File selector dialog for files not under version control. @@ -258,14 +258,14 @@ bool CleanDialog::promptToDelete() // Remove in background Internal::CleanFilesTask *cleanTask = new Internal::CleanFilesTask(d->m_workingDirectory, selectedFiles); connect(cleanTask, SIGNAL(error(QString)), - VCSBase::VCSBaseOutputWindow::instance(), SLOT(appendSilently(QString)), + VcsBase::VcsBaseOutputWindow::instance(), SLOT(appendSilently(QString)), Qt::QueuedConnection); QFuture<void> task = QtConcurrent::run(cleanTask, &Internal::CleanFilesTask::run); const QString taskName = tr("Cleaning %1"). arg(QDir::toNativeSeparators(d->m_workingDirectory)); Core::ICore::instance()->progressManager()->addTask(task, taskName, - QLatin1String("VCSBase.cleanRepository")); + QLatin1String("VcsBase.cleanRepository")); return true; } @@ -291,6 +291,6 @@ void CleanDialog::changeEvent(QEvent *e) } } -} // namespace VCSBase +} // namespace VcsBase #include "cleandialog.moc" diff --git a/src/plugins/vcsbase/cleandialog.h b/src/plugins/vcsbase/cleandialog.h index 7336214aa1..ceba34dda3 100644 --- a/src/plugins/vcsbase/cleandialog.h +++ b/src/plugins/vcsbase/cleandialog.h @@ -41,7 +41,7 @@ QT_BEGIN_NAMESPACE class QModelIndex; QT_END_NAMESPACE -namespace VCSBase { +namespace VcsBase { namespace Internal { class CleanDialogPrivate; } @@ -71,6 +71,6 @@ private: Internal::CleanDialogPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // CLEANDIALOG_H diff --git a/src/plugins/vcsbase/cleandialog.ui b/src/plugins/vcsbase/cleandialog.ui index c61fec540d..dc679675e7 100644 --- a/src/plugins/vcsbase/cleandialog.ui +++ b/src/plugins/vcsbase/cleandialog.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>VCSBase::Internal::CleanDialog</class> - <widget class="QDialog" name="VCSBase::Internal::CleanDialog"> + <class>VcsBase::Internal::CleanDialog</class> + <widget class="QDialog" name="VcsBase::Internal::CleanDialog"> <property name="geometry"> <rect> <x>0</x> @@ -40,7 +40,7 @@ <connection> <sender>buttonBox</sender> <signal>accepted()</signal> - <receiver>VCSBase::Internal::CleanDialog</receiver> + <receiver>VcsBase::Internal::CleanDialog</receiver> <slot>accept()</slot> <hints> <hint type="sourcelabel"> @@ -56,7 +56,7 @@ <connection> <sender>buttonBox</sender> <signal>rejected()</signal> - <receiver>VCSBase::Internal::CleanDialog</receiver> + <receiver>VcsBase::Internal::CleanDialog</receiver> <slot>reject()</slot> <hints> <hint type="sourcelabel"> diff --git a/src/plugins/vcsbase/command.cpp b/src/plugins/vcsbase/command.cpp index 3edca50562..94d3f6b932 100644 --- a/src/plugins/vcsbase/command.cpp +++ b/src/plugins/vcsbase/command.cpp @@ -59,7 +59,7 @@ static QString msgTermination(int exitCode, const QString &binaryPath, const QSt QCoreApplication::translate("VcsCommand", "\n'%1' completed (exit code %2).\n").arg(cmd).arg(exitCode); } -namespace VCSBase { +namespace VcsBase { namespace Internal { class CommandPrivate @@ -330,4 +330,4 @@ void Command::setCookie(const QVariant &cookie) d->m_cookie = cookie; } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/command.h b/src/plugins/vcsbase/command.h index 99293aa1d7..5fc26c92b8 100644 --- a/src/plugins/vcsbase/command.h +++ b/src/plugins/vcsbase/command.h @@ -40,7 +40,7 @@ #include <QtCore/QVariant> #include <QtCore/QProcessEnvironment> -namespace VCSBase { +namespace VcsBase { namespace Internal { class CommandPrivate; } @@ -105,6 +105,6 @@ private: class Internal::CommandPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASE_COMMAND_H diff --git a/src/plugins/vcsbase/commonsettingspage.cpp b/src/plugins/vcsbase/commonsettingspage.cpp index f006c86b98..91768c7a24 100644 --- a/src/plugins/vcsbase/commonsettingspage.cpp +++ b/src/plugins/vcsbase/commonsettingspage.cpp @@ -43,10 +43,10 @@ #include <QtCore/QCoreApplication> #include <QtGui/QMessageBox> -namespace VCSBase { +namespace VcsBase { namespace Internal { -// ------------------ VCSBaseSettingsWidget +// ------------------ VcsBaseSettingsWidget CommonSettingsWidget::CommonSettingsWidget(QWidget *parent) : QWidget(parent), @@ -105,9 +105,9 @@ QString CommonSettingsWidget::searchKeyWordMatchString() const return rc; } -// --------------- VCSBaseSettingsPage +// --------------- VcsBaseSettingsPage CommonOptionsPage::CommonOptionsPage(QObject *parent) : - VCSBaseOptionsPage(parent) + VcsBaseOptionsPage(parent) { m_settings.fromSettings(Core::ICore::instance()->settings()); } @@ -123,7 +123,7 @@ QString CommonOptionsPage::id() const QString CommonOptionsPage::displayName() const { - return QCoreApplication::translate("VCSBase", Constants::VCS_COMMON_SETTINGS_NAME); + return QCoreApplication::translate("VcsBase", Constants::VCS_COMMON_SETTINGS_NAME); } QWidget *CommonOptionsPage::createPage(QWidget *parent) @@ -153,4 +153,4 @@ bool CommonOptionsPage::matches(const QString &key) const } } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/commonsettingspage.h b/src/plugins/vcsbase/commonsettingspage.h index 5cd689f3c7..cae9d0cec4 100644 --- a/src/plugins/vcsbase/commonsettingspage.h +++ b/src/plugins/vcsbase/commonsettingspage.h @@ -40,7 +40,7 @@ #include <QtCore/QPointer> #include <QtGui/QWidget> -namespace VCSBase { +namespace VcsBase { namespace Internal { namespace Ui { class CommonSettingsPage; } @@ -62,7 +62,7 @@ private: Ui::CommonSettingsPage *m_ui; }; -class CommonOptionsPage : public VCSBaseOptionsPage +class CommonOptionsPage : public VcsBaseOptionsPage { Q_OBJECT @@ -80,7 +80,7 @@ public: CommonVcsSettings settings() const { return m_settings; } signals: - void settingsChanged(const VCSBase::Internal::CommonVcsSettings &s); + void settingsChanged(const VcsBase::Internal::CommonVcsSettings &s); private: void updateNickNames(); @@ -91,6 +91,6 @@ private: }; } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // COMMONOPTIONSPAGE_H diff --git a/src/plugins/vcsbase/commonsettingspage.ui b/src/plugins/vcsbase/commonsettingspage.ui index 1ab6270a77..b9e3e1a4d7 100644 --- a/src/plugins/vcsbase/commonsettingspage.ui +++ b/src/plugins/vcsbase/commonsettingspage.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>VCSBase::Internal::CommonSettingsPage</class> - <widget class="QWidget" name="VCSBase::Internal::CommonSettingsPage"> + <class>VcsBase::Internal::CommonSettingsPage</class> + <widget class="QWidget" name="VcsBase::Internal::CommonSettingsPage"> <property name="geometry"> <rect> <x>0</x> diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index 403eb30992..c317cc04dc 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -61,7 +61,7 @@ static inline QString sshPasswordPromptDefault() #endif } -namespace VCSBase { +namespace VcsBase { namespace Internal { CommonVcsSettings::CommonVcsSettings() : @@ -128,4 +128,4 @@ QDebug operator<<(QDebug d,const CommonVcsSettings& s) } } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/commonvcssettings.h b/src/plugins/vcsbase/commonvcssettings.h index 6315b5a588..f8849516b6 100644 --- a/src/plugins/vcsbase/commonvcssettings.h +++ b/src/plugins/vcsbase/commonvcssettings.h @@ -40,7 +40,7 @@ class QSettings; class QDebug; QT_END_NAMESPACE -namespace VCSBase { +namespace VcsBase { namespace Internal { // Common VCS settings, message check script and user nick names. @@ -74,6 +74,6 @@ inline bool operator!=(const CommonVcsSettings &s1, const CommonVcsSettings &s2) QDebug operator<<(QDebug, const CommonVcsSettings &); } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // COMMONVCSSETTINGS_H diff --git a/src/plugins/vcsbase/corelistener.cpp b/src/plugins/vcsbase/corelistener.cpp index 4007108949..1d243f4045 100644 --- a/src/plugins/vcsbase/corelistener.cpp +++ b/src/plugins/vcsbase/corelistener.cpp @@ -34,17 +34,17 @@ #include "vcsbasesubmiteditor.h" /*! - \class VCSBase::Internal::CoreListener + \class VcsBase::Internal::CoreListener \brief CoreListener catching closing of a submit editor. Catch the closing of a submit editor to trigger the submit. One instance of this class exists, connected to the instances - of VCSBasePlugin, which dispatch if the editor kind matches theirs + of VcsBasePlugin, which dispatch if the editor kind matches theirs (which is why the approach of passing the bool result was chosen). */ -namespace VCSBase { +namespace VcsBase { namespace Internal { CoreListener::CoreListener(QObject *parent) : @@ -56,10 +56,10 @@ bool CoreListener::editorAboutToClose(Core::IEditor *editor) { bool result = true; if (editor) - if (VCSBase::VCSBaseSubmitEditor *se = qobject_cast<VCSBase::VCSBaseSubmitEditor *>(editor)) + if (VcsBase::VcsBaseSubmitEditor *se = qobject_cast<VcsBase::VcsBaseSubmitEditor *>(editor)) emit submitEditorAboutToClose(se, &result); return result; } } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/corelistener.h b/src/plugins/vcsbase/corelistener.h index 597d77419f..ff40923b92 100644 --- a/src/plugins/vcsbase/corelistener.h +++ b/src/plugins/vcsbase/corelistener.h @@ -35,9 +35,9 @@ #include <coreplugin/icorelistener.h> -namespace VCSBase { +namespace VcsBase { -class VCSBaseSubmitEditor; +class VcsBaseSubmitEditor; namespace Internal { @@ -50,10 +50,10 @@ public: bool editorAboutToClose(Core::IEditor *editor); signals: - void submitEditorAboutToClose(VCSBaseSubmitEditor *e, bool *result); + void submitEditorAboutToClose(VcsBaseSubmitEditor *e, bool *result); }; -} // Internal -} // VCSBase +} // namespace Internal +} // namespace VcsBase #endif // CORELISTENER_H diff --git a/src/plugins/vcsbase/diffhighlighter.cpp b/src/plugins/vcsbase/diffhighlighter.cpp index 5c6eefb215..66b7267002 100644 --- a/src/plugins/vcsbase/diffhighlighter.cpp +++ b/src/plugins/vcsbase/diffhighlighter.cpp @@ -42,7 +42,7 @@ #include <QtGui/QBrush> /*! - \class VCSBase::DiffHighlighter + \class VcsBase::DiffHighlighter \brief A highlighter for diffs. @@ -67,7 +67,7 @@ static const int BASE_LEVEL = 0; static const int FILE_LEVEL = 1; static const int LOCATION_LEVEL = 2; -namespace VCSBase { +namespace VcsBase { namespace Internal { // Formats used by DiffHighlighter @@ -264,4 +264,4 @@ QRegExp DiffHighlighter::filePattern() const return d->m_filePattern; } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/diffhighlighter.h b/src/plugins/vcsbase/diffhighlighter.h index e9311fa8dc..c8d9d22345 100644 --- a/src/plugins/vcsbase/diffhighlighter.h +++ b/src/plugins/vcsbase/diffhighlighter.h @@ -45,7 +45,7 @@ QT_END_NAMESPACE namespace Core { class ICore; } namespace TextEditor { class FontSettingsPage; } -namespace VCSBase { +namespace VcsBase { namespace Internal { class DiffHighlighterPrivate; } @@ -69,6 +69,6 @@ private: Internal::DiffHighlighterPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // DIFFHIGHLIGHTER_H diff --git a/src/plugins/vcsbase/nicknamedialog.cpp b/src/plugins/vcsbase/nicknamedialog.cpp index f473fb62f4..37ae26b66b 100644 --- a/src/plugins/vcsbase/nicknamedialog.cpp +++ b/src/plugins/vcsbase/nicknamedialog.cpp @@ -45,7 +45,7 @@ enum { NickNameRole = Qt::UserRole + 1 }; /*! - \class VCSBase::Internal::NickNameDialog + \class VcsBase::Internal::NickNameDialog \brief Show users from mail cap file. @@ -56,7 +56,7 @@ enum { NickNameRole = Qt::UserRole + 1 }; be preferred. */ -namespace VCSBase { +namespace VcsBase { namespace Internal { // For code clarity, a struct representing the entries of a mail map file @@ -278,4 +278,4 @@ QStringList NickNameDialog::nickNameList(const QStandardItemModel *model) } } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/nicknamedialog.h b/src/plugins/vcsbase/nicknamedialog.h index 9558fb1e5a..e37070eb3b 100644 --- a/src/plugins/vcsbase/nicknamedialog.h +++ b/src/plugins/vcsbase/nicknamedialog.h @@ -42,7 +42,7 @@ class QModelIndex; class QPushButton; QT_END_NAMESPACE -namespace VCSBase { +namespace VcsBase { namespace Internal { namespace Ui { class NickNameDialog; } @@ -79,6 +79,6 @@ private: }; } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // NICKNAMEDIALOG_H diff --git a/src/plugins/vcsbase/nicknamedialog.ui b/src/plugins/vcsbase/nicknamedialog.ui index 9e0673e757..8cc4b2af45 100644 --- a/src/plugins/vcsbase/nicknamedialog.ui +++ b/src/plugins/vcsbase/nicknamedialog.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>VCSBase::Internal::NickNameDialog</class> - <widget class="QDialog" name="VCSBase::Internal::NickNameDialog"> + <class>VcsBase::Internal::NickNameDialog</class> + <widget class="QDialog" name="VcsBase::Internal::NickNameDialog"> <property name="geometry"> <rect> <x>0</x> @@ -49,7 +49,7 @@ <connection> <sender>buttonBox</sender> <signal>accepted()</signal> - <receiver>VCSBase::Internal::NickNameDialog</receiver> + <receiver>VcsBase::Internal::NickNameDialog</receiver> <slot>accept()</slot> <hints> <hint type="sourcelabel"> @@ -65,7 +65,7 @@ <connection> <sender>buttonBox</sender> <signal>rejected()</signal> - <receiver>VCSBase::Internal::NickNameDialog</receiver> + <receiver>VcsBase::Internal::NickNameDialog</receiver> <slot>reject()</slot> <hints> <hint type="sourcelabel"> diff --git a/src/plugins/vcsbase/submiteditorfile.cpp b/src/plugins/vcsbase/submiteditorfile.cpp index 0101e9e660..b2069ec8d7 100644 --- a/src/plugins/vcsbase/submiteditorfile.cpp +++ b/src/plugins/vcsbase/submiteditorfile.cpp @@ -32,11 +32,11 @@ #include "submiteditorfile.h" -using namespace VCSBase; -using namespace VCSBase::Internal; +using namespace VcsBase; +using namespace VcsBase::Internal; /*! - \class VCSBase::Internal::SubmitEditorFile + \class VcsBase::Internal::SubmitEditorFile \brief A non-saveable IFile for submit editor files. */ diff --git a/src/plugins/vcsbase/submiteditorfile.h b/src/plugins/vcsbase/submiteditorfile.h index 4390ab86f4..df177acd91 100644 --- a/src/plugins/vcsbase/submiteditorfile.h +++ b/src/plugins/vcsbase/submiteditorfile.h @@ -35,7 +35,7 @@ #include <coreplugin/ifile.h> -namespace VCSBase { +namespace VcsBase { namespace Internal { class SubmitEditorFile : public Core::IFile @@ -72,6 +72,6 @@ private: } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // SUBMITEDITORFILE_H diff --git a/src/plugins/vcsbase/submitfilemodel.cpp b/src/plugins/vcsbase/submitfilemodel.cpp index b7af1b1daa..71beb55699 100644 --- a/src/plugins/vcsbase/submitfilemodel.cpp +++ b/src/plugins/vcsbase/submitfilemodel.cpp @@ -39,7 +39,7 @@ #include <QtCore/QFileInfo> #include <QtCore/QDebug> -namespace VCSBase { +namespace VcsBase { // -------------------------------------------------------------------------- // Helpers: @@ -66,7 +66,7 @@ static QList<QStandardItem *> createFileRow(const QString &fileName, const QStri // -------------------------------------------------------------------------- /*! - \class VCSBase::SubmitFileModel + \class VcsBase::SubmitFileModel \brief A 2-column (checkable, state, file name) model to be used to list the files in the submit editor. Provides header items and a convience to add files. @@ -157,4 +157,4 @@ unsigned SubmitFileModel::filter(const QStringList &filter, int column) return rc; } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/submitfilemodel.h b/src/plugins/vcsbase/submitfilemodel.h index 0d590ae4e3..e51881e2d6 100644 --- a/src/plugins/vcsbase/submitfilemodel.h +++ b/src/plugins/vcsbase/submitfilemodel.h @@ -37,7 +37,7 @@ #include <QtGui/QStandardItemModel> -namespace VCSBase { +namespace VcsBase { class VCSBASE_EXPORT SubmitFileModel : public QStandardItemModel { @@ -67,6 +67,6 @@ public: unsigned filter(const QStringList &filter, int column); }; -} // namespace VCSBase +} // namespace VcsBase #endif // SUBMITMODEL_H diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index b64a77acd2..3e7c076ad4 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -58,13 +58,13 @@ #include <QtCore/QMetaType> /*! - \class VCSBase::VCSBaseClient + \class VcsBase::VcsBaseClient \brief Base class for Mercurial and Bazaar 'clients'. Provides base functionality for common commands (diff, log, etc). - \sa VCSBase::VCSJobRunner + \sa VcsBase::VcsJobRunner */ Q_DECLARE_METATYPE(QVariant) @@ -79,36 +79,36 @@ inline Core::IEditor *locateEditor(const Core::ICore *core, const char *property namespace { -VCSBase::VCSBaseOutputWindow *vcsOutputWindow() +VcsBase::VcsBaseOutputWindow *vcsOutputWindow() { - return VCSBase::VCSBaseOutputWindow::instance(); + return VcsBase::VcsBaseOutputWindow::instance(); } } -namespace VCSBase { +namespace VcsBase { -class VCSBaseClientPrivate +class VcsBaseClientPrivate { public: - VCSBaseClientPrivate(VCSBaseClient *client, VCSBaseClientSettings *settings); + VcsBaseClientPrivate(VcsBaseClient *client, VcsBaseClientSettings *settings); void statusParser(QByteArray data); void annotateRevision(QString source, QString change, int lineNumber); void saveSettings(); - void bindCommandToEditor(Command *cmd, VCSBaseEditorWidget *editor); + void bindCommandToEditor(Command *cmd, VcsBaseEditorWidget *editor); void commandFinishedGotoLine(QObject *editorObject); Core::ICore *m_core; - VCSBaseClientSettings *m_clientSettings; + VcsBaseClientSettings *m_clientSettings; QSignalMapper *m_cmdFinishedMapper; private: - VCSBaseClient *m_client; + VcsBaseClient *m_client; }; -VCSBaseClientPrivate::VCSBaseClientPrivate(VCSBaseClient *client, VCSBaseClientSettings *settings) : +VcsBaseClientPrivate::VcsBaseClientPrivate(VcsBaseClient *client, VcsBaseClientSettings *settings) : m_core(Core::ICore::instance()), m_clientSettings(settings), m_cmdFinishedMapper(new QSignalMapper(client)), @@ -116,14 +116,14 @@ VCSBaseClientPrivate::VCSBaseClientPrivate(VCSBaseClient *client, VCSBaseClientS { } -void VCSBaseClientPrivate::statusParser(QByteArray data) +void VcsBaseClientPrivate::statusParser(QByteArray data) { - QList<VCSBaseClient::StatusItem> lineInfoList; + QList<VcsBaseClient::StatusItem> lineInfoList; QStringList rawStatusList = QTextCodec::codecForLocale()->toUnicode(data).split(QLatin1Char('\n')); foreach (const QString &string, rawStatusList) { - const VCSBaseClient::StatusItem lineInfo = m_client->parseStatusLine(string); + const VcsBaseClient::StatusItem lineInfo = m_client->parseStatusLine(string); if (!lineInfo.flags.isEmpty() && !lineInfo.file.isEmpty()) lineInfoList.append(lineInfo); } @@ -131,7 +131,7 @@ void VCSBaseClientPrivate::statusParser(QByteArray data) emit m_client->parsedStatus(lineInfoList); } -void VCSBaseClientPrivate::annotateRevision(QString source, QString change, int lineNumber) +void VcsBaseClientPrivate::annotateRevision(QString source, QString change, int lineNumber) { // This might be invoked with a verbose revision description // "SHA1 author subject" from the annotation context menu. Strip the rest. @@ -142,20 +142,20 @@ void VCSBaseClientPrivate::annotateRevision(QString source, QString change, int m_client->annotate(fi.absolutePath(), fi.fileName(), change, lineNumber); } -void VCSBaseClientPrivate::saveSettings() +void VcsBaseClientPrivate::saveSettings() { m_clientSettings->writeSettings(m_core->settings()); } -void VCSBaseClientPrivate::bindCommandToEditor(Command *cmd, VCSBaseEditorWidget *editor) +void VcsBaseClientPrivate::bindCommandToEditor(Command *cmd, VcsBaseEditorWidget *editor) { QObject::connect(cmd, SIGNAL(finished(bool,int,QVariant)), m_cmdFinishedMapper, SLOT(map())); m_cmdFinishedMapper->setMapping(cmd, editor); } -void VCSBaseClientPrivate::commandFinishedGotoLine(QObject *editorObject) +void VcsBaseClientPrivate::commandFinishedGotoLine(QObject *editorObject) { - VCSBase::VCSBaseEditorWidget *editor = qobject_cast<VCSBase::VCSBaseEditorWidget *>(editorObject); + VcsBase::VcsBaseEditorWidget *editor = qobject_cast<VcsBase::VcsBaseEditorWidget *>(editorObject); Command *cmd = qobject_cast<Command *>(m_cmdFinishedMapper->mapping(editor)); if (editor && cmd) { if (cmd->lastExecutionSuccess() && cmd->cookie().type() == QVariant::Int) { @@ -167,25 +167,25 @@ void VCSBaseClientPrivate::commandFinishedGotoLine(QObject *editorObject) } } -VCSBaseClient::StatusItem::StatusItem(const QString &s, const QString &f) : +VcsBaseClient::StatusItem::StatusItem(const QString &s, const QString &f) : flags(s), file(f) { } -VCSBaseClient::VCSBaseClient(VCSBaseClientSettings *settings) : - d(new VCSBaseClientPrivate(this, settings)) +VcsBaseClient::VcsBaseClient(VcsBaseClientSettings *settings) : + d(new VcsBaseClientPrivate(this, settings)) { qRegisterMetaType<QVariant>(); connect(d->m_core, SIGNAL(saveSettingsRequested()), this, SLOT(saveSettings())); connect(d->m_cmdFinishedMapper, SIGNAL(mapped(QObject*)), this, SLOT(commandFinishedGotoLine(QObject*))); } -VCSBaseClient::~VCSBaseClient() +VcsBaseClient::~VcsBaseClient() { delete d; } -bool VCSBaseClient::synchronousCreateRepository(const QString &workingDirectory, +bool VcsBaseClient::synchronousCreateRepository(const QString &workingDirectory, const QStringList &extraOptions) { QStringList args(vcsCommandString(CreateRepositoryCommand)); @@ -202,7 +202,7 @@ bool VCSBaseClient::synchronousCreateRepository(const QString &workingDirectory, return true; } -bool VCSBaseClient::synchronousClone(const QString &workingDir, +bool VcsBaseClient::synchronousClone(const QString &workingDir, const QString &srcLocation, const QString &dstLocation, const QStringList &extraOptions) @@ -216,7 +216,7 @@ bool VCSBaseClient::synchronousClone(const QString &workingDir, return cloneOk; } -bool VCSBaseClient::synchronousAdd(const QString &workingDir, const QString &filename, +bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &filename, const QStringList &extraOptions) { QStringList args; @@ -225,7 +225,7 @@ bool VCSBaseClient::synchronousAdd(const QString &workingDir, const QString &fil return vcsFullySynchronousExec(workingDir, args, &stdOut); } -bool VCSBaseClient::synchronousRemove(const QString &workingDir, const QString &filename, +bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &filename, const QStringList &extraOptions) { QStringList args; @@ -234,7 +234,7 @@ bool VCSBaseClient::synchronousRemove(const QString &workingDir, const QString & return vcsFullySynchronousExec(workingDir, args, &stdOut); } -bool VCSBaseClient::synchronousMove(const QString &workingDir, +bool VcsBaseClient::synchronousMove(const QString &workingDir, const QString &from, const QString &to, const QStringList &extraOptions) { @@ -244,7 +244,7 @@ bool VCSBaseClient::synchronousMove(const QString &workingDir, return vcsFullySynchronousExec(workingDir, args, &stdOut); } -bool VCSBaseClient::synchronousPull(const QString &workingDir, +bool VcsBaseClient::synchronousPull(const QString &workingDir, const QString &srcLocation, const QStringList &extraOptions) { @@ -252,9 +252,9 @@ bool VCSBaseClient::synchronousPull(const QString &workingDir, args << vcsCommandString(PullCommand) << extraOptions << srcLocation; // Disable UNIX terminals to suppress SSH prompting const unsigned flags = - VCSBase::VCSBasePlugin::SshPasswordPrompt - | VCSBase::VCSBasePlugin::ShowStdOutInLogWindow - | VCSBase::VCSBasePlugin::ShowSuccessMessage; + VcsBase::VcsBasePlugin::SshPasswordPrompt + | VcsBase::VcsBasePlugin::ShowStdOutInLogWindow + | VcsBase::VcsBasePlugin::ShowSuccessMessage; const Utils::SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags); const bool ok = resp.result == Utils::SynchronousProcessResponse::Finished; if (ok) @@ -262,7 +262,7 @@ bool VCSBaseClient::synchronousPull(const QString &workingDir, return ok; } -bool VCSBaseClient::synchronousPush(const QString &workingDir, +bool VcsBaseClient::synchronousPush(const QString &workingDir, const QString &dstLocation, const QStringList &extraOptions) { @@ -270,14 +270,14 @@ bool VCSBaseClient::synchronousPush(const QString &workingDir, args << vcsCommandString(PushCommand) << extraOptions << dstLocation; // Disable UNIX terminals to suppress SSH prompting const unsigned flags = - VCSBase::VCSBasePlugin::SshPasswordPrompt - | VCSBase::VCSBasePlugin::ShowStdOutInLogWindow - | VCSBase::VCSBasePlugin::ShowSuccessMessage; + VcsBase::VcsBasePlugin::SshPasswordPrompt + | VcsBase::VcsBasePlugin::ShowStdOutInLogWindow + | VcsBase::VcsBasePlugin::ShowSuccessMessage; const Utils::SynchronousProcessResponse resp = vcsSynchronousExec(workingDir, args, flags); return resp.result == Utils::SynchronousProcessResponse::Finished; } -bool VCSBaseClient::vcsFullySynchronousExec(const QString &workingDir, +bool VcsBaseClient::vcsFullySynchronousExec(const QString &workingDir, const QStringList &args, QByteArray *output) { @@ -286,7 +286,7 @@ bool VCSBaseClient::vcsFullySynchronousExec(const QString &workingDir, vcsProcess.setWorkingDirectory(workingDir); vcsProcess.setProcessEnvironment(processEnvironment()); - const QString binary = settings()->stringValue(VCSBaseClientSettings::binaryPathKey); + const QString binary = settings()->stringValue(VcsBaseClientSettings::binaryPathKey); ::vcsOutputWindow()->appendCommand(workingDir, binary, args); @@ -301,7 +301,7 @@ bool VCSBaseClient::vcsFullySynchronousExec(const QString &workingDir, vcsProcess.closeWriteChannel(); QByteArray stdErr; - const int timeoutSec = settings()->intValue(VCSBaseClientSettings::timeoutKey); + const int timeoutSec = settings()->intValue(VcsBaseClientSettings::timeoutKey); if (!Utils::SynchronousProcess::readDataFromProcess(vcsProcess, timeoutSec * 1000, output, &stdErr, true)) { Utils::SynchronousProcess::stopProcess(vcsProcess); @@ -315,19 +315,19 @@ bool VCSBaseClient::vcsFullySynchronousExec(const QString &workingDir, return vcsProcess.exitStatus() == QProcess::NormalExit && vcsProcess.exitCode() == 0; } -Utils::SynchronousProcessResponse VCSBaseClient::vcsSynchronousExec( +Utils::SynchronousProcessResponse VcsBaseClient::vcsSynchronousExec( const QString &workingDirectory, const QStringList &args, unsigned flags, QTextCodec *outputCodec) { - const QString binary = settings()->stringValue(VCSBaseClientSettings::binaryPathKey); - const int timeoutSec = settings()->intValue(VCSBaseClientSettings::timeoutKey); - return VCSBase::VCSBasePlugin::runVCS(workingDirectory, binary, args, + const QString binary = settings()->stringValue(VcsBaseClientSettings::binaryPathKey); + const int timeoutSec = settings()->intValue(VcsBaseClientSettings::timeoutKey); + return VcsBase::VcsBasePlugin::runVcs(workingDirectory, binary, args, timeoutSec * 1000, flags, outputCodec); } -void VCSBaseClient::annotate(const QString &workingDir, const QString &file, +void VcsBaseClient::annotate(const QString &workingDir, const QString &file, const QString revision /* = QString() */, int lineNumber /* = -1 */, const QStringList &extraOptions) @@ -337,11 +337,11 @@ void VCSBaseClient::annotate(const QString &workingDir, const QString &file, QStringList args; args << vcsCmdString << revisionSpec(revision) << extraOptions << file; const QString kind = vcsEditorKind(AnnotateCommand); - const QString id = VCSBase::VCSBaseEditorWidget::getSource(workingDir, QStringList(file)); + const QString id = VcsBase::VcsBaseEditorWidget::getSource(workingDir, QStringList(file)); const QString title = vcsEditorTitle(vcsCmdString, id); - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, file); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, file); - VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, source, true, + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true, vcsCmdString.toLatin1().constData(), id); Command *cmd = createCommand(workingDir, editor); @@ -349,22 +349,22 @@ void VCSBaseClient::annotate(const QString &workingDir, const QString &file, enqueueJob(cmd, args); } -void VCSBaseClient::diff(const QString &workingDir, const QStringList &files, +void VcsBaseClient::diff(const QString &workingDir, const QStringList &files, const QStringList &extraOptions) { const QString vcsCmdString = vcsCommandString(DiffCommand); const QString kind = vcsEditorKind(DiffCommand); - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, files); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files); const QString title = vcsEditorTitle(vcsCmdString, id); - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, files); - VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, source, true, + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true, vcsCmdString.toLatin1().constData(), id); editor->setRevertDiffChunkEnabled(true); editor->setDiffBaseDirectory(workingDir); - VCSBaseEditorParameterWidget *paramWidget = createDiffEditor(workingDir, files, extraOptions); + VcsBaseEditorParameterWidget *paramWidget = createDiffEditor(workingDir, files, extraOptions); if (paramWidget != 0) { - connect(editor, SIGNAL(diffChunkReverted(VCSBase::DiffChunk)), + connect(editor, SIGNAL(diffChunkReverted(VcsBase::DiffChunk)), paramWidget, SLOT(executeCommand())); editor->setConfigurationWidget(paramWidget); } @@ -375,21 +375,21 @@ void VCSBaseClient::diff(const QString &workingDir, const QStringList &files, enqueueJob(createCommand(workingDir, editor), args); } -void VCSBaseClient::log(const QString &workingDir, const QStringList &files, +void VcsBaseClient::log(const QString &workingDir, const QStringList &files, const QStringList &extraOptions, bool enableAnnotationContextMenu) { const QString vcsCmdString = vcsCommandString(LogCommand); const QString kind = vcsEditorKind(LogCommand); - const QString id = VCSBase::VCSBaseEditorWidget::getTitleId(workingDir, files); + const QString id = VcsBase::VcsBaseEditorWidget::getTitleId(workingDir, files); const QString title = vcsEditorTitle(vcsCmdString, id); - const QString source = VCSBase::VCSBaseEditorWidget::getSource(workingDir, files); + const QString source = VcsBase::VcsBaseEditorWidget::getSource(workingDir, files); - VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, source, true, + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true, vcsCmdString.toLatin1().constData(), id); editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu); - VCSBaseEditorParameterWidget *paramWidget = createLogEditor(workingDir, files, extraOptions); + VcsBaseEditorParameterWidget *paramWidget = createLogEditor(workingDir, files, extraOptions); if (paramWidget != 0) editor->setConfigurationWidget(paramWidget); @@ -399,7 +399,7 @@ void VCSBaseClient::log(const QString &workingDir, const QStringList &files, enqueueJob(createCommand(workingDir, editor), args); } -void VCSBaseClient::revertFile(const QString &workingDir, +void VcsBaseClient::revertFile(const QString &workingDir, const QString &file, const QString &revision, const QStringList &extraOptions) @@ -413,7 +413,7 @@ void VCSBaseClient::revertFile(const QString &workingDir, enqueueJob(cmd, args); } -void VCSBaseClient::revertAll(const QString &workingDir, const QString &revision, +void VcsBaseClient::revertAll(const QString &workingDir, const QString &revision, const QStringList &extraOptions) { QStringList args(vcsCommandString(RevertCommand)); @@ -425,7 +425,7 @@ void VCSBaseClient::revertAll(const QString &workingDir, const QString &revision enqueueJob(createCommand(workingDir), args); } -void VCSBaseClient::status(const QString &workingDir, const QString &file, +void VcsBaseClient::status(const QString &workingDir, const QString &file, const QStringList &extraOptions) { QStringList args(vcsCommandString(StatusCommand)); @@ -437,7 +437,7 @@ void VCSBaseClient::status(const QString &workingDir, const QString &file, enqueueJob(cmd, args); } -void VCSBaseClient::emitParsedStatus(const QString &repository, const QStringList &extraOptions) +void VcsBaseClient::emitParsedStatus(const QString &repository, const QStringList &extraOptions) { QStringList args(vcsCommandString(StatusCommand)); args << extraOptions; @@ -446,7 +446,7 @@ void VCSBaseClient::emitParsedStatus(const QString &repository, const QStringLis enqueueJob(cmd, args); } -QString VCSBaseClient::vcsCommandString(VCSCommand cmd) const +QString VcsBaseClient::vcsCommandString(VcsCommand cmd) const { switch (cmd) { case CreateRepositoryCommand: return QLatin1String("init"); @@ -468,7 +468,7 @@ QString VCSBaseClient::vcsCommandString(VCSCommand cmd) const return QString(); } -void VCSBaseClient::import(const QString &repositoryRoot, const QStringList &files, +void VcsBaseClient::import(const QString &repositoryRoot, const QStringList &files, const QStringList &extraOptions) { QStringList args(vcsCommandString(ImportCommand)); @@ -476,7 +476,7 @@ void VCSBaseClient::import(const QString &repositoryRoot, const QStringList &fil enqueueJob(createCommand(repositoryRoot), args); } -void VCSBaseClient::view(const QString &source, const QString &id, +void VcsBaseClient::view(const QString &source, const QString &id, const QStringList &extraOptions) { QStringList args; @@ -484,7 +484,7 @@ void VCSBaseClient::view(const QString &source, const QString &id, const QString kind = vcsEditorKind(DiffCommand); const QString title = vcsEditorTitle(vcsCommandString(LogCommand), id); - VCSBase::VCSBaseEditorWidget *editor = createVCSEditor(kind, title, source, + VcsBase::VcsBaseEditorWidget *editor = createVcsEditor(kind, title, source, true, "view", id); const QFileInfo fi(source); @@ -492,29 +492,29 @@ void VCSBaseClient::view(const QString &source, const QString &id, enqueueJob(createCommand(workingDirPath, editor), args); } -void VCSBaseClient::update(const QString &repositoryRoot, const QString &revision, +void VcsBaseClient::update(const QString &repositoryRoot, const QString &revision, const QStringList &extraOptions) { QStringList args(vcsCommandString(UpdateCommand)); args << revisionSpec(revision) << extraOptions; Command *cmd = createCommand(repositoryRoot); cmd->setCookie(repositoryRoot); - cmd->setUnixTerminalDisabled(VCSBase::VCSBasePlugin::isSshPromptConfigured()); + cmd->setUnixTerminalDisabled(VcsBase::VcsBasePlugin::isSshPromptConfigured()); connect(cmd, SIGNAL(success(QVariant)), this, SIGNAL(changed(QVariant)), Qt::QueuedConnection); enqueueJob(cmd, args); } -void VCSBaseClient::commit(const QString &repositoryRoot, +void VcsBaseClient::commit(const QString &repositoryRoot, const QStringList &files, const QString &commitMessageFile, const QStringList &extraOptions) { // Handling of commitMessageFile is a bit tricky : - // VCSBaseClient cannot do something with it because it doesn't know which + // VcsBaseClient cannot do something with it because it doesn't know which // option to use (-F ? but sub VCS clients might require a different option // name like -l for hg ...) // - // So descendants of VCSBaseClient *must* redefine commit() and extend + // So descendants of VcsBaseClient *must* redefine commit() and extend // extraOptions with the usage for commitMessageFile (see BazaarClient::commit() // for example) Q_UNUSED(commitMessageFile); @@ -523,12 +523,12 @@ void VCSBaseClient::commit(const QString &repositoryRoot, enqueueJob(createCommand(repositoryRoot), args); } -VCSBaseClientSettings *VCSBaseClient::settings() const +VcsBaseClientSettings *VcsBaseClient::settings() const { return d->m_clientSettings; } -VCSBaseEditorParameterWidget *VCSBaseClient::createDiffEditor(const QString &workingDir, +VcsBaseEditorParameterWidget *VcsBaseClient::createDiffEditor(const QString &workingDir, const QStringList &files, const QStringList &extraOptions) { @@ -538,7 +538,7 @@ VCSBaseEditorParameterWidget *VCSBaseClient::createDiffEditor(const QString &wor return 0; } -VCSBaseEditorParameterWidget *VCSBaseClient::createLogEditor(const QString &workingDir, +VcsBaseEditorParameterWidget *VcsBaseClient::createLogEditor(const QString &workingDir, const QStringList &files, const QStringList &extraOptions) { @@ -548,37 +548,37 @@ VCSBaseEditorParameterWidget *VCSBaseClient::createLogEditor(const QString &work return 0; } -QString VCSBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sourceId) const +QString VcsBaseClient::vcsEditorTitle(const QString &vcsCmd, const QString &sourceId) const { - const QString binary = settings()->stringValue(VCSBaseClientSettings::binaryPathKey); + const QString binary = settings()->stringValue(VcsBaseClientSettings::binaryPathKey); return QFileInfo(binary).baseName() + QLatin1Char(' ') + vcsCmd + QLatin1Char(' ') + QFileInfo(sourceId).fileName(); } -VCSBase::VCSBaseEditorWidget *VCSBaseClient::createVCSEditor(const QString &kind, QString title, +VcsBase::VcsBaseEditorWidget *VcsBaseClient::createVcsEditor(const QString &kind, QString title, const QString &source, bool setSourceCodec, const char *registerDynamicProperty, const QString &dynamicPropertyValue) const { - VCSBase::VCSBaseEditorWidget *baseEditor = 0; + VcsBase::VcsBaseEditorWidget *baseEditor = 0; Core::IEditor *outputEditor = locateEditor(d->m_core, registerDynamicProperty, dynamicPropertyValue); const QString progressMsg = tr("Working..."); if (outputEditor) { // Exists already outputEditor->createNew(progressMsg); - baseEditor = VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(outputEditor); + baseEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); QTC_ASSERT(baseEditor, return 0); } else { outputEditor = d->m_core->editorManager()->openEditorWithContents(Core::Id(kind), &title, progressMsg); outputEditor->file()->setProperty(registerDynamicProperty, dynamicPropertyValue); - baseEditor = VCSBase::VCSBaseEditorWidget::getVcsBaseEditor(outputEditor); + baseEditor = VcsBase::VcsBaseEditorWidget::getVcsBaseEditor(outputEditor); connect(baseEditor, SIGNAL(annotateRevisionRequested(QString,QString,int)), this, SLOT(annotateRevision(QString,QString,int))); QTC_ASSERT(baseEditor, return 0); baseEditor->setSource(source); if (setSourceCodec) - baseEditor->setCodec(VCSBase::VCSBaseEditorWidget::getCodec(source)); + baseEditor->setCodec(VcsBase::VcsBaseEditorWidget::getCodec(source)); } baseEditor->setForceReadOnly(true); @@ -586,20 +586,20 @@ VCSBase::VCSBaseEditorWidget *VCSBaseClient::createVCSEditor(const QString &kind return baseEditor; } -QProcessEnvironment VCSBaseClient::processEnvironment() const +QProcessEnvironment VcsBaseClient::processEnvironment() const { QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); - VCSBase::VCSBasePlugin::setProcessEnvironment(&environment, false); + VcsBase::VcsBasePlugin::setProcessEnvironment(&environment, false); return environment; } -Command *VCSBaseClient::createCommand(const QString &workingDirectory, - VCSBase::VCSBaseEditorWidget *editor, +Command *VcsBaseClient::createCommand(const QString &workingDirectory, + VcsBase::VcsBaseEditorWidget *editor, JobOutputBindMode mode) { - Command *cmd = new Command(d->m_clientSettings->stringValue(VCSBaseClientSettings::binaryPathKey), + Command *cmd = new Command(d->m_clientSettings->stringValue(VcsBaseClientSettings::binaryPathKey), workingDirectory, processEnvironment()); - cmd->setDefaultTimeout(d->m_clientSettings->intValue(VCSBaseClientSettings::timeoutKey)); + cmd->setDefaultTimeout(d->m_clientSettings->intValue(VcsBaseClientSettings::timeoutKey)); if (editor) d->bindCommandToEditor(cmd, editor); if (mode == VcsWindowOutputBind) { @@ -623,20 +623,20 @@ Command *VCSBaseClient::createCommand(const QString &workingDirectory, return cmd; } -void VCSBaseClient::enqueueJob(Command *cmd, const QStringList &args) +void VcsBaseClient::enqueueJob(Command *cmd, const QStringList &args) { - const QString binary = QFileInfo(d->m_clientSettings->stringValue(VCSBaseClientSettings::binaryPathKey)).baseName(); + const QString binary = QFileInfo(d->m_clientSettings->stringValue(VcsBaseClientSettings::binaryPathKey)).baseName(); ::vcsOutputWindow()->appendCommand(cmd->workingDirectory(), binary, args); cmd->addJob(args); cmd->execute(); } -void VCSBaseClient::resetCachedVcsInfo(const QString &workingDir) +void VcsBaseClient::resetCachedVcsInfo(const QString &workingDir) { Core::VcsManager *vcsManager = d->m_core->vcsManager(); vcsManager->resetVersionControlForDirectory(workingDir); } -} // namespace VCSBase +} // namespace VcsBase #include "moc_vcsbaseclient.cpp" diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index b8bf88da35..8cf6e1a87e 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -49,16 +49,16 @@ namespace Utils { struct SynchronousProcessResponse; } -namespace VCSBase { +namespace VcsBase { class Command; -class VCSBaseEditorWidget; -class VCSBaseClientSettings; -class VCSJob; -class VCSBaseClientPrivate; -class VCSBaseEditorParameterWidget; +class VcsBaseEditorWidget; +class VcsBaseClientSettings; +class VcsJob; +class VcsBaseClientPrivate; +class VcsBaseEditorParameterWidget; -class VCSBASE_EXPORT VCSBaseClient : public QObject +class VCSBASE_EXPORT VcsBaseClient : public QObject { Q_OBJECT @@ -72,8 +72,8 @@ public: QString file; }; - explicit VCSBaseClient(VCSBaseClientSettings *settings); - ~VCSBaseClient(); + explicit VcsBaseClient(VcsBaseClientSettings *settings); + ~VcsBaseClient(); virtual bool synchronousCreateRepository(const QString &workingDir, const QStringList &extraOptions = QStringList()); virtual bool synchronousClone(const QString &workingDir, @@ -120,11 +120,11 @@ public: virtual QString findTopLevelForFile(const QFileInfo &file) const = 0; - virtual VCSBaseClientSettings *settings() const; + virtual VcsBaseClientSettings *settings() const; signals: - void parsedStatus(const QList<VCSBase::VCSBaseClient::StatusItem> &statusList); - // Passes on changed signals from VCSJob to Control + void parsedStatus(const QList<VcsBase::VcsBaseClient::StatusItem> &statusList); + // Passes on changed signals from VcsJob to Control void changed(const QVariant &v); public slots: @@ -132,7 +132,7 @@ public slots: const QStringList &extraOptions = QStringList()); protected: - enum VCSCommand + enum VcsCommand { CreateRepositoryCommand, CloneCommand, @@ -150,14 +150,14 @@ protected: LogCommand, StatusCommand }; - virtual QString vcsCommandString(VCSCommand cmd) const; - virtual QString vcsEditorKind(VCSCommand cmd) const = 0; + virtual QString vcsCommandString(VcsCommand cmd) const; + virtual QString vcsEditorKind(VcsCommand cmd) const = 0; virtual QStringList revisionSpec(const QString &revision) const = 0; - virtual VCSBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, + virtual VcsBaseEditorParameterWidget *createDiffEditor(const QString &workingDir, const QStringList &files, const QStringList &extraOptions); - virtual VCSBaseEditorParameterWidget *createLogEditor(const QString &workingDir, + virtual VcsBaseEditorParameterWidget *createLogEditor(const QString &workingDir, const QStringList &files, const QStringList &extraOptions); virtual StatusItem parseStatusLine(const QString &line) const = 0; @@ -168,12 +168,12 @@ protected: const QStringList &args, QByteArray *output); // Synchronous VCS execution using Utils::SynchronousProcess, with - // log windows updating (using VCSBasePlugin::runVCS with flags) + // log windows updating (using VcsBasePlugin::runVcs with flags) Utils::SynchronousProcessResponse vcsSynchronousExec(const QString &workingDir, const QStringList &args, unsigned flags = 0, QTextCodec *outputCodec = 0); - VCSBase::VCSBaseEditorWidget *createVCSEditor(const QString &kind, QString title, + VcsBase::VcsBaseEditorWidget *createVcsEditor(const QString &kind, QString title, const QString &source, bool setSourceCodec, const char *registerDynamicProperty, const QString &dynamicPropertyValue) const; @@ -185,15 +185,15 @@ protected: VcsWindowOutputBind }; Command *createCommand(const QString &workingDirectory, - VCSBase::VCSBaseEditorWidget *editor = 0, + VcsBase::VcsBaseEditorWidget *editor = 0, JobOutputBindMode mode = NoOutputBind); void enqueueJob(Command *cmd, const QStringList &args); void resetCachedVcsInfo(const QString &workingDir); private: - friend class VCSBaseClientPrivate; - VCSBaseClientPrivate *d; + friend class VcsBaseClientPrivate; + VcsBaseClientPrivate *d; Q_PRIVATE_SLOT(d, void statusParser(QByteArray)) Q_PRIVATE_SLOT(d, void annotateRevision(QString, QString, int)) @@ -201,6 +201,6 @@ private: Q_PRIVATE_SLOT(d, void commandFinishedGotoLine(QObject *)) }; -} //namespace VCSBase +} //namespace VcsBase #endif // VCSBASECLIENT_H diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index ff1cee73d2..83afc19266 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -154,16 +154,16 @@ bool operator==(const SettingValue &lhs, const SettingValue &rhs) } // Anonymous namespace -namespace VCSBase { +namespace VcsBase { namespace Internal { -class VCSBaseClientSettingsPrivate : public QSharedData +class VcsBaseClientSettingsPrivate : public QSharedData { public: - VCSBaseClientSettingsPrivate() {} + VcsBaseClientSettingsPrivate() {} - VCSBaseClientSettingsPrivate(const VCSBaseClientSettingsPrivate &other) : + VcsBaseClientSettingsPrivate(const VcsBaseClientSettingsPrivate &other) : QSharedData(other), m_valueHash(other.m_valueHash), m_defaultValueHash(other.m_defaultValueHash), @@ -179,22 +179,22 @@ public: } // namespace Internal /*! - \class VCSBase::VCSBaseClientSettings + \class VcsBase::VcsBaseClientSettings - \brief Settings used in VCSBaseClient. + \brief Settings used in VcsBaseClient. - \sa VCSBase::VCSBaseClient + \sa VcsBase::VcsBaseClient */ -const QLatin1String VCSBaseClientSettings::binaryPathKey("BinaryPath"); -const QLatin1String VCSBaseClientSettings::userNameKey("Username"); -const QLatin1String VCSBaseClientSettings::userEmailKey("UserEmail"); -const QLatin1String VCSBaseClientSettings::logCountKey("LogCount"); -const QLatin1String VCSBaseClientSettings::promptOnSubmitKey("PromptOnSubmit"); -const QLatin1String VCSBaseClientSettings::timeoutKey("Timeout"); +const QLatin1String VcsBaseClientSettings::binaryPathKey("BinaryPath"); +const QLatin1String VcsBaseClientSettings::userNameKey("Username"); +const QLatin1String VcsBaseClientSettings::userEmailKey("UserEmail"); +const QLatin1String VcsBaseClientSettings::logCountKey("LogCount"); +const QLatin1String VcsBaseClientSettings::promptOnSubmitKey("PromptOnSubmit"); +const QLatin1String VcsBaseClientSettings::timeoutKey("Timeout"); -VCSBaseClientSettings::VCSBaseClientSettings() : - d(new Internal::VCSBaseClientSettingsPrivate) +VcsBaseClientSettings::VcsBaseClientSettings() : + d(new Internal::VcsBaseClientSettingsPrivate) { declareKey(binaryPathKey, QLatin1String("")); declareKey(userNameKey, QLatin1String("")); @@ -204,23 +204,23 @@ VCSBaseClientSettings::VCSBaseClientSettings() : declareKey(timeoutKey, 30); } -VCSBaseClientSettings::VCSBaseClientSettings(const VCSBaseClientSettings &other) : +VcsBaseClientSettings::VcsBaseClientSettings(const VcsBaseClientSettings &other) : d(other.d) { } -VCSBaseClientSettings &VCSBaseClientSettings::operator=(const VCSBaseClientSettings &other) +VcsBaseClientSettings &VcsBaseClientSettings::operator=(const VcsBaseClientSettings &other) { if (this != &other) d = other.d; return *this; } -VCSBaseClientSettings::~VCSBaseClientSettings() +VcsBaseClientSettings::~VcsBaseClientSettings() { } -void VCSBaseClientSettings::writeSettings(QSettings *settings) const +void VcsBaseClientSettings::writeSettings(QSettings *settings) const { settings->beginGroup(settingsGroup()); foreach (const QString &key, keys()) @@ -228,7 +228,7 @@ void VCSBaseClientSettings::writeSettings(QSettings *settings) const settings->endGroup(); } -void VCSBaseClientSettings::readSettings(const QSettings *settings) +void VcsBaseClientSettings::readSettings(const QSettings *settings) { const QString keyRoot = settingsGroup() + QLatin1Char('/'); foreach (const QString &key, keys()) { @@ -251,66 +251,66 @@ void VCSBaseClientSettings::readSettings(const QSettings *settings) } } -bool VCSBaseClientSettings::equals(const VCSBaseClientSettings &rhs) const +bool VcsBaseClientSettings::equals(const VcsBaseClientSettings &rhs) const { if (this == &rhs) return true; return d->m_valueHash == rhs.d->m_valueHash; } -QStringList VCSBaseClientSettings::keys() const +QStringList VcsBaseClientSettings::keys() const { return d->m_valueHash.keys(); } -bool VCSBaseClientSettings::hasKey(const QString &key) const +bool VcsBaseClientSettings::hasKey(const QString &key) const { return d->m_valueHash.contains(key); } -int *VCSBaseClientSettings::intPointer(const QString &key) +int *VcsBaseClientSettings::intPointer(const QString &key) { if (hasKey(key)) return &(d->m_valueHash[key].m_comp.intValue); return 0; } -bool *VCSBaseClientSettings::boolPointer(const QString &key) +bool *VcsBaseClientSettings::boolPointer(const QString &key) { if (hasKey(key)) return &(d->m_valueHash[key].m_comp.boolValue); return 0; } -QString *VCSBaseClientSettings::stringPointer(const QString &key) +QString *VcsBaseClientSettings::stringPointer(const QString &key) { if (hasKey(key) && valueType(key) == QVariant::String) return d->m_valueHash[key].m_comp.strPtr; return 0; } -int VCSBaseClientSettings::intValue(const QString &key, int defaultValue) const +int VcsBaseClientSettings::intValue(const QString &key, int defaultValue) const { if (hasKey(key) && valueType(key) == QVariant::Int) return d->m_valueHash[key].m_comp.intValue; return defaultValue; } -bool VCSBaseClientSettings::boolValue(const QString &key, bool defaultValue) const +bool VcsBaseClientSettings::boolValue(const QString &key, bool defaultValue) const { if (hasKey(key) && valueType(key) == QVariant::Bool) return d->m_valueHash[key].m_comp.boolValue; return defaultValue; } -QString VCSBaseClientSettings::stringValue(const QString &key, const QString &defaultValue) const +QString VcsBaseClientSettings::stringValue(const QString &key, const QString &defaultValue) const { if (hasKey(key)) return d->m_valueHash[key].stringValue(defaultValue); return defaultValue; } -QVariant VCSBaseClientSettings::value(const QString &key) const +QVariant VcsBaseClientSettings::value(const QString &key) const { switch (valueType(key)) { case QVariant::Int: @@ -326,30 +326,30 @@ QVariant VCSBaseClientSettings::value(const QString &key) const } } -void VCSBaseClientSettings::setValue(const QString &key, const QVariant &v) +void VcsBaseClientSettings::setValue(const QString &key, const QVariant &v) { if (SettingValue::isUsableVariantType(valueType(key))) d->m_valueHash.insert(key, SettingValue(v)); } -QVariant::Type VCSBaseClientSettings::valueType(const QString &key) const +QVariant::Type VcsBaseClientSettings::valueType(const QString &key) const { if (hasKey(key)) return d->m_valueHash[key].type(); return QVariant::Invalid; } -QString VCSBaseClientSettings::settingsGroup() const +QString VcsBaseClientSettings::settingsGroup() const { return d->m_settingsGroup; } -void VCSBaseClientSettings::setSettingsGroup(const QString &group) +void VcsBaseClientSettings::setSettingsGroup(const QString &group) { d->m_settingsGroup = group; } -void VCSBaseClientSettings::declareKey(const QString &key, const QVariant &defaultValue) +void VcsBaseClientSettings::declareKey(const QString &key, const QVariant &defaultValue) { if (SettingValue::isUsableVariantType(defaultValue.type())) { d->m_valueHash.insert(key, SettingValue(defaultValue)); @@ -357,11 +357,11 @@ void VCSBaseClientSettings::declareKey(const QString &key, const QVariant &defau } } -QVariant VCSBaseClientSettings::keyDefaultValue(const QString &key) const +QVariant VcsBaseClientSettings::keyDefaultValue(const QString &key) const { if (d->m_defaultValueHash.contains(key)) return d->m_defaultValueHash.value(key); return QVariant(valueType(key)); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index 4b4950323c..31f5445989 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -43,11 +43,11 @@ QT_BEGIN_NAMESPACE class QSettings; QT_END_NAMESPACE -namespace VCSBase { +namespace VcsBase { -namespace Internal { class VCSBaseClientSettingsPrivate; } +namespace Internal { class VcsBaseClientSettingsPrivate; } -class VCSBASE_EXPORT VCSBaseClientSettings +class VCSBASE_EXPORT VcsBaseClientSettings { public: static const QLatin1String binaryPathKey; @@ -57,15 +57,15 @@ public: static const QLatin1String promptOnSubmitKey; static const QLatin1String timeoutKey; // Seconds - VCSBaseClientSettings(); - VCSBaseClientSettings(const VCSBaseClientSettings &other); - VCSBaseClientSettings &operator=(const VCSBaseClientSettings &other); - virtual ~VCSBaseClientSettings(); + VcsBaseClientSettings(); + VcsBaseClientSettings(const VcsBaseClientSettings &other); + VcsBaseClientSettings &operator=(const VcsBaseClientSettings &other); + virtual ~VcsBaseClientSettings(); void writeSettings(QSettings *settings) const; void readSettings(const QSettings *settings); - bool equals(const VCSBaseClientSettings &rhs) const; + bool equals(const VcsBaseClientSettings &rhs) const; QStringList keys() const; bool hasKey(const QString &key) const; @@ -91,16 +91,16 @@ protected: QVariant keyDefaultValue(const QString &key) const; private: - friend bool equals(const VCSBaseClientSettings &rhs); - friend class VCSBaseClientSettingsPrivate; - QSharedDataPointer<Internal::VCSBaseClientSettingsPrivate> d; + friend bool equals(const VcsBaseClientSettings &rhs); + friend class VcsBaseClientSettingsPrivate; + QSharedDataPointer<Internal::VcsBaseClientSettingsPrivate> d; }; -inline bool operator==(const VCSBaseClientSettings &s1, const VCSBaseClientSettings &s2) +inline bool operator==(const VcsBaseClientSettings &s1, const VcsBaseClientSettings &s2) { return s1.equals(s2); } -inline bool operator!=(const VCSBaseClientSettings &s1, const VCSBaseClientSettings &s2) +inline bool operator!=(const VcsBaseClientSettings &s1, const VcsBaseClientSettings &s2) { return !s1.equals(s2); } -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASECLIENTSETTINGS_H diff --git a/src/plugins/vcsbase/vcsbaseconstants.h b/src/plugins/vcsbase/vcsbaseconstants.h index cd6e36348b..2ba5cc3edf 100644 --- a/src/plugins/vcsbase/vcsbaseconstants.h +++ b/src/plugins/vcsbase/vcsbaseconstants.h @@ -35,14 +35,14 @@ #include <QtCore/QtGlobal> -namespace VCSBase { +namespace VcsBase { namespace Constants { const char VCS_SETTINGS_CATEGORY[] = "V.Version Control"; -const char VCS_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("VCSBase", "Version Control"); +const char VCS_SETTINGS_TR_CATEGORY[] = QT_TRANSLATE_NOOP("VcsBase", "Version Control"); const char SETTINGS_CATEGORY_VCS_ICON[] = ":/core/images/category_vcs.png"; const char VCS_COMMON_SETTINGS_ID[] = "A.Common"; -const char VCS_COMMON_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("VCSBase", "Common"); +const char VCS_COMMON_SETTINGS_NAME[] = QT_TRANSLATE_NOOP("VcsBase", "Common"); // Ids for sort order (wizards and preferences) const char VCS_ID_BAZAAR[] = "B.Bazaar"; @@ -53,6 +53,6 @@ const char VCS_ID_PERFORCE[] = "P.Perforce"; const char VCS_ID_CVS[] = "Z.CVS"; } // namespace Constants -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASE_CONSTANTS_H diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index d3a4e3fcaf..f737cd02ff 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -78,9 +78,9 @@ #include <QtGui/QMessageBox> /*! - \enum VCSBase::EditorContentType + \enum VcsBase::EditorContentType - \brief Contents of a VCSBaseEditor and its interaction. + \brief Contents of a VcsBaseEditor and its interaction. \value RegularCommandOutput No special handling. \value LogOutput Log of a file under revision control. Provide 'click on change' @@ -94,13 +94,13 @@ header and diffs. Interaction is 'double click in hunk' which opens the file. Context menu offers 'Revert chunk'. - \sa VCSBase::VCSBaseEditorWidget + \sa VcsBase::VcsBaseEditorWidget */ -namespace VCSBase { +namespace VcsBase { /*! - \class VCSBase::DiffChunk + \class VcsBase::DiffChunk \brief A diff chunk consisting of file name and chunk data. */ @@ -136,27 +136,27 @@ public: }; } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase -Q_DECLARE_METATYPE(VCSBase::Internal::DiffChunkAction) +Q_DECLARE_METATYPE(VcsBase::Internal::DiffChunkAction) -namespace VCSBase { +namespace VcsBase { /*! - \class VCSBase::VCSBaseEditor + \class VcsBase::VcsBaseEditor \brief An editor with no support for duplicates. Creates a browse combo in the toolbar for diff output. - It also mirrors the signals of the VCSBaseEditor since the editor + It also mirrors the signals of the VcsBaseEditor since the editor manager passes the editor around. */ -class VCSBaseEditor : public TextEditor::BaseTextEditor +class VcsBaseEditor : public TextEditor::BaseTextEditor { Q_OBJECT public: - VCSBaseEditor(VCSBaseEditorWidget *, const VCSBaseEditorParameters *type); + VcsBaseEditor(VcsBaseEditorWidget *, const VcsBaseEditorParameters *type); bool duplicateSupported() const { return false; } Core::IEditor *duplicate(QWidget * /*parent*/) { return 0; } @@ -174,8 +174,8 @@ private: bool m_temporary; }; -VCSBaseEditor::VCSBaseEditor(VCSBaseEditorWidget *widget, - const VCSBaseEditorParameters *type) : +VcsBaseEditor::VcsBaseEditor(VcsBaseEditorWidget *widget, + const VcsBaseEditorParameters *type) : BaseTextEditor(widget), m_id(type->id), m_temporary(false) @@ -184,10 +184,10 @@ VCSBaseEditor::VCSBaseEditor(VCSBaseEditorWidget *widget, } // Diff editor: creates a browse combo in the toolbar for diff output. -class VCSBaseDiffEditor : public VCSBaseEditor +class VcsBaseDiffEditor : public VcsBaseEditor { public: - VCSBaseDiffEditor(VCSBaseEditorWidget *, const VCSBaseEditorParameters *type); + VcsBaseDiffEditor(VcsBaseEditorWidget *, const VcsBaseEditorParameters *type); QComboBox *diffFileBrowseComboBox() const { return m_diffFileBrowseComboBox; } @@ -195,8 +195,8 @@ private: QComboBox *m_diffFileBrowseComboBox; }; -VCSBaseDiffEditor::VCSBaseDiffEditor(VCSBaseEditorWidget *w, const VCSBaseEditorParameters *type) : - VCSBaseEditor(w, type), +VcsBaseDiffEditor::VcsBaseDiffEditor(VcsBaseEditorWidget *w, const VcsBaseEditorParameters *type) : + VcsBaseEditor(w, type), m_diffFileBrowseComboBox(new QComboBox) { m_diffFileBrowseComboBox->setMinimumContentsLength(20); @@ -208,16 +208,16 @@ VCSBaseDiffEditor::VCSBaseDiffEditor(VCSBaseEditorWidget *w, const VCSBaseEditor insertExtraToolBarWidget(Left, m_diffFileBrowseComboBox); } -// ----------- VCSBaseEditorPrivate +// ----------- VcsBaseEditorPrivate namespace Internal { -class VCSBaseEditorWidgetPrivate +class VcsBaseEditorWidgetPrivate { public: - VCSBaseEditorWidgetPrivate(const VCSBaseEditorParameters *type); + VcsBaseEditorWidgetPrivate(const VcsBaseEditorParameters *type); - const VCSBaseEditorParameters *m_parameters; + const VcsBaseEditorParameters *m_parameters; QString m_currentChange; QString m_source; @@ -236,11 +236,11 @@ public: bool m_mouseDragging; }; -VCSBaseEditorWidgetPrivate::VCSBaseEditorWidgetPrivate(const VCSBaseEditorParameters *type) : +VcsBaseEditorWidgetPrivate::VcsBaseEditorWidgetPrivate(const VcsBaseEditorParameters *type) : m_parameters(type), m_cursorLine(-1), - m_annotateRevisionTextFormat(VCSBaseEditorWidget::tr("Annotate \"%1\"")), - m_copyRevisionTextFormat(VCSBaseEditorWidget::tr("Copy \"%1\"")), + m_annotateRevisionTextFormat(VcsBaseEditorWidget::tr("Annotate \"%1\"")), + m_copyRevisionTextFormat(VcsBaseEditorWidget::tr("Copy \"%1\"")), m_fileLogAnnotateEnabled(false), m_editor(0), m_configurationWidget(0), @@ -252,17 +252,17 @@ VCSBaseEditorWidgetPrivate::VCSBaseEditorWidgetPrivate(const VCSBaseEditorParame } // namespace Internal /*! - \struct VCSBase::VCSBaseEditorParameters + \struct VcsBase::VcsBaseEditorParameters \brief Helper struct used to parametrize an editor with mime type, context and id. The extension is currently only a suggestion when running VCS commands with redirection. - \sa VCSBase::VCSBaseEditorWidget, VCSBase::BaseVCSEditorFactory, VCSBase::EditorContentType + \sa VcsBase::VcsBaseEditorWidget, VcsBase::BaseVcsEditorFactory, VcsBase::EditorContentType */ /*! - \class VCSBase::VCSBaseEditorWidget + \class VcsBase::VcsBaseEditorWidget \brief Base class for editors showing version control system output of the type enumerated by EditorContentType. @@ -271,19 +271,19 @@ VCSBaseEditorWidgetPrivate::VCSBaseEditorWidgetPrivate(const VCSBaseEditorParame refers to and will be emitted with describeRequested(). This is for VCS that need a current directory. - \sa VCSBase::BaseVCSEditorFactory, VCSBase::VCSBaseEditorParameters, VCSBase::EditorContentType + \sa VcsBase::BaseVcsEditorFactory, VcsBase::VcsBaseEditorParameters, VcsBase::EditorContentType */ -VCSBaseEditorWidget::VCSBaseEditorWidget(const VCSBaseEditorParameters *type, QWidget *parent) +VcsBaseEditorWidget::VcsBaseEditorWidget(const VcsBaseEditorParameters *type, QWidget *parent) : BaseTextEditorWidget(parent), - d(new Internal::VCSBaseEditorWidgetPrivate(type)) + d(new Internal::VcsBaseEditorWidgetPrivate(type)) { viewport()->setMouseTracking(true); - setBaseTextDocument(new Internal::VCSBaseTextDocument); + setBaseTextDocument(new Internal::VcsBaseTextDocument); setMimeType(QLatin1String(d->m_parameters->mimeType)); } -void VCSBaseEditorWidget::init() +void VcsBaseEditorWidget::init() { switch (d->m_parameters->type) { case RegularCommandOutput: @@ -305,94 +305,94 @@ void VCSBaseEditorWidget::init() TextEditor::TextEditorSettings::instance()->initializeEditor(this); } -VCSBaseEditorWidget::~VCSBaseEditorWidget() +VcsBaseEditorWidget::~VcsBaseEditorWidget() { delete d; } -void VCSBaseEditorWidget::setForceReadOnly(bool b) +void VcsBaseEditorWidget::setForceReadOnly(bool b) { - Internal::VCSBaseTextDocument *vbd = qobject_cast<Internal::VCSBaseTextDocument*>(baseTextDocument()); - VCSBaseEditor *eda = qobject_cast<VCSBaseEditor *>(editor()); + Internal::VcsBaseTextDocument *vbd = qobject_cast<Internal::VcsBaseTextDocument*>(baseTextDocument()); + VcsBaseEditor *eda = qobject_cast<VcsBaseEditor *>(editor()); QTC_ASSERT(vbd != 0 && eda != 0, return); setReadOnly(b); vbd->setForceReadOnly(b); eda->setTemporary(b); } -bool VCSBaseEditorWidget::isForceReadOnly() const +bool VcsBaseEditorWidget::isForceReadOnly() const { - const Internal::VCSBaseTextDocument *vbd = qobject_cast<const Internal::VCSBaseTextDocument*>(baseTextDocument()); + const Internal::VcsBaseTextDocument *vbd = qobject_cast<const Internal::VcsBaseTextDocument*>(baseTextDocument()); QTC_ASSERT(vbd, return false); return vbd->isForceReadOnly(); } -QString VCSBaseEditorWidget::source() const +QString VcsBaseEditorWidget::source() const { return d->m_source; } -void VCSBaseEditorWidget::setSource(const QString &source) +void VcsBaseEditorWidget::setSource(const QString &source) { d->m_source = source; } -QString VCSBaseEditorWidget::annotateRevisionTextFormat() const +QString VcsBaseEditorWidget::annotateRevisionTextFormat() const { return d->m_annotateRevisionTextFormat; } -void VCSBaseEditorWidget::setAnnotateRevisionTextFormat(const QString &f) +void VcsBaseEditorWidget::setAnnotateRevisionTextFormat(const QString &f) { d->m_annotateRevisionTextFormat = f; } -QString VCSBaseEditorWidget::annotatePreviousRevisionTextFormat() const +QString VcsBaseEditorWidget::annotatePreviousRevisionTextFormat() const { return d->m_annotatePreviousRevisionTextFormat; } -void VCSBaseEditorWidget::setAnnotatePreviousRevisionTextFormat(const QString &f) +void VcsBaseEditorWidget::setAnnotatePreviousRevisionTextFormat(const QString &f) { d->m_annotatePreviousRevisionTextFormat = f; } -QString VCSBaseEditorWidget::copyRevisionTextFormat() const +QString VcsBaseEditorWidget::copyRevisionTextFormat() const { return d->m_copyRevisionTextFormat; } -void VCSBaseEditorWidget::setCopyRevisionTextFormat(const QString &f) +void VcsBaseEditorWidget::setCopyRevisionTextFormat(const QString &f) { d->m_copyRevisionTextFormat = f; } -bool VCSBaseEditorWidget::isFileLogAnnotateEnabled() const +bool VcsBaseEditorWidget::isFileLogAnnotateEnabled() const { return d->m_fileLogAnnotateEnabled; } -void VCSBaseEditorWidget::setFileLogAnnotateEnabled(bool e) +void VcsBaseEditorWidget::setFileLogAnnotateEnabled(bool e) { d->m_fileLogAnnotateEnabled = e; } -QString VCSBaseEditorWidget::diffBaseDirectory() const +QString VcsBaseEditorWidget::diffBaseDirectory() const { return d->m_diffBaseDirectory; } -void VCSBaseEditorWidget::setDiffBaseDirectory(const QString &bd) +void VcsBaseEditorWidget::setDiffBaseDirectory(const QString &bd) { d->m_diffBaseDirectory = bd; } -QTextCodec *VCSBaseEditorWidget::codec() const +QTextCodec *VcsBaseEditorWidget::codec() const { return const_cast<QTextCodec *>(baseTextDocument()->codec()); } -void VCSBaseEditorWidget::setCodec(QTextCodec *c) +void VcsBaseEditorWidget::setCodec(QTextCodec *c) { if (c) { baseTextDocument()->setCodec(c); @@ -401,27 +401,27 @@ void VCSBaseEditorWidget::setCodec(QTextCodec *c) } } -EditorContentType VCSBaseEditorWidget::contentType() const +EditorContentType VcsBaseEditorWidget::contentType() const { return d->m_parameters->type; } -bool VCSBaseEditorWidget::isModified() const +bool VcsBaseEditorWidget::isModified() const { return false; } -TextEditor::BaseTextEditor *VCSBaseEditorWidget::createEditor() +TextEditor::BaseTextEditor *VcsBaseEditorWidget::createEditor() { TextEditor::BaseTextEditor *editor = 0; if (d->m_parameters->type == DiffOutput) { // Diff: set up diff file browsing - VCSBaseDiffEditor *de = new VCSBaseDiffEditor(this, d->m_parameters); + VcsBaseDiffEditor *de = new VcsBaseDiffEditor(this, d->m_parameters); QComboBox *diffBrowseComboBox = de->diffFileBrowseComboBox(); connect(diffBrowseComboBox, SIGNAL(activated(int)), this, SLOT(slotDiffBrowse(int))); editor = de; } else { - editor = new VCSBaseEditor(this, d->m_parameters); + editor = new VcsBaseEditor(this, d->m_parameters); } d->m_editor = editor; @@ -433,9 +433,9 @@ TextEditor::BaseTextEditor *VCSBaseEditorWidget::createEditor() return editor; } -void VCSBaseEditorWidget::slotPopulateDiffBrowser() +void VcsBaseEditorWidget::slotPopulateDiffBrowser() { - VCSBaseDiffEditor *de = static_cast<VCSBaseDiffEditor*>(editor()); + VcsBaseDiffEditor *de = static_cast<VcsBaseDiffEditor*>(editor()); QComboBox *diffBrowseComboBox = de->diffFileBrowseComboBox(); diffBrowseComboBox->clear(); d->m_diffSections.clear(); @@ -459,7 +459,7 @@ void VCSBaseEditorWidget::slotPopulateDiffBrowser() } } -void VCSBaseEditorWidget::slotDiffBrowse(int index) +void VcsBaseEditorWidget::slotDiffBrowse(int index) { // goto diffed file as indicated by index/line number if (index < 0 || index >= d->m_diffSections.size()) @@ -489,7 +489,7 @@ static int sectionOfLine(int line, const QList<int> §ions) return sectionCount - 1; } -void VCSBaseEditorWidget::slotDiffCursorPositionChanged() +void VcsBaseEditorWidget::slotDiffCursorPositionChanged() { // Adapt diff file browse combo to new position // if the cursor goes across a file line. @@ -501,7 +501,7 @@ void VCSBaseEditorWidget::slotDiffCursorPositionChanged() d->m_cursorLine = newCursorLine; const int section = sectionOfLine(d->m_cursorLine, d->m_diffSections); if (section != -1) { - VCSBaseDiffEditor *de = static_cast<VCSBaseDiffEditor*>(editor()); + VcsBaseDiffEditor *de = static_cast<VcsBaseDiffEditor*>(editor()); QComboBox *diffBrowseComboBox = de->diffFileBrowseComboBox(); if (diffBrowseComboBox->currentIndex() != section) { const bool blocked = diffBrowseComboBox->blockSignals(true); @@ -511,14 +511,14 @@ void VCSBaseEditorWidget::slotDiffCursorPositionChanged() } } -QAction *VCSBaseEditorWidget::createDescribeAction(const QString &change) +QAction *VcsBaseEditorWidget::createDescribeAction(const QString &change) { QAction *a = new QAction(tr("Describe change %1").arg(change), 0); connect(a, SIGNAL(triggered()), this, SLOT(describe())); return a; } -QAction *VCSBaseEditorWidget::createAnnotateAction(const QString &change, bool previous) +QAction *VcsBaseEditorWidget::createAnnotateAction(const QString &change, bool previous) { // Use 'previous' format if desired and available, else default to standard. const QString &format = previous && !d->m_annotatePreviousRevisionTextFormat.isEmpty() ? @@ -529,7 +529,7 @@ QAction *VCSBaseEditorWidget::createAnnotateAction(const QString &change, bool p return a; } -QAction *VCSBaseEditorWidget::createCopyRevisionAction(const QString &change) +QAction *VcsBaseEditorWidget::createCopyRevisionAction(const QString &change) { QAction *a = new QAction(d->m_copyRevisionTextFormat.arg(change), 0); a->setData(change); @@ -537,7 +537,7 @@ QAction *VCSBaseEditorWidget::createCopyRevisionAction(const QString &change) return a; } -void VCSBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e) +void VcsBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e) { QMenu *menu = createStandardContextMenu(); // 'click on change-interaction' @@ -602,7 +602,7 @@ void VCSBaseEditorWidget::contextMenuEvent(QContextMenuEvent *e) delete menu; } -void VCSBaseEditorWidget::mouseMoveEvent(QMouseEvent *e) +void VcsBaseEditorWidget::mouseMoveEvent(QMouseEvent *e) { if (e->buttons()) { d->m_mouseDragging = true; @@ -638,7 +638,7 @@ void VCSBaseEditorWidget::mouseMoveEvent(QMouseEvent *e) viewport()->setCursor(cursorShape); } -void VCSBaseEditorWidget::mouseReleaseEvent(QMouseEvent *e) +void VcsBaseEditorWidget::mouseReleaseEvent(QMouseEvent *e) { const bool wasDragging = d->m_mouseDragging; d->m_mouseDragging = false; @@ -656,7 +656,7 @@ void VCSBaseEditorWidget::mouseReleaseEvent(QMouseEvent *e) TextEditor::BaseTextEditorWidget::mouseReleaseEvent(e); } -void VCSBaseEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) +void VcsBaseEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) { if (d->m_parameters->type == DiffOutput) { if (e->button() == Qt::LeftButton &&!(e->modifiers() & Qt::ShiftModifier)) { @@ -667,7 +667,7 @@ void VCSBaseEditorWidget::mouseDoubleClickEvent(QMouseEvent *e) TextEditor::BaseTextEditorWidget::mouseDoubleClickEvent(e); } -void VCSBaseEditorWidget::keyPressEvent(QKeyEvent *e) +void VcsBaseEditorWidget::keyPressEvent(QKeyEvent *e) { // Do not intercept return in editable patches. if (d->m_parameters->type == DiffOutput && isReadOnly() @@ -678,13 +678,13 @@ void VCSBaseEditorWidget::keyPressEvent(QKeyEvent *e) BaseTextEditorWidget::keyPressEvent(e); } -void VCSBaseEditorWidget::describe() +void VcsBaseEditorWidget::describe() { if (!d->m_currentChange.isEmpty()) emit describeRequested(d->m_source, d->m_currentChange); } -void VCSBaseEditorWidget::slotActivateAnnotation() +void VcsBaseEditorWidget::slotActivateAnnotation() { // The annotation highlighting depends on contents (change number // set with assigned colors) @@ -741,7 +741,7 @@ static inline bool checkChunkLine(const QString &line, int *modifiedLineNumber) return checkChunkLine(line, modifiedLineNumber, 3); } -void VCSBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor) +void VcsBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor) { int chunkStart = 0; int lineCount = -1; @@ -782,7 +782,7 @@ void VCSBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor) } // cut out chunk and determine file name. -DiffChunk VCSBaseEditorWidget::diffChunk(QTextCursor cursor) const +DiffChunk VcsBaseEditorWidget::diffChunk(QTextCursor cursor) const { QTC_ASSERT(d->m_parameters->type == DiffOutput, return DiffChunk(); ) DiffChunk rc; @@ -821,7 +821,7 @@ DiffChunk VCSBaseEditorWidget::diffChunk(QTextCursor cursor) const return rc; } -void VCSBaseEditorWidget::setPlainTextData(const QByteArray &data) +void VcsBaseEditorWidget::setPlainTextData(const QByteArray &data) { if (data.size() > Core::EditorManager::maxTextFileSize()) { setPlainText(msgTextTooLarge(data.size())); @@ -830,7 +830,7 @@ void VCSBaseEditorWidget::setPlainTextData(const QByteArray &data) } } -void VCSBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) +void VcsBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) { TextEditor::BaseTextEditorWidget::setFontSettings(fs); if (d->m_parameters->type == DiffOutput) { @@ -849,7 +849,7 @@ void VCSBaseEditorWidget::setFontSettings(const TextEditor::FontSettings &fs) } } -const VCSBaseEditorParameters *VCSBaseEditorWidget::findType(const VCSBaseEditorParameters *array, +const VcsBaseEditorParameters *VcsBaseEditorWidget::findType(const VcsBaseEditorParameters *array, int arraySize, EditorContentType et) { @@ -895,7 +895,7 @@ static QTextCodec *findProjectCodec(const QString &dir) return 0; } -QTextCodec *VCSBaseEditorWidget::getCodec(const QString &source) +QTextCodec *VcsBaseEditorWidget::getCodec(const QString &source) { if (!source.isEmpty()) { // Check file @@ -911,22 +911,22 @@ QTextCodec *VCSBaseEditorWidget::getCodec(const QString &source) return sys; } -QTextCodec *VCSBaseEditorWidget::getCodec(const QString &workingDirectory, const QStringList &files) +QTextCodec *VcsBaseEditorWidget::getCodec(const QString &workingDirectory, const QStringList &files) { if (files.empty()) return getCodec(workingDirectory); return getCodec(workingDirectory + QLatin1Char('/') + files.front()); } -VCSBaseEditorWidget *VCSBaseEditorWidget::getVcsBaseEditor(const Core::IEditor *editor) +VcsBaseEditorWidget *VcsBaseEditorWidget::getVcsBaseEditor(const Core::IEditor *editor) { if (const TextEditor::BaseTextEditor *be = qobject_cast<const TextEditor::BaseTextEditor *>(editor)) - return qobject_cast<VCSBaseEditorWidget *>(be->editorWidget()); + return qobject_cast<VcsBaseEditorWidget *>(be->editorWidget()); return 0; } // Return line number of current editor if it matches. -int VCSBaseEditorWidget::lineNumberOfCurrentEditor(const QString ¤tFile) +int VcsBaseEditorWidget::lineNumberOfCurrentEditor(const QString ¤tFile) { Core::IEditor *ed = Core::EditorManager::instance()->currentEditor(); if (!ed) @@ -942,7 +942,7 @@ int VCSBaseEditorWidget::lineNumberOfCurrentEditor(const QString ¤tFile) return eda->currentLine(); } -bool VCSBaseEditorWidget::gotoLineOfEditor(Core::IEditor *e, int lineNumber) +bool VcsBaseEditorWidget::gotoLineOfEditor(Core::IEditor *e, int lineNumber) { if (lineNumber >= 0 && e) { if (TextEditor::BaseTextEditor *be = qobject_cast<TextEditor::BaseTextEditor*>(e)) { @@ -955,7 +955,7 @@ bool VCSBaseEditorWidget::gotoLineOfEditor(Core::IEditor *e, int lineNumber) // Return source file or directory string depending on parameters // ('git diff XX' -> 'XX' , 'git diff XX file' -> 'XX/file'). -QString VCSBaseEditorWidget::getSource(const QString &workingDirectory, +QString VcsBaseEditorWidget::getSource(const QString &workingDirectory, const QString &fileName) { if (fileName.isEmpty()) @@ -969,7 +969,7 @@ QString VCSBaseEditorWidget::getSource(const QString &workingDirectory, return rc; } -QString VCSBaseEditorWidget::getSource(const QString &workingDirectory, +QString VcsBaseEditorWidget::getSource(const QString &workingDirectory, const QStringList &fileNames) { return fileNames.size() == 1 ? @@ -977,7 +977,7 @@ QString VCSBaseEditorWidget::getSource(const QString &workingDirectory, workingDirectory; } -QString VCSBaseEditorWidget::getTitleId(const QString &workingDirectory, +QString VcsBaseEditorWidget::getTitleId(const QString &workingDirectory, const QStringList &fileNames, const QString &revision) { @@ -1000,7 +1000,7 @@ QString VCSBaseEditorWidget::getTitleId(const QString &workingDirectory, return rc; } -bool VCSBaseEditorWidget::setConfigurationWidget(QWidget *w) +bool VcsBaseEditorWidget::setConfigurationWidget(QWidget *w) { if (!d->m_editor || d->m_configurationWidget) return false; @@ -1011,13 +1011,13 @@ bool VCSBaseEditorWidget::setConfigurationWidget(QWidget *w) return true; } -QWidget *VCSBaseEditorWidget::configurationWidget() const +QWidget *VcsBaseEditorWidget::configurationWidget() const { return d->m_configurationWidget; } // Find the complete file from a diff relative specification. -QString VCSBaseEditorWidget::findDiffFile(const QString &f, +QString VcsBaseEditorWidget::findDiffFile(const QString &f, Core::IVersionControl *control /* = 0 */) const { // Check if file is absolute @@ -1056,24 +1056,24 @@ QString VCSBaseEditorWidget::findDiffFile(const QString &f, return QString(); } -void VCSBaseEditorWidget::slotAnnotateRevision() +void VcsBaseEditorWidget::slotAnnotateRevision() { if (const QAction *a = qobject_cast<const QAction *>(sender())) emit annotateRevisionRequested(source(), a->data().toString(), editor()->currentLine()); } -void VCSBaseEditorWidget::slotCopyRevision() +void VcsBaseEditorWidget::slotCopyRevision() { QApplication::clipboard()->setText(d->m_currentChange); } -QStringList VCSBaseEditorWidget::annotationPreviousVersions(const QString &) const +QStringList VcsBaseEditorWidget::annotationPreviousVersions(const QString &) const { return QStringList(); } -void VCSBaseEditorWidget::slotPaste() +void VcsBaseEditorWidget::slotPaste() { // Retrieve service by soft dependency. QObject *pasteService = @@ -1087,17 +1087,17 @@ void VCSBaseEditorWidget::slotPaste() } } -bool VCSBaseEditorWidget::isRevertDiffChunkEnabled() const +bool VcsBaseEditorWidget::isRevertDiffChunkEnabled() const { return d->m_revertChunkEnabled; } -void VCSBaseEditorWidget::setRevertDiffChunkEnabled(bool e) +void VcsBaseEditorWidget::setRevertDiffChunkEnabled(bool e) { d->m_revertChunkEnabled = e; } -bool VCSBaseEditorWidget::canApplyDiffChunk(const DiffChunk &dc) const +bool VcsBaseEditorWidget::canApplyDiffChunk(const DiffChunk &dc) const { if (!dc.isValid()) return false; @@ -1108,12 +1108,12 @@ bool VCSBaseEditorWidget::canApplyDiffChunk(const DiffChunk &dc) const // Default implementation of revert: Apply a chunk by piping it into patch, // (passing '-R' for revert), assuming we got absolute paths from the VCS plugins. -bool VCSBaseEditorWidget::applyDiffChunk(const DiffChunk &dc, bool revert) const +bool VcsBaseEditorWidget::applyDiffChunk(const DiffChunk &dc, bool revert) const { - return VCSBasePlugin::runPatch(dc.asPatch(), QString(), 0, revert); + return VcsBasePlugin::runPatch(dc.asPatch(), QString(), 0, revert); } -void VCSBaseEditorWidget::slotApplyDiffChunk() +void VcsBaseEditorWidget::slotApplyDiffChunk() { const QAction *a = qobject_cast<QAction *>(sender()); QTC_ASSERT(a, return ; ) @@ -1134,7 +1134,7 @@ void VCSBaseEditorWidget::slotApplyDiffChunk() } // Tagging of editors for re-use. -QString VCSBaseEditorWidget::editorTag(EditorContentType t, +QString VcsBaseEditorWidget::editorTag(EditorContentType t, const QString &workingDirectory, const QStringList &files, const QString &revision) @@ -1154,14 +1154,14 @@ QString VCSBaseEditorWidget::editorTag(EditorContentType t, return rc; } -static const char tagPropertyC[] = "_q_VCSBaseEditorTag"; +static const char tagPropertyC[] = "_q_VcsBaseEditorTag"; -void VCSBaseEditorWidget::tagEditor(Core::IEditor *e, const QString &tag) +void VcsBaseEditorWidget::tagEditor(Core::IEditor *e, const QString &tag) { e->setProperty(tagPropertyC, QVariant(tag)); } -Core::IEditor* VCSBaseEditorWidget::locateEditorByTag(const QString &tag) +Core::IEditor* VcsBaseEditorWidget::locateEditorByTag(const QString &tag) { Core::IEditor *rc = 0; foreach (Core::IEditor *ed, Core::EditorManager::instance()->openedEditors()) { @@ -1174,6 +1174,6 @@ Core::IEditor* VCSBaseEditorWidget::locateEditorByTag(const QString &tag) return rc; } -} // namespace VCSBase +} // namespace VcsBase #include "vcsbaseeditor.moc" diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h index d703f8944a..ce9294e188 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.h +++ b/src/plugins/vcsbase/vcsbaseeditor.h @@ -47,9 +47,9 @@ QT_END_NAMESPACE namespace Core { class IVersionControl; } -namespace VCSBase { +namespace VcsBase { -namespace Internal { class VCSBaseEditorWidgetPrivate; } +namespace Internal { class VcsBaseEditorWidgetPrivate; } class DiffHighlighter; class BaseAnnotationHighlighter; @@ -63,7 +63,7 @@ enum EditorContentType DiffOutput }; -class VCSBASE_EXPORT VCSBaseEditorParameters +class VCSBASE_EXPORT VcsBaseEditorParameters { public: EditorContentType type; @@ -84,7 +84,7 @@ public: QByteArray chunk; }; -class VCSBASE_EXPORT VCSBaseEditorWidget : public TextEditor::BaseTextEditorWidget +class VCSBASE_EXPORT VcsBaseEditorWidget : public TextEditor::BaseTextEditorWidget { Q_PROPERTY(QString source READ source WRITE setSource) Q_PROPERTY(QString diffBaseDirectory READ diffBaseDirectory WRITE setDiffBaseDirectory) @@ -98,12 +98,12 @@ class VCSBASE_EXPORT VCSBaseEditorWidget : public TextEditor::BaseTextEditorWidg protected: // Initialization requires calling init() (which in turns calls // virtual functions). - explicit VCSBaseEditorWidget(const VCSBaseEditorParameters *type, + explicit VcsBaseEditorWidget(const VcsBaseEditorParameters *type, QWidget *parent); public: void init(); - ~VCSBaseEditorWidget(); + ~VcsBaseEditorWidget(); /* Force read-only: Make it a read-only, temporary file. * Should be set to true by version control views. It is not on @@ -149,8 +149,8 @@ public: EditorContentType contentType() const; // Utility to find a parameter set by type in an array. - static const VCSBaseEditorParameters * - findType(const VCSBaseEditorParameters *array, int arraySize, EditorContentType et); + static const VcsBaseEditorParameters * + findType(const VcsBaseEditorParameters *array, int arraySize, EditorContentType et); // Utility to find the codec for a source (file or directory), querying // the editor manager and the project managers (defaults to system codec). @@ -161,7 +161,7 @@ public: // Utility to return the widget from the IEditor returned by the editor // manager which is a BaseTextEditor. - static VCSBaseEditorWidget *getVcsBaseEditor(const Core::IEditor *editor); + static VcsBaseEditorWidget *getVcsBaseEditor(const Core::IEditor *editor); // Utility to find the line number of the current editor. Optionally, // pass in the file name to match it. To be used when jumping to current @@ -200,8 +200,8 @@ signals: // for LogOutput/AnnotateOutput content types. void describeRequested(const QString &source, const QString &change); void annotateRevisionRequested(const QString &source, const QString &change, int lineNumber); - void diffChunkApplied(const VCSBase::DiffChunk &dc); - void diffChunkReverted(const VCSBase::DiffChunk &dc); + void diffChunkApplied(const VcsBase::DiffChunk &dc); + void diffChunkReverted(const VcsBase::DiffChunk &dc); public slots: // Convenience slot to set data read from stdout, will use the @@ -264,11 +264,11 @@ private: QAction *createAnnotateAction(const QString &change, bool previous = false); QAction *createCopyRevisionAction(const QString &change); - Internal::VCSBaseEditorWidgetPrivate *const d; + Internal::VcsBaseEditorWidgetPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase -Q_DECLARE_METATYPE(VCSBase::DiffChunk) +Q_DECLARE_METATYPE(VcsBase::DiffChunk) #endif // VCSBASE_BASEEDITOR_H diff --git a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp index 423cdbcd95..22a4bd8ab8 100644 --- a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp +++ b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp @@ -38,7 +38,7 @@ #include <QtCore/QDebug> -namespace VCSBase { +namespace VcsBase { namespace Internal { @@ -80,16 +80,16 @@ private: Type m_type; }; -class VCSBaseEditorParameterWidgetPrivate +class VcsBaseEditorParameterWidgetPrivate { public: - VCSBaseEditorParameterWidgetPrivate() : + VcsBaseEditorParameterWidgetPrivate() : m_layout(0), m_comboBoxOptionTemplate(QLatin1String("%{option}=%{value}")) { } QStringList m_baseArguments; QHBoxLayout *m_layout; - QList<VCSBaseEditorParameterWidget::OptionMapping> m_optionMappings; + QList<VcsBaseEditorParameterWidget::OptionMapping> m_optionMappings; QHash<QWidget*, SettingMappingData> m_settingMapping; QStringList m_comboBoxOptionTemplate; }; @@ -97,9 +97,9 @@ public: } // namespace Internal /*! - \class VCSBase::VCSBaseEditorParameterWidget + \class VcsBase::VcsBaseEditorParameterWidget - \brief A toolbar-like widget for use with VCSBase::VCSBaseEditor::setConfigurationWidget() + \brief A toolbar-like widget for use with VcsBase::VcsBaseEditor::setConfigurationWidget() influencing for example the generation of VCS diff output. The widget maintains a list of command line arguments (starting from baseArguments()) @@ -107,15 +107,15 @@ public: that should trigger the rerun of the VCS operation. */ -VCSBaseEditorParameterWidget::ComboBoxItem::ComboBoxItem(const QString &text, +VcsBaseEditorParameterWidget::ComboBoxItem::ComboBoxItem(const QString &text, const QVariant &val) : displayText(text), value(val) { } -VCSBaseEditorParameterWidget::VCSBaseEditorParameterWidget(QWidget *parent) : - QWidget(parent), d(new Internal::VCSBaseEditorParameterWidgetPrivate) +VcsBaseEditorParameterWidget::VcsBaseEditorParameterWidget(QWidget *parent) : + QWidget(parent), d(new Internal::VcsBaseEditorParameterWidgetPrivate) { d->m_layout = new QHBoxLayout(this); d->m_layout->setContentsMargins(3, 0, 3, 0); @@ -123,22 +123,22 @@ VCSBaseEditorParameterWidget::VCSBaseEditorParameterWidget(QWidget *parent) : connect(this, SIGNAL(argumentsChanged()), this, SLOT(handleArgumentsChanged())); } -VCSBaseEditorParameterWidget::~VCSBaseEditorParameterWidget() +VcsBaseEditorParameterWidget::~VcsBaseEditorParameterWidget() { delete d; } -QStringList VCSBaseEditorParameterWidget::baseArguments() const +QStringList VcsBaseEditorParameterWidget::baseArguments() const { return d->m_baseArguments; } -void VCSBaseEditorParameterWidget::setBaseArguments(const QStringList &b) +void VcsBaseEditorParameterWidget::setBaseArguments(const QStringList &b) { d->m_baseArguments = b; } -QStringList VCSBaseEditorParameterWidget::arguments() const +QStringList VcsBaseEditorParameterWidget::arguments() const { // Compile effective arguments QStringList args = baseArguments(); @@ -147,7 +147,7 @@ QStringList VCSBaseEditorParameterWidget::arguments() const return args; } -QToolButton *VCSBaseEditorParameterWidget::addToggleButton(const QString &option, +QToolButton *VcsBaseEditorParameterWidget::addToggleButton(const QString &option, const QString &label, const QString &toolTip) { @@ -161,7 +161,7 @@ QToolButton *VCSBaseEditorParameterWidget::addToggleButton(const QString &option return tb; } -QComboBox *VCSBaseEditorParameterWidget::addComboBox(const QString &option, +QComboBox *VcsBaseEditorParameterWidget::addComboBox(const QString &option, const QList<ComboBoxItem> &items) { QComboBox *cb = new QComboBox; @@ -173,7 +173,7 @@ QComboBox *VCSBaseEditorParameterWidget::addComboBox(const QString &option, return cb; } -void VCSBaseEditorParameterWidget::mapSetting(QToolButton *button, bool *setting) +void VcsBaseEditorParameterWidget::mapSetting(QToolButton *button, bool *setting) { if (!d->m_settingMapping.contains(button) && button) { d->m_settingMapping.insert(button, Internal::SettingMappingData(setting)); @@ -185,7 +185,7 @@ void VCSBaseEditorParameterWidget::mapSetting(QToolButton *button, bool *setting } } -void VCSBaseEditorParameterWidget::mapSetting(QComboBox *comboBox, QString *setting) +void VcsBaseEditorParameterWidget::mapSetting(QComboBox *comboBox, QString *setting) { if (!d->m_settingMapping.contains(comboBox) && comboBox) { d->m_settingMapping.insert(comboBox, Internal::SettingMappingData(setting)); @@ -199,7 +199,7 @@ void VCSBaseEditorParameterWidget::mapSetting(QComboBox *comboBox, QString *sett } } -void VCSBaseEditorParameterWidget::mapSetting(QComboBox *comboBox, int *setting) +void VcsBaseEditorParameterWidget::mapSetting(QComboBox *comboBox, int *setting) { if (d->m_settingMapping.contains(comboBox) || !comboBox) return; @@ -228,42 +228,42 @@ void VCSBaseEditorParameterWidget::mapSetting(QComboBox *comboBox, int *setting) QStringList() << "%{option}" << "%{value}"; // eg --file a.out (two distinct arguments) \endcode */ -QStringList VCSBaseEditorParameterWidget::comboBoxOptionTemplate() const +QStringList VcsBaseEditorParameterWidget::comboBoxOptionTemplate() const { return d->m_comboBoxOptionTemplate; } -void VCSBaseEditorParameterWidget::setComboBoxOptionTemplate(const QStringList &optTemplate) const +void VcsBaseEditorParameterWidget::setComboBoxOptionTemplate(const QStringList &optTemplate) const { d->m_comboBoxOptionTemplate = optTemplate; } -void VCSBaseEditorParameterWidget::executeCommand() +void VcsBaseEditorParameterWidget::executeCommand() { } -void VCSBaseEditorParameterWidget::handleArgumentsChanged() +void VcsBaseEditorParameterWidget::handleArgumentsChanged() { updateMappedSettings(); executeCommand(); } -VCSBaseEditorParameterWidget::OptionMapping::OptionMapping() : +VcsBaseEditorParameterWidget::OptionMapping::OptionMapping() : widget(0) { } -VCSBaseEditorParameterWidget::OptionMapping::OptionMapping(const QString &optName, QWidget *w) : +VcsBaseEditorParameterWidget::OptionMapping::OptionMapping(const QString &optName, QWidget *w) : optionName(optName), widget(w) { } -const QList<VCSBaseEditorParameterWidget::OptionMapping> &VCSBaseEditorParameterWidget::optionMappings() const +const QList<VcsBaseEditorParameterWidget::OptionMapping> &VcsBaseEditorParameterWidget::optionMappings() const { return d->m_optionMappings; } -QStringList VCSBaseEditorParameterWidget::argumentsForOption(const OptionMapping &mapping) const +QStringList VcsBaseEditorParameterWidget::argumentsForOption(const OptionMapping &mapping) const { const QToolButton *tb = qobject_cast<const QToolButton *>(mapping.widget); if (tb && tb->isChecked()) { @@ -289,7 +289,7 @@ QStringList VCSBaseEditorParameterWidget::argumentsForOption(const OptionMapping return QStringList(); } -void VCSBaseEditorParameterWidget::updateMappedSettings() +void VcsBaseEditorParameterWidget::updateMappedSettings() { foreach (const OptionMapping &optMapping, d->m_optionMappings) { if (d->m_settingMapping.contains(optMapping.widget)) { @@ -322,4 +322,4 @@ void VCSBaseEditorParameterWidget::updateMappedSettings() } } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h index d1682c0070..f3109c0468 100644 --- a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h +++ b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h @@ -44,18 +44,18 @@ class QComboBox; class QToolButton; QT_END_NAMESPACE -namespace VCSBase { +namespace VcsBase { -namespace Internal { class VCSBaseEditorParameterWidgetPrivate; } +namespace Internal { class VcsBaseEditorParameterWidgetPrivate; } // Documentation->inside. -class VCSBASE_EXPORT VCSBaseEditorParameterWidget : public QWidget +class VCSBASE_EXPORT VcsBaseEditorParameterWidget : public QWidget { Q_OBJECT public: - explicit VCSBaseEditorParameterWidget(QWidget *parent = 0); - ~VCSBaseEditorParameterWidget(); + explicit VcsBaseEditorParameterWidget(QWidget *parent = 0); + ~VcsBaseEditorParameterWidget(); struct VCSBASE_EXPORT ComboBoxItem { @@ -104,10 +104,10 @@ protected: void updateMappedSettings(); private: - friend class Internal::VCSBaseEditorParameterWidgetPrivate; - Internal::VCSBaseEditorParameterWidgetPrivate *const d; + friend class Internal::VcsBaseEditorParameterWidgetPrivate; + Internal::VcsBaseEditorParameterWidgetPrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASE_VCSBASEEDITORPARAMETERWIDGET_H diff --git a/src/plugins/vcsbase/vcsbaseoptionspage.cpp b/src/plugins/vcsbase/vcsbaseoptionspage.cpp index 6deee9eb88..d8ab1d31e3 100644 --- a/src/plugins/vcsbase/vcsbaseoptionspage.cpp +++ b/src/plugins/vcsbase/vcsbaseoptionspage.cpp @@ -38,31 +38,31 @@ #include <QtGui/QIcon> /*! - \class VCSBase::VCSBaseOptionsPage + \class VcsBase::VcsBaseOptionsPage \brief Base class for VCS options pages providing common category/icon. */ -namespace VCSBase { +namespace VcsBase { -VCSBaseOptionsPage::VCSBaseOptionsPage(QObject *parent) : +VcsBaseOptionsPage::VcsBaseOptionsPage(QObject *parent) : Core::IOptionsPage(parent) { } -QString VCSBaseOptionsPage::category() const +QString VcsBaseOptionsPage::category() const { return QLatin1String(Constants::VCS_SETTINGS_CATEGORY); } -QString VCSBaseOptionsPage::displayCategory() const +QString VcsBaseOptionsPage::displayCategory() const { - return QCoreApplication::translate("VCSBase", Constants::VCS_SETTINGS_TR_CATEGORY); + return QCoreApplication::translate("VcsBase", Constants::VCS_SETTINGS_TR_CATEGORY); } -QIcon VCSBaseOptionsPage::categoryIcon() const +QIcon VcsBaseOptionsPage::categoryIcon() const { return QIcon(QLatin1String(Constants::SETTINGS_CATEGORY_VCS_ICON)); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/vcsbaseoptionspage.h b/src/plugins/vcsbase/vcsbaseoptionspage.h index f1648d005e..4218e84aab 100644 --- a/src/plugins/vcsbase/vcsbaseoptionspage.h +++ b/src/plugins/vcsbase/vcsbaseoptionspage.h @@ -37,20 +37,20 @@ #include <coreplugin/dialogs/ioptionspage.h> -namespace VCSBase { +namespace VcsBase { -class VCSBASE_EXPORT VCSBaseOptionsPage : public Core::IOptionsPage +class VCSBASE_EXPORT VcsBaseOptionsPage : public Core::IOptionsPage { Q_OBJECT public: - explicit VCSBaseOptionsPage(QObject *parent = 0); + explicit VcsBaseOptionsPage(QObject *parent = 0); QString category() const; QString displayCategory() const; QIcon categoryIcon() const; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASEOPTIONSPAGE_H diff --git a/src/plugins/vcsbase/vcsbaseoutputwindow.cpp b/src/plugins/vcsbase/vcsbaseoutputwindow.cpp index 34a4882380..996fd76446 100644 --- a/src/plugins/vcsbase/vcsbaseoutputwindow.cpp +++ b/src/plugins/vcsbase/vcsbaseoutputwindow.cpp @@ -53,7 +53,7 @@ #include <QtCore/QFileInfo> /*! - \class VCSBase::VCSBaseOutputWindow + \class VcsBase::VcsBaseOutputWindow \brief Output window for Version Control System command and other output (Singleton). @@ -67,7 +67,7 @@ showing modified file names, allowing the user to open them. */ -namespace VCSBase { +namespace VcsBase { namespace Internal { @@ -176,14 +176,14 @@ void OutputWindowPlainTextEdit::contextMenuEvent(QContextMenuEvent *event) fi = QFileInfo(repository + QLatin1Char('/') + token); if (fi.isFile()) { menu->addSeparator(); - openAction = menu->addAction(VCSBaseOutputWindow::tr("Open \"%1\""). + openAction = menu->addAction(VcsBaseOutputWindow::tr("Open \"%1\""). arg(QDir::toNativeSeparators(fi.fileName()))); openAction->setData(fi.absoluteFilePath()); } } // Add 'clear' menu->addSeparator(); - QAction *clearAction = menu->addAction(VCSBaseOutputWindow::tr("Clear")); + QAction *clearAction = menu->addAction(VcsBaseOutputWindow::tr("Clear")); // Run QAction *action = menu->exec(event->globalPos()); @@ -245,10 +245,10 @@ void OutputWindowPlainTextEdit::appendCommand(const QString &text) } // namespace Internal -// ------------------- VCSBaseOutputWindowPrivate -struct VCSBaseOutputWindowPrivate +// ------------------- VcsBaseOutputWindowPrivate +struct VcsBaseOutputWindowPrivate { - static VCSBaseOutputWindow *instance; + static VcsBaseOutputWindow *instance; Internal::OutputWindowPlainTextEdit *plainTextEdit(); QPointer<Internal::OutputWindowPlainTextEdit> m_plainTextEdit; @@ -258,28 +258,28 @@ struct VCSBaseOutputWindowPrivate // Create log editor on demand. Some errors might be logged // before CorePlugin::extensionsInitialized() pulls up the windows. -Internal::OutputWindowPlainTextEdit *VCSBaseOutputWindowPrivate::plainTextEdit() +Internal::OutputWindowPlainTextEdit *VcsBaseOutputWindowPrivate::plainTextEdit() { if (!m_plainTextEdit) m_plainTextEdit = new Internal::OutputWindowPlainTextEdit(); return m_plainTextEdit; } -VCSBaseOutputWindow *VCSBaseOutputWindowPrivate::instance = 0; +VcsBaseOutputWindow *VcsBaseOutputWindowPrivate::instance = 0; -VCSBaseOutputWindow::VCSBaseOutputWindow() : - d(new VCSBaseOutputWindowPrivate) +VcsBaseOutputWindow::VcsBaseOutputWindow() : + d(new VcsBaseOutputWindowPrivate) { - VCSBaseOutputWindowPrivate::instance = this; + VcsBaseOutputWindowPrivate::instance = this; } -VCSBaseOutputWindow::~VCSBaseOutputWindow() +VcsBaseOutputWindow::~VcsBaseOutputWindow() { - VCSBaseOutputWindowPrivate::instance = 0; + VcsBaseOutputWindowPrivate::instance = 0; delete d; } -QWidget *VCSBaseOutputWindow::outputWidget(QWidget *parent) +QWidget *VcsBaseOutputWindow::outputWidget(QWidget *parent) { if (d->m_plainTextEdit) { if (parent != d->m_plainTextEdit->parent()) @@ -290,86 +290,86 @@ QWidget *VCSBaseOutputWindow::outputWidget(QWidget *parent) return d->m_plainTextEdit; } -QWidgetList VCSBaseOutputWindow::toolBarWidgets() const +QWidgetList VcsBaseOutputWindow::toolBarWidgets() const { return QWidgetList(); } -QString VCSBaseOutputWindow::displayName() const +QString VcsBaseOutputWindow::displayName() const { return tr("Version Control"); } -int VCSBaseOutputWindow::priorityInStatusBar() const +int VcsBaseOutputWindow::priorityInStatusBar() const { return -1; } -void VCSBaseOutputWindow::clearContents() +void VcsBaseOutputWindow::clearContents() { if (d->m_plainTextEdit) d->m_plainTextEdit->clear(); } -void VCSBaseOutputWindow::visibilityChanged(bool visible) +void VcsBaseOutputWindow::visibilityChanged(bool visible) { if (visible && d->m_plainTextEdit) d->m_plainTextEdit->setFocus(); } -void VCSBaseOutputWindow::setFocus() +void VcsBaseOutputWindow::setFocus() { } -bool VCSBaseOutputWindow::hasFocus() const +bool VcsBaseOutputWindow::hasFocus() const { return false; } -bool VCSBaseOutputWindow::canFocus() const +bool VcsBaseOutputWindow::canFocus() const { return false; } -bool VCSBaseOutputWindow::canNavigate() const +bool VcsBaseOutputWindow::canNavigate() const { return false; } -bool VCSBaseOutputWindow::canNext() const +bool VcsBaseOutputWindow::canNext() const { return false; } -bool VCSBaseOutputWindow::canPrevious() const +bool VcsBaseOutputWindow::canPrevious() const { return false; } -void VCSBaseOutputWindow::goToNext() +void VcsBaseOutputWindow::goToNext() { } -void VCSBaseOutputWindow::goToPrev() +void VcsBaseOutputWindow::goToPrev() { } -void VCSBaseOutputWindow::setText(const QString &text) +void VcsBaseOutputWindow::setText(const QString &text) { d->plainTextEdit()->setPlainText(text); } -void VCSBaseOutputWindow::setData(const QByteArray &data) +void VcsBaseOutputWindow::setData(const QByteArray &data) { setText(QTextCodec::codecForLocale()->toUnicode(data)); } -void VCSBaseOutputWindow::appendSilently(const QString &text) +void VcsBaseOutputWindow::appendSilently(const QString &text) { d->plainTextEdit()->appendLines(text, d->repository); } -void VCSBaseOutputWindow::append(const QString &text) +void VcsBaseOutputWindow::append(const QString &text) { appendSilently(text); // Pop up without focus @@ -377,14 +377,14 @@ void VCSBaseOutputWindow::append(const QString &text) popup(false); } -void VCSBaseOutputWindow::appendError(const QString &text) +void VcsBaseOutputWindow::appendError(const QString &text) { d->plainTextEdit()->appendError(text); if (!d->plainTextEdit()->isVisible()) popup(false); // Pop up without focus } -void VCSBaseOutputWindow::appendWarning(const QString &text) +void VcsBaseOutputWindow::appendWarning(const QString &text) { d->plainTextEdit()->appendWarning(text); if (!d->plainTextEdit()->isVisible()) @@ -414,7 +414,7 @@ static inline QString formatArguments(const QStringList &args) return rc; } -QString VCSBaseOutputWindow::msgExecutionLogEntry(const QString &workingDir, +QString VcsBaseOutputWindow::msgExecutionLogEntry(const QString &workingDir, const QString &executable, const QStringList &arguments) { @@ -426,12 +426,12 @@ QString VCSBaseOutputWindow::msgExecutionLogEntry(const QString &workingDir, arg(QDir::toNativeSeparators(workingDir), nativeExecutable, args); } -void VCSBaseOutputWindow::appendCommand(const QString &text) +void VcsBaseOutputWindow::appendCommand(const QString &text) { d->plainTextEdit()->appendCommand(text); } -void VCSBaseOutputWindow::appendCommand(const QString &workingDirectory, +void VcsBaseOutputWindow::appendCommand(const QString &workingDirectory, const QString &binary, const QStringList &args) { @@ -439,40 +439,40 @@ void VCSBaseOutputWindow::appendCommand(const QString &workingDirectory, } -void VCSBaseOutputWindow::appendData(const QByteArray &data) +void VcsBaseOutputWindow::appendData(const QByteArray &data) { appendDataSilently(data); if (!d->plainTextEdit()->isVisible()) popup(false); // Pop up without focus } -void VCSBaseOutputWindow::appendDataSilently(const QByteArray &data) +void VcsBaseOutputWindow::appendDataSilently(const QByteArray &data) { appendSilently(QTextCodec::codecForLocale()->toUnicode(data)); } -VCSBaseOutputWindow *VCSBaseOutputWindow::instance() +VcsBaseOutputWindow *VcsBaseOutputWindow::instance() { - if (!VCSBaseOutputWindowPrivate::instance) { - VCSBaseOutputWindow *w = new VCSBaseOutputWindow; + if (!VcsBaseOutputWindowPrivate::instance) { + VcsBaseOutputWindow *w = new VcsBaseOutputWindow; Q_UNUSED(w) } - return VCSBaseOutputWindowPrivate::instance; + return VcsBaseOutputWindowPrivate::instance; } -QString VCSBaseOutputWindow::repository() const +QString VcsBaseOutputWindow::repository() const { return d->repository; } -void VCSBaseOutputWindow::setRepository(const QString &r) +void VcsBaseOutputWindow::setRepository(const QString &r) { d->repository = r; } -void VCSBaseOutputWindow::clearRepository() +void VcsBaseOutputWindow::clearRepository() { d->repository.clear(); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/vcsbaseoutputwindow.h b/src/plugins/vcsbase/vcsbaseoutputwindow.h index 4d483bc880..5722d99e9b 100644 --- a/src/plugins/vcsbase/vcsbaseoutputwindow.h +++ b/src/plugins/vcsbase/vcsbaseoutputwindow.h @@ -37,17 +37,17 @@ #include <coreplugin/ioutputpane.h> -namespace VCSBase { +namespace VcsBase { -struct VCSBaseOutputWindowPrivate; +struct VcsBaseOutputWindowPrivate; -class VCSBASE_EXPORT VCSBaseOutputWindow : public Core::IOutputPane +class VCSBASE_EXPORT VcsBaseOutputWindow : public Core::IOutputPane { Q_OBJECT Q_PROPERTY(QString repository READ repository WRITE setRepository) public: - ~VCSBaseOutputWindow(); + ~VcsBaseOutputWindow(); QWidget *outputWidget(QWidget *parent); QList<QWidget *> toolBarWidgets() const; @@ -68,7 +68,7 @@ public: void goToNext(); void goToPrev(); - static VCSBaseOutputWindow *instance(); + static VcsBaseOutputWindow *instance(); QString repository() const; @@ -114,11 +114,11 @@ public slots: const QStringList &args); private: - VCSBaseOutputWindow(); + VcsBaseOutputWindow(); - VCSBaseOutputWindowPrivate *d; + VcsBaseOutputWindowPrivate *d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASEOUTPUTWINDOW_H diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index e5bcfcd13e..f7ed1f6a4e 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -69,25 +69,25 @@ using namespace Utils; enum { debug = 0, debugRepositorySearch = 0, debugExecution = 0 }; /*! - \namespace VCSBase - \brief VCSBase plugin namespace + \namespace VcsBase + \brief VcsBase plugin namespace */ /*! - \namespace VCSBase::Internal - \brief Internal namespace of the VCSBase plugin + \namespace VcsBase::Internal + \brief Internal namespace of the VcsBase plugin \internal */ -namespace VCSBase { +namespace VcsBase { namespace Internal { /*! - \struct VCSBase::Internal::State + \struct VcsBase::Internal::State - \brief Internal state created by the state listener and VCSBasePluginState. + \brief Internal state created by the state listener and VcsBasePluginState. - Aggregated in the QSharedData of VCSBase::VCSBasePluginState. + Aggregated in the QSharedData of VcsBase::VcsBasePluginState. */ struct State @@ -184,7 +184,7 @@ QDebug operator<<(QDebug in, const State &state) } /*! - \class VCSBase::Internal::StateListener + \class VcsBase::Internal::StateListener \brief Connects to the relevant signals of Qt Creator, tries to find version controls and emits signals to the plugin instances. @@ -200,7 +200,7 @@ public: explicit StateListener(QObject *parent); signals: - void stateChanged(const VCSBase::Internal::State &s, Core::IVersionControl *vc); + void stateChanged(const VcsBase::Internal::State &s, Core::IVersionControl *vc); public slots: void slotStateChanged(); @@ -307,14 +307,14 @@ void StateListener::slotStateChanged() } // namespace Internal -class VCSBasePluginStateData : public QSharedData +class VcsBasePluginStateData : public QSharedData { public: Internal::State m_state; }; /*! - \class VCSBase::VCSBasePluginState + \class VcsBase::VcsBasePluginState \brief Relevant state information of the VCS plugins @@ -325,80 +325,80 @@ public: \o Current project and it's version system control/top level \endlist - \sa VCSBase::VCSBasePlugin + \sa VcsBase::VcsBasePlugin */ -VCSBasePluginState::VCSBasePluginState() : data(new VCSBasePluginStateData) +VcsBasePluginState::VcsBasePluginState() : data(new VcsBasePluginStateData) { } -VCSBasePluginState::VCSBasePluginState(const VCSBasePluginState &rhs) : data(rhs.data) +VcsBasePluginState::VcsBasePluginState(const VcsBasePluginState &rhs) : data(rhs.data) { } -VCSBasePluginState &VCSBasePluginState::operator=(const VCSBasePluginState &rhs) +VcsBasePluginState &VcsBasePluginState::operator=(const VcsBasePluginState &rhs) { if (this != &rhs) data.operator=(rhs.data); return *this; } -VCSBasePluginState::~VCSBasePluginState() +VcsBasePluginState::~VcsBasePluginState() { } -QString VCSBasePluginState::currentFile() const +QString VcsBasePluginState::currentFile() const { return data->m_state.currentFile; } -QString VCSBasePluginState::currentFileName() const +QString VcsBasePluginState::currentFileName() const { return data->m_state.currentFileName; } -QString VCSBasePluginState::currentFileTopLevel() const +QString VcsBasePluginState::currentFileTopLevel() const { return data->m_state.currentFileTopLevel; } -QString VCSBasePluginState::currentFileDirectory() const +QString VcsBasePluginState::currentFileDirectory() const { return data->m_state.currentFileDirectory; } -QString VCSBasePluginState::relativeCurrentFile() const +QString VcsBasePluginState::relativeCurrentFile() const { QTC_ASSERT(hasFile(), return QString()) return QDir(data->m_state.currentFileTopLevel).relativeFilePath(data->m_state.currentFile); } -QString VCSBasePluginState::currentPatchFile() const +QString VcsBasePluginState::currentPatchFile() const { return data->m_state.currentPatchFile; } -QString VCSBasePluginState::currentPatchFileDisplayName() const +QString VcsBasePluginState::currentPatchFileDisplayName() const { return data->m_state.currentPatchFileDisplayName; } -QString VCSBasePluginState::currentProjectPath() const +QString VcsBasePluginState::currentProjectPath() const { return data->m_state.currentProjectPath; } -QString VCSBasePluginState::currentProjectName() const +QString VcsBasePluginState::currentProjectName() const { return data->m_state.currentProjectName; } -QString VCSBasePluginState::currentProjectTopLevel() const +QString VcsBasePluginState::currentProjectTopLevel() const { return data->m_state.currentProjectTopLevel; } -QStringList VCSBasePluginState::relativeCurrentProject() const +QStringList VcsBasePluginState::relativeCurrentProject() const { QStringList rc; QTC_ASSERT(hasProject(), return rc) @@ -407,64 +407,64 @@ QStringList VCSBasePluginState::relativeCurrentProject() const return rc; } -bool VCSBasePluginState::hasTopLevel() const +bool VcsBasePluginState::hasTopLevel() const { return data->m_state.hasFile() || data->m_state.hasProject(); } -QString VCSBasePluginState::topLevel() const +QString VcsBasePluginState::topLevel() const { return hasFile() ? data->m_state.currentFileTopLevel : data->m_state.currentProjectTopLevel; } -bool VCSBasePluginState::equals(const Internal::State &rhs) const +bool VcsBasePluginState::equals(const Internal::State &rhs) const { return data->m_state.equals(rhs); } -bool VCSBasePluginState::equals(const VCSBasePluginState &rhs) const +bool VcsBasePluginState::equals(const VcsBasePluginState &rhs) const { return equals(rhs.data->m_state); } -void VCSBasePluginState::clear() +void VcsBasePluginState::clear() { data->m_state.clear(); } -void VCSBasePluginState::setState(const Internal::State &s) +void VcsBasePluginState::setState(const Internal::State &s) { data->m_state = s; } -bool VCSBasePluginState::isEmpty() const +bool VcsBasePluginState::isEmpty() const { return data->m_state.isEmpty(); } -bool VCSBasePluginState::hasFile() const +bool VcsBasePluginState::hasFile() const { return data->m_state.hasFile(); } -bool VCSBasePluginState::hasPatchFile() const +bool VcsBasePluginState::hasPatchFile() const { return !data->m_state.currentPatchFile.isEmpty(); } -bool VCSBasePluginState::hasProject() const +bool VcsBasePluginState::hasProject() const { return data->m_state.hasProject(); } -VCSBASE_EXPORT QDebug operator<<(QDebug in, const VCSBasePluginState &state) +VCSBASE_EXPORT QDebug operator<<(QDebug in, const VcsBasePluginState &state) { in << state.data->m_state; return in; } /*! - \class VCSBase::VCSBasePlugin + \class VcsBase::VcsBasePlugin \brief Base class for all version control plugins. @@ -491,15 +491,15 @@ VCSBASE_EXPORT QDebug operator<<(QDebug in, const VCSBasePluginState &state) the virtual submitEditorAboutToClose() to trigger the submit process. */ -struct VCSBasePluginPrivate +struct VcsBasePluginPrivate { - explicit VCSBasePluginPrivate(const QString &submitEditorId); + explicit VcsBasePluginPrivate(const QString &submitEditorId); inline bool supportsRepositoryCreation() const; const Core::Id m_submitEditorId; Core::IVersionControl *m_versionControl; - VCSBasePluginState m_state; + VcsBasePluginState m_state; int m_actionState; QAction *m_testSnapshotAction; QAction *m_testListSnapshotsAction; @@ -510,7 +510,7 @@ struct VCSBasePluginPrivate static Internal::StateListener *m_listener; }; -VCSBasePluginPrivate::VCSBasePluginPrivate(const QString &submitEditorId) : +VcsBasePluginPrivate::VcsBasePluginPrivate(const QString &submitEditorId) : m_submitEditorId(submitEditorId), m_versionControl(0), m_actionState(-1), @@ -521,47 +521,47 @@ VCSBasePluginPrivate::VCSBasePluginPrivate(const QString &submitEditorId) : { } -bool VCSBasePluginPrivate::supportsRepositoryCreation() const +bool VcsBasePluginPrivate::supportsRepositoryCreation() const { return m_versionControl && m_versionControl->supportsOperation(Core::IVersionControl::CreateRepositoryOperation); } -Internal::StateListener *VCSBasePluginPrivate::m_listener = 0; +Internal::StateListener *VcsBasePluginPrivate::m_listener = 0; -VCSBasePlugin::VCSBasePlugin(const QString &submitEditorId) : - d(new VCSBasePluginPrivate(submitEditorId)) +VcsBasePlugin::VcsBasePlugin(const QString &submitEditorId) : + d(new VcsBasePluginPrivate(submitEditorId)) { } -VCSBasePlugin::~VCSBasePlugin() +VcsBasePlugin::~VcsBasePlugin() { delete d; } -void VCSBasePlugin::initializeVcs(Core::IVersionControl *vc) +void VcsBasePlugin::initializeVcs(Core::IVersionControl *vc) { d->m_versionControl = vc; addAutoReleasedObject(vc); - Internal::VCSPlugin *plugin = Internal::VCSPlugin::instance(); - connect(plugin->coreListener(), SIGNAL(submitEditorAboutToClose(VCSBaseSubmitEditor*,bool*)), - this, SLOT(slotSubmitEditorAboutToClose(VCSBaseSubmitEditor*,bool*))); + Internal::VcsPlugin *plugin = Internal::VcsPlugin::instance(); + connect(plugin->coreListener(), SIGNAL(submitEditorAboutToClose(VcsBaseSubmitEditor*,bool*)), + this, SLOT(slotSubmitEditorAboutToClose(VcsBaseSubmitEditor*,bool*))); // First time: create new listener - if (!VCSBasePluginPrivate::m_listener) - VCSBasePluginPrivate::m_listener = new Internal::StateListener(plugin); - connect(VCSBasePluginPrivate::m_listener, - SIGNAL(stateChanged(VCSBase::Internal::State, Core::IVersionControl*)), + if (!VcsBasePluginPrivate::m_listener) + VcsBasePluginPrivate::m_listener = new Internal::StateListener(plugin); + connect(VcsBasePluginPrivate::m_listener, + SIGNAL(stateChanged(VcsBase::Internal::State, Core::IVersionControl*)), this, - SLOT(slotStateChanged(VCSBase::Internal::State,Core::IVersionControl*))); + SLOT(slotStateChanged(VcsBase::Internal::State,Core::IVersionControl*))); } -void VCSBasePlugin::extensionsInitialized() +void VcsBasePlugin::extensionsInitialized() { // Initialize enable menus. - VCSBasePluginPrivate::m_listener->slotStateChanged(); + VcsBasePluginPrivate::m_listener->slotStateChanged(); } -void VCSBasePlugin::slotSubmitEditorAboutToClose(VCSBaseSubmitEditor *submitEditor, bool *result) +void VcsBasePlugin::slotSubmitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor, bool *result) { if (debug) qDebug() << this << d->m_submitEditorId.name() << "Closing submit editor" << submitEditor << submitEditor->id().name(); @@ -569,51 +569,51 @@ void VCSBasePlugin::slotSubmitEditorAboutToClose(VCSBaseSubmitEditor *submitEdit *result = submitEditorAboutToClose(submitEditor); } -Core::IVersionControl *VCSBasePlugin::versionControl() const +Core::IVersionControl *VcsBasePlugin::versionControl() const { return d->m_versionControl; } -void VCSBasePlugin::slotStateChanged(const VCSBase::Internal::State &newInternalState, Core::IVersionControl *vc) +void VcsBasePlugin::slotStateChanged(const VcsBase::Internal::State &newInternalState, Core::IVersionControl *vc) { if (vc == d->m_versionControl) { // We are directly affected: Change state if (!d->m_state.equals(newInternalState)) { d->m_state.setState(newInternalState); - updateActions(VCSEnabled); + updateActions(VcsEnabled); } } else { // Some other VCS plugin or state changed: Reset us to empty state. - const ActionState newActionState = vc ? OtherVCSEnabled : NoVCSEnabled; + const ActionState newActionState = vc ? OtherVcsEnabled : NoVcsEnabled; if (d->m_actionState != newActionState || !d->m_state.isEmpty()) { d->m_actionState = newActionState; - const VCSBasePluginState emptyState; + const VcsBasePluginState emptyState; d->m_state = emptyState; updateActions(newActionState); } } } -const VCSBasePluginState &VCSBasePlugin::currentState() const +const VcsBasePluginState &VcsBasePlugin::currentState() const { return d->m_state; } -bool VCSBasePlugin::enableMenuAction(ActionState as, QAction *menuAction) const +bool VcsBasePlugin::enableMenuAction(ActionState as, QAction *menuAction) const { if (debug) qDebug() << "enableMenuAction" << menuAction->text() << as; switch (as) { - case VCSBase::VCSBasePlugin::NoVCSEnabled: { + case VcsBase::VcsBasePlugin::NoVcsEnabled: { const bool supportsCreation = d->supportsRepositoryCreation(); menuAction->setVisible(supportsCreation); menuAction->setEnabled(supportsCreation); return supportsCreation; } - case VCSBase::VCSBasePlugin::OtherVCSEnabled: + case VcsBase::VcsBasePlugin::OtherVcsEnabled: menuAction->setVisible(false); return false; - case VCSBase::VCSBasePlugin::VCSEnabled: + case VcsBase::VcsBasePlugin::VcsEnabled: menuAction->setVisible(true); menuAction->setEnabled(true); break; @@ -621,9 +621,9 @@ bool VCSBasePlugin::enableMenuAction(ActionState as, QAction *menuAction) const return true; } -void VCSBasePlugin::promptToDeleteCurrentFile() +void VcsBasePlugin::promptToDeleteCurrentFile() { - const VCSBasePluginState state = currentState(); + const VcsBasePluginState state = currentState(); QTC_ASSERT(state.hasFile(), return) const bool rc = Core::ICore::instance()->vcsManager()->promptToDelete(versionControl(), state.currentFile()); if (!rc) @@ -640,7 +640,7 @@ static inline bool ask(QWidget *parent, const QString &title, const QString &que return QMessageBox::question(parent, title, question, QMessageBox::Yes|QMessageBox::No, defaultButton) == QMessageBox::Yes; } -void VCSBasePlugin::createRepository() +void VcsBasePlugin::createRepository() { QTC_ASSERT(d->m_versionControl->supportsOperation(Core::IVersionControl::CreateRepositoryOperation), return); // Find current starting directory @@ -677,7 +677,7 @@ void VCSBasePlugin::createRepository() } // For internal tests: Create actions driving IVersionControl's snapshot interface. -QList<QAction*> VCSBasePlugin::createSnapShotTestActions() +QList<QAction*> VcsBasePlugin::createSnapShotTestActions() { if (!d->m_testSnapshotAction) { d->m_testSnapshotAction = new QAction(QLatin1String("Take snapshot"), this); @@ -695,40 +695,40 @@ QList<QAction*> VCSBasePlugin::createSnapShotTestActions() return rc; } -void VCSBasePlugin::slotTestSnapshot() +void VcsBasePlugin::slotTestSnapshot() { QTC_ASSERT(currentState().hasTopLevel(), return) d->m_testLastSnapshot = versionControl()->vcsCreateSnapshot(currentState().topLevel()); qDebug() << "Snapshot " << d->m_testLastSnapshot; - VCSBaseOutputWindow::instance()->append(QLatin1String("Snapshot: ") + d->m_testLastSnapshot); + VcsBaseOutputWindow::instance()->append(QLatin1String("Snapshot: ") + d->m_testLastSnapshot); if (!d->m_testLastSnapshot.isEmpty()) d->m_testRestoreSnapshotAction->setText(QLatin1String("Restore snapshot ") + d->m_testLastSnapshot); } -void VCSBasePlugin::slotTestListSnapshots() +void VcsBasePlugin::slotTestListSnapshots() { QTC_ASSERT(currentState().hasTopLevel(), return) const QStringList snapshots = versionControl()->vcsSnapshots(currentState().topLevel()); qDebug() << "Snapshots " << snapshots; - VCSBaseOutputWindow::instance()->append(QLatin1String("Snapshots: ") + snapshots.join(QLatin1String(", "))); + VcsBaseOutputWindow::instance()->append(QLatin1String("Snapshots: ") + snapshots.join(QLatin1String(", "))); } -void VCSBasePlugin::slotTestRestoreSnapshot() +void VcsBasePlugin::slotTestRestoreSnapshot() { QTC_ASSERT(currentState().hasTopLevel() && !d->m_testLastSnapshot.isEmpty(), return) const bool ok = versionControl()->vcsRestoreSnapshot(currentState().topLevel(), d->m_testLastSnapshot); const QString msg = d->m_testLastSnapshot+ (ok ? QLatin1String(" restored") : QLatin1String(" failed")); qDebug() << msg; - VCSBaseOutputWindow::instance()->append(msg); + VcsBaseOutputWindow::instance()->append(msg); } -void VCSBasePlugin::slotTestRemoveSnapshot() +void VcsBasePlugin::slotTestRemoveSnapshot() { QTC_ASSERT(currentState().hasTopLevel() && !d->m_testLastSnapshot.isEmpty(), return) const bool ok = versionControl()->vcsRemoveSnapshot(currentState().topLevel(), d->m_testLastSnapshot); const QString msg = d->m_testLastSnapshot+ (ok ? QLatin1String(" removed") : QLatin1String(" failed")); qDebug() << msg; - VCSBaseOutputWindow::instance()->append(msg); + VcsBaseOutputWindow::instance()->append(msg); d->m_testLastSnapshot.clear(); } @@ -739,11 +739,11 @@ void VCSBasePlugin::slotTestRemoveSnapshot() // AutoFS is used (due its automatically creating mountpoints when querying // a directory). In addition, bail out when reaching the home directory // of the user or root (generally avoid '/', where mountpoints are created). -QString VCSBasePlugin::findRepositoryForDirectory(const QString &dirS, +QString VcsBasePlugin::findRepositoryForDirectory(const QString &dirS, const QString &checkFile) { if (debugRepositorySearch) - qDebug() << ">VCSBasePlugin::findRepositoryForDirectory" << dirS << checkFile; + qDebug() << ">VcsBasePlugin::findRepositoryForDirectory" << dirS << checkFile; QTC_ASSERT(!dirS.isEmpty() && !checkFile.isEmpty(), return QString()); const QString root = QDir::rootPath(); @@ -757,27 +757,27 @@ QString VCSBasePlugin::findRepositoryForDirectory(const QString &dirS, if (QFileInfo(directory, checkFile).isFile()) { if (debugRepositorySearch) - qDebug() << "<VCSBasePlugin::findRepositoryForDirectory> " << absDirPath; + qDebug() << "<VcsBasePlugin::findRepositoryForDirectory> " << absDirPath; return absDirPath; } } while (directory.cdUp()); if (debugRepositorySearch) - qDebug() << "<VCSBasePlugin::findRepositoryForDirectory bailing out at " << directory.absolutePath(); + qDebug() << "<VcsBasePlugin::findRepositoryForDirectory bailing out at " << directory.absolutePath(); return QString(); } // Is SSH prompt configured? static inline QString sshPrompt() { - return VCSBase::Internal::VCSPlugin::instance()->settings().sshPasswordPrompt; + return VcsBase::Internal::VcsPlugin::instance()->settings().sshPasswordPrompt; } -bool VCSBasePlugin::isSshPromptConfigured() +bool VcsBasePlugin::isSshPromptConfigured() { return !sshPrompt().isEmpty(); } -void VCSBasePlugin::setProcessEnvironment(QProcessEnvironment *e, bool forceCLocale) +void VcsBasePlugin::setProcessEnvironment(QProcessEnvironment *e, bool forceCLocale) { if (forceCLocale) e->insert(QLatin1String("LANG"), QString(QLatin1Char('C'))); @@ -787,7 +787,7 @@ void VCSBasePlugin::setProcessEnvironment(QProcessEnvironment *e, bool forceCLoc } // Run a process fully synchronously, returning Utils::SynchronousProcessResponse -// response struct and using the VCSBasePlugin flags as applicable +// response struct and using the VcsBasePlugin flags as applicable static SynchronousProcessResponse runVcsFullySynchronously(const QString &workingDir, const QString &binary, const QStringList &arguments, @@ -796,17 +796,17 @@ static SynchronousProcessResponse runVcsFullySynchronously(const QString &workin unsigned flags, QTextCodec *outputCodec = 0) { - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); // Set up process unsigned processFlags = 0; - if (VCSBasePlugin::isSshPromptConfigured() && (flags & VCSBasePlugin::SshPasswordPrompt)) + if (VcsBasePlugin::isSshPromptConfigured() && (flags & VcsBasePlugin::SshPasswordPrompt)) processFlags |= SynchronousProcess::UnixTerminalDisabled; QSharedPointer<QProcess> process = SynchronousProcess::createProcess(processFlags); if (!workingDir.isEmpty()) process->setWorkingDirectory(workingDir); process->setProcessEnvironment(env); - if (flags & VCSBasePlugin::MergeOutputChannels) + if (flags & VcsBasePlugin::MergeOutputChannels) process->setProcessChannelMode(QProcess::MergedChannels); // Start @@ -827,14 +827,14 @@ static SynchronousProcessResponse runVcsFullySynchronously(const QString &workin if (!stdErr.isEmpty()) { response.stdErr = QString::fromLocal8Bit(stdErr).remove('\r'); - if (!(flags & VCSBasePlugin::SuppressStdErrInLogWindow)) + if (!(flags & VcsBasePlugin::SuppressStdErrInLogWindow)) outputWindow->append(response.stdErr); } if (!stdOut.isEmpty()) { response.stdOut = (outputCodec ? outputCodec->toUnicode(stdOut) : QString::fromLocal8Bit(stdOut)) .remove('\r'); - if (flags & VCSBasePlugin::ShowStdOutInLogWindow) + if (flags & VcsBasePlugin::ShowStdOutInLogWindow) outputWindow->append(response.stdOut); } @@ -852,7 +852,7 @@ static SynchronousProcessResponse runVcsFullySynchronously(const QString &workin } -SynchronousProcessResponse VCSBasePlugin::runVCS(const QString &workingDir, +SynchronousProcessResponse VcsBasePlugin::runVcs(const QString &workingDir, const QString &binary, const QStringList &arguments, int timeOutMS, @@ -860,11 +860,11 @@ SynchronousProcessResponse VCSBasePlugin::runVCS(const QString &workingDir, QTextCodec *outputCodec) { const QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); - return runVCS(workingDir, binary, arguments, timeOutMS, env, + return runVcs(workingDir, binary, arguments, timeOutMS, env, flags, outputCodec); } -SynchronousProcessResponse VCSBasePlugin::runVCS(const QString &workingDir, +SynchronousProcessResponse VcsBasePlugin::runVcs(const QString &workingDir, const QString &binary, const QStringList &arguments, int timeOutMS, @@ -872,15 +872,15 @@ SynchronousProcessResponse VCSBasePlugin::runVCS(const QString &workingDir, unsigned flags, QTextCodec *outputCodec) { - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); if (!(flags & SuppressCommandLogging)) outputWindow->appendCommand(workingDir, binary, arguments); - const bool sshPromptConfigured = VCSBasePlugin::isSshPromptConfigured(); + const bool sshPromptConfigured = VcsBasePlugin::isSshPromptConfigured(); if (debugExecution) { QDebug nsp = qDebug().nospace(); - nsp << "VCSBasePlugin::runVCS" << workingDir << binary << arguments + nsp << "VcsBasePlugin::runVcs" << workingDir << binary << arguments << timeOutMS; if (flags & ShowStdOutInLogWindow) nsp << "stdout"; @@ -902,7 +902,7 @@ SynchronousProcessResponse VCSBasePlugin::runVCS(const QString &workingDir, nsp << " Codec: " << outputCodec->name(); } - VCSBase::VCSBasePlugin::setProcessEnvironment(&env, (flags & ForceCLocale)); + VcsBase::VcsBasePlugin::setProcessEnvironment(&env, (flags & ForceCLocale)); SynchronousProcessResponse response; @@ -958,7 +958,7 @@ SynchronousProcessResponse VCSBasePlugin::runVCS(const QString &workingDir, return response; } -bool VCSBasePlugin::runFullySynchronous(const QString &workingDirectory, +bool VcsBasePlugin::runFullySynchronous(const QString &workingDirectory, const QString &binary, const QStringList &arguments, const QProcessEnvironment &env, @@ -967,7 +967,7 @@ bool VCSBasePlugin::runFullySynchronous(const QString &workingDirectory, int timeoutMS, bool logCommandToWindow) { - VCSBase::VCSBaseOutputWindow *outputWindow = VCSBase::VCSBaseOutputWindow::instance(); + VcsBase::VcsBaseOutputWindow *outputWindow = VcsBase::VcsBaseOutputWindow::instance(); if (logCommandToWindow) outputWindow->appendCommand(workingDirectory, binary, arguments); @@ -997,11 +997,11 @@ bool VCSBasePlugin::runFullySynchronous(const QString &workingDirectory, return process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0; } -bool VCSBasePlugin::runPatch(const QByteArray &input, const QString &workingDirectory, +bool VcsBasePlugin::runPatch(const QByteArray &input, const QString &workingDirectory, int strip, bool reverse) { - VCSBaseOutputWindow *ow = VCSBaseOutputWindow::instance(); - const QString patch = Internal::VCSPlugin::instance()->settings().patchCommand; + VcsBaseOutputWindow *ow = VcsBaseOutputWindow::instance(); + const QString patch = Internal::VcsPlugin::instance()->settings().patchCommand; if (patch.isEmpty()) { ow->appendError(tr("There is no patch-command configured in the common 'Version Control' settings.")); return false; @@ -1045,6 +1045,6 @@ bool VCSBasePlugin::runPatch(const QByteArray &input, const QString &workingDire return true; } -} // namespace VCSBase +} // namespace VcsBase #include "vcsbaseplugin.moc" diff --git a/src/plugins/vcsbase/vcsbaseplugin.h b/src/plugins/vcsbase/vcsbaseplugin.h index 5c163ffd8c..34c56d89f7 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.h +++ b/src/plugins/vcsbase/vcsbaseplugin.h @@ -50,23 +50,23 @@ namespace Utils { struct SynchronousProcessResponse; } namespace Core { class IVersionControl; } -namespace VCSBase { +namespace VcsBase { namespace Internal { struct State; } -class VCSBaseSubmitEditor; -struct VCSBasePluginPrivate; -class VCSBasePluginStateData; -class VCSBasePlugin; +class VcsBaseSubmitEditor; +struct VcsBasePluginPrivate; +class VcsBasePluginStateData; +class VcsBasePlugin; // Documentation inside. -class VCSBASE_EXPORT VCSBasePluginState +class VCSBASE_EXPORT VcsBasePluginState { public: - VCSBasePluginState(); - VCSBasePluginState(const VCSBasePluginState &); - VCSBasePluginState &operator=(const VCSBasePluginState &); - ~VCSBasePluginState(); + VcsBasePluginState(); + VcsBasePluginState(const VcsBasePluginState &); + VcsBasePluginState &operator=(const VcsBasePluginState &); + ~VcsBasePluginState(); void clear(); @@ -102,39 +102,39 @@ public: // the file one. QString topLevel() const; - bool equals(const VCSBasePluginState &rhs) const; + bool equals(const VcsBasePluginState &rhs) const; - friend VCSBASE_EXPORT QDebug operator<<(QDebug in, const VCSBasePluginState &state); + friend VCSBASE_EXPORT QDebug operator<<(QDebug in, const VcsBasePluginState &state); private: - friend class VCSBasePlugin; + friend class VcsBasePlugin; bool equals(const Internal::State &s) const; void setState(const Internal::State &s); - QSharedDataPointer<VCSBasePluginStateData> data; + QSharedDataPointer<VcsBasePluginStateData> data; }; -VCSBASE_EXPORT QDebug operator<<(QDebug in, const VCSBasePluginState &state); +VCSBASE_EXPORT QDebug operator<<(QDebug in, const VcsBasePluginState &state); -inline bool operator==(const VCSBasePluginState &s1, const VCSBasePluginState &s2) +inline bool operator==(const VcsBasePluginState &s1, const VcsBasePluginState &s2) { return s1.equals(s2); } -inline bool operator!=(const VCSBasePluginState &s1, const VCSBasePluginState &s2) +inline bool operator!=(const VcsBasePluginState &s1, const VcsBasePluginState &s2) { return !s1.equals(s2); } -class VCSBASE_EXPORT VCSBasePlugin : public ExtensionSystem::IPlugin +class VCSBASE_EXPORT VcsBasePlugin : public ExtensionSystem::IPlugin { Q_OBJECT protected: - explicit VCSBasePlugin(const QString &submitEditorId); + explicit VcsBasePlugin(const QString &submitEditorId); void initializeVcs(Core::IVersionControl *vc); virtual void extensionsInitialized(); public: - virtual ~VCSBasePlugin(); + virtual ~VcsBasePlugin(); - const VCSBasePluginState ¤tState() const; + const VcsBasePluginState ¤tState() const; Core::IVersionControl *versionControl() const; // For internal tests: Create actions driving IVersionControl's snapshot interface. @@ -155,7 +155,7 @@ public: static bool isSshPromptConfigured(); // Convenience to synchronously run VCS commands - enum RunVCSFlags { + enum RunVcsFlags { ShowStdOutInLogWindow = 0x1, // Append standard output to VCS output window. MergeOutputChannels = 0x2, // see QProcess: Merge stderr/stdout. SshPasswordPrompt = 0x4, // Disable terminal on UNIX to force graphical prompt. @@ -168,7 +168,7 @@ public: // triggered by file watchers). }; - static Utils::SynchronousProcessResponse runVCS(const QString &workingDir, + static Utils::SynchronousProcessResponse runVcs(const QString &workingDir, const QString &binary, const QStringList &arguments, int timeOutMS, @@ -176,7 +176,7 @@ public: unsigned flags = 0, QTextCodec *outputCodec = 0); - static Utils::SynchronousProcessResponse runVCS(const QString &workingDir, + static Utils::SynchronousProcessResponse runVcs(const QString &workingDir, const QString &binary, const QStringList &arguments, int timeOutMS, @@ -197,39 +197,39 @@ public: public slots: // Convenience slot for "Delete current file" action. Prompts to - // delete the file via VCSManager. + // delete the file via VcsManager. void promptToDeleteCurrentFile(); // Prompt to initialize version control in a directory, initially // pointing to the current project. void createRepository(); protected: - enum ActionState { NoVCSEnabled, OtherVCSEnabled, VCSEnabled }; + enum ActionState { NoVcsEnabled, OtherVcsEnabled, VcsEnabled }; // Implement to enable the plugin menu actions according to state. virtual void updateActions(ActionState as) = 0; // Implement to start the submit process. - virtual bool submitEditorAboutToClose(VCSBaseSubmitEditor *submitEditor) = 0; + virtual bool submitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor) = 0; // A helper to enable the VCS menu action according to state: - // NoVCSEnabled -> visible, enabled if repository creation is supported - // OtherVCSEnabled -> invisible + // NoVcsEnabled -> visible, enabled if repository creation is supported + // OtherVcsEnabled -> invisible // Else: -> fully enabled. // Returns whether actions should be set up further. bool enableMenuAction(ActionState as, QAction *in) const; private slots: - void slotSubmitEditorAboutToClose(VCSBaseSubmitEditor *submitEditor, bool *result); - void slotStateChanged(const VCSBase::Internal::State &s, Core::IVersionControl *vc); + void slotSubmitEditorAboutToClose(VcsBaseSubmitEditor *submitEditor, bool *result); + void slotStateChanged(const VcsBase::Internal::State &s, Core::IVersionControl *vc); void slotTestSnapshot(); void slotTestListSnapshots(); void slotTestRestoreSnapshot(); void slotTestRemoveSnapshot(); private: - VCSBasePluginPrivate *d; + VcsBasePluginPrivate *d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASEPLUGIN_H diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp index 07e6645e63..6976057ad7 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.cpp +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.cpp @@ -115,13 +115,13 @@ static const char *belongingClassName(const CPlusPlus::Function *function) } /*! - \struct VCSBase::VCSBaseSubmitEditorParameters + \struct VcsBase::VcsBaseSubmitEditorParameters - \brief Utility struct to parametrize a VCSBaseSubmitEditor. + \brief Utility struct to parametrize a VcsBaseSubmitEditor. */ /*! - \class VCSBase::VCSBaseSubmitEditor + \class VcsBase::VcsBaseSubmitEditor \brief Base class for a submit editor based on the Utils::SubmitEditorWidget. @@ -148,25 +148,25 @@ static const char *belongingClassName(const CPlusPlus::Function *function) current editor in the editor manager. */ -namespace VCSBase { +namespace VcsBase { using namespace Internal; using namespace Utils; static inline QString submitMessageCheckScript() { - return VCSPlugin::instance()->settings().submitMessageCheckScript; + return VcsPlugin::instance()->settings().submitMessageCheckScript; } -struct VCSBaseSubmitEditorPrivate +struct VcsBaseSubmitEditorPrivate { - VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditorParameters *parameters, + VcsBaseSubmitEditorPrivate(const VcsBaseSubmitEditorParameters *parameters, SubmitEditorWidget *editorWidget, QObject *q); SubmitEditorWidget *m_widget; QToolBar *m_toolWidget; - const VCSBaseSubmitEditorParameters *m_parameters; + const VcsBaseSubmitEditorParameters *m_parameters; QString m_displayName; QString m_checkScriptWorkingDirectory; SubmitEditorFile *m_file; @@ -177,7 +177,7 @@ struct VCSBaseSubmitEditorPrivate NickNameDialog *m_nickNameDialog; }; -VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditorParameters *parameters, +VcsBaseSubmitEditorPrivate::VcsBaseSubmitEditorPrivate(const VcsBaseSubmitEditorParameters *parameters, SubmitEditorWidget *editorWidget, QObject *q) : m_widget(editorWidget), @@ -193,9 +193,9 @@ VCSBaseSubmitEditorPrivate::VCSBaseSubmitEditorPrivate(const VCSBaseSubmitEditor m_widget->descriptionEdit()->setCompletionLengthThreshold(4); } -VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters, +VcsBaseSubmitEditor::VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *parameters, SubmitEditorWidget *editorWidget) : - d(new VCSBaseSubmitEditorPrivate(parameters, editorWidget, this)) + d(new VcsBaseSubmitEditorPrivate(parameters, editorWidget, this)) { setContext(Core::Context(parameters->context)); setWidget(d->m_widget); @@ -212,10 +212,10 @@ VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *pa connect(d->m_file, SIGNAL(saveMe(QString*,QString,bool)), this, SLOT(save(QString*,QString,bool))); - connect(d->m_widget, SIGNAL(diffSelected(QStringList)), this, SLOT(slotDiffSelectedVCSFiles(QStringList))); + connect(d->m_widget, SIGNAL(diffSelected(QStringList)), this, SLOT(slotDiffSelectedVcsFiles(QStringList))); connect(d->m_widget->descriptionEdit(), SIGNAL(textChanged()), this, SLOT(slotDescriptionChanged())); - const CommonVcsSettings settings = VCSPlugin::instance()->settings(); + const CommonVcsSettings settings = VcsPlugin::instance()->settings(); // Add additional context menu settings if (!settings.submitMessageCheckScript.isEmpty() || !settings.nickNameMailMap.isEmpty()) { QAction *sep = new QAction(this); @@ -240,23 +240,23 @@ VCSBaseSubmitEditor::VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *pa // wrapping. etc slotUpdateEditorSettings(settings); - connect(VCSPlugin::instance(), - SIGNAL(settingsChanged(VCSBase::Internal::CommonVcsSettings)), - this, SLOT(slotUpdateEditorSettings(VCSBase::Internal::CommonVcsSettings))); + connect(VcsPlugin::instance(), + SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)), + this, SLOT(slotUpdateEditorSettings(VcsBase::Internal::CommonVcsSettings))); Aggregation::Aggregate *aggregate = new Aggregation::Aggregate; aggregate->add(new Find::BaseTextFind(d->m_widget->descriptionEdit())); aggregate->add(this); } -VCSBaseSubmitEditor::~VCSBaseSubmitEditor() +VcsBaseSubmitEditor::~VcsBaseSubmitEditor() { delete d->m_toolWidget; delete d->m_widget; delete d; } -void VCSBaseSubmitEditor::slotUpdateEditorSettings(const CommonVcsSettings &s) +void VcsBaseSubmitEditor::slotUpdateEditorSettings(const CommonVcsSettings &s) { setLineWrapWidth(s.lineWrapWidth); setLineWrap(s.lineWrap); @@ -275,7 +275,7 @@ static inline QStringList fieldTexts(const QString &fileContents) return rc; } -void VCSBaseSubmitEditor::createUserFields(const QString &fieldConfigFile) +void VcsBaseSubmitEditor::createUserFields(const QString &fieldConfigFile) { Utils::FileReader reader; if (!reader.fetch(fieldConfigFile, QIODevice::Text, Core::ICore::instance()->mainWindow())) @@ -285,7 +285,7 @@ void VCSBaseSubmitEditor::createUserFields(const QString &fieldConfigFile) if (fields.empty()) return; // Create a completer on user names - const QStandardItemModel *nickNameModel = VCSPlugin::instance()->nickNameModel(); + const QStandardItemModel *nickNameModel = VcsPlugin::instance()->nickNameModel(); QCompleter *completer = new QCompleter(NickNameDialog::nickNameList(nickNameModel), this); SubmitFieldWidget *fieldWidget = new SubmitFieldWidget; @@ -298,7 +298,7 @@ void VCSBaseSubmitEditor::createUserFields(const QString &fieldConfigFile) d->m_widget->addSubmitFieldWidget(fieldWidget); } -void VCSBaseSubmitEditor::registerActions(QAction *editorUndoAction, QAction *editorRedoAction, +void VcsBaseSubmitEditor::registerActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction, QAction *diffAction) { d->m_widget->registerActions(editorUndoAction, editorRedoAction, submitAction, diffAction); @@ -306,74 +306,74 @@ void VCSBaseSubmitEditor::registerActions(QAction *editorUndoAction, QAction *ed d->m_submitAction = submitAction; } -void VCSBaseSubmitEditor::unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, +void VcsBaseSubmitEditor::unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction, QAction *diffAction) { d->m_widget->unregisterActions(editorUndoAction, editorRedoAction, submitAction, diffAction); d->m_diffAction = d->m_submitAction = 0; } -int VCSBaseSubmitEditor::fileNameColumn() const +int VcsBaseSubmitEditor::fileNameColumn() const { return d->m_widget->fileNameColumn(); } -void VCSBaseSubmitEditor::setFileNameColumn(int c) +void VcsBaseSubmitEditor::setFileNameColumn(int c) { d->m_widget->setFileNameColumn(c); } -QAbstractItemView::SelectionMode VCSBaseSubmitEditor::fileListSelectionMode() const +QAbstractItemView::SelectionMode VcsBaseSubmitEditor::fileListSelectionMode() const { return d->m_widget->fileListSelectionMode(); } -void VCSBaseSubmitEditor::setFileListSelectionMode(QAbstractItemView::SelectionMode sm) +void VcsBaseSubmitEditor::setFileListSelectionMode(QAbstractItemView::SelectionMode sm) { d->m_widget->setFileListSelectionMode(sm); } -bool VCSBaseSubmitEditor::isEmptyFileListEnabled() const +bool VcsBaseSubmitEditor::isEmptyFileListEnabled() const { return d->m_widget->isEmptyFileListEnabled(); } -void VCSBaseSubmitEditor::setEmptyFileListEnabled(bool e) +void VcsBaseSubmitEditor::setEmptyFileListEnabled(bool e) { d->m_widget->setEmptyFileListEnabled(e); } -bool VCSBaseSubmitEditor::lineWrap() const +bool VcsBaseSubmitEditor::lineWrap() const { return d->m_widget->lineWrap(); } -void VCSBaseSubmitEditor::setLineWrap(bool w) +void VcsBaseSubmitEditor::setLineWrap(bool w) { d->m_widget->setLineWrap(w); } -int VCSBaseSubmitEditor::lineWrapWidth() const +int VcsBaseSubmitEditor::lineWrapWidth() const { return d->m_widget->lineWrapWidth(); } -void VCSBaseSubmitEditor::setLineWrapWidth(int w) +void VcsBaseSubmitEditor::setLineWrapWidth(int w) { d->m_widget->setLineWrapWidth(w); } -void VCSBaseSubmitEditor::slotDescriptionChanged() +void VcsBaseSubmitEditor::slotDescriptionChanged() { } -bool VCSBaseSubmitEditor::createNew(const QString &contents) +bool VcsBaseSubmitEditor::createNew(const QString &contents) { setFileContents(contents); return true; } -bool VCSBaseSubmitEditor::open(QString *errorString, const QString &fileName, const QString &realFileName) +bool VcsBaseSubmitEditor::open(QString *errorString, const QString &fileName, const QString &realFileName) { if (fileName.isEmpty()) return false; @@ -391,45 +391,45 @@ bool VCSBaseSubmitEditor::open(QString *errorString, const QString &fileName, co return true; } -Core::IFile *VCSBaseSubmitEditor::file() +Core::IFile *VcsBaseSubmitEditor::file() { return d->m_file; } -QString VCSBaseSubmitEditor::displayName() const +QString VcsBaseSubmitEditor::displayName() const { if (d->m_displayName.isEmpty()) d->m_displayName = QCoreApplication::translate("VCS", d->m_parameters->displayName); return d->m_displayName; } -void VCSBaseSubmitEditor::setDisplayName(const QString &title) +void VcsBaseSubmitEditor::setDisplayName(const QString &title) { d->m_displayName = title; emit changed(); } -QString VCSBaseSubmitEditor::checkScriptWorkingDirectory() const +QString VcsBaseSubmitEditor::checkScriptWorkingDirectory() const { return d->m_checkScriptWorkingDirectory; } -void VCSBaseSubmitEditor::setCheckScriptWorkingDirectory(const QString &s) +void VcsBaseSubmitEditor::setCheckScriptWorkingDirectory(const QString &s) { d->m_checkScriptWorkingDirectory = s; } -bool VCSBaseSubmitEditor::duplicateSupported() const +bool VcsBaseSubmitEditor::duplicateSupported() const { return false; } -Core::IEditor *VCSBaseSubmitEditor::duplicate(QWidget * /*parent*/) +Core::IEditor *VcsBaseSubmitEditor::duplicate(QWidget * /*parent*/) { return 0; } -Core::Id VCSBaseSubmitEditor::id() const +Core::Id VcsBaseSubmitEditor::id() const { return d->m_parameters->id; } @@ -450,7 +450,7 @@ static QToolBar *createToolBar(const QWidget *someWidget, QAction *submitAction, return toolBar; } -QWidget *VCSBaseSubmitEditor::toolBar() +QWidget *VcsBaseSubmitEditor::toolBar() { if (!wantToolBar) return 0; @@ -466,22 +466,22 @@ QWidget *VCSBaseSubmitEditor::toolBar() return d->m_toolWidget; } -QByteArray VCSBaseSubmitEditor::saveState() const +QByteArray VcsBaseSubmitEditor::saveState() const { return QByteArray(); } -bool VCSBaseSubmitEditor::restoreState(const QByteArray &/*state*/) +bool VcsBaseSubmitEditor::restoreState(const QByteArray &/*state*/) { return true; } -QStringList VCSBaseSubmitEditor::checkedFiles() const +QStringList VcsBaseSubmitEditor::checkedFiles() const { return d->m_widget->checkedFiles(); } -void VCSBaseSubmitEditor::setFileModel(QAbstractItemModel *m, const QString &repositoryDirectory) +void VcsBaseSubmitEditor::setFileModel(QAbstractItemModel *m, const QString &repositoryDirectory) { d->m_widget->setFileModel(m); @@ -534,17 +534,17 @@ void VCSBaseSubmitEditor::setFileModel(QAbstractItemModel *m, const QString &rep } } -QAbstractItemModel *VCSBaseSubmitEditor::fileModel() const +QAbstractItemModel *VcsBaseSubmitEditor::fileModel() const { return d->m_widget->fileModel(); } -void VCSBaseSubmitEditor::slotDiffSelectedVCSFiles(const QStringList &rawList) +void VcsBaseSubmitEditor::slotDiffSelectedVcsFiles(const QStringList &rawList) { emit diffSelectedFiles(rawList); } -bool VCSBaseSubmitEditor::save(QString *errorString, const QString &fileName, bool autoSave) +bool VcsBaseSubmitEditor::save(QString *errorString, const QString &fileName, bool autoSave) { const QString fName = fileName.isEmpty() ? d->m_file->fileName() : fileName; Utils::FileSaver saver(fName, QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text); @@ -559,12 +559,12 @@ bool VCSBaseSubmitEditor::save(QString *errorString, const QString &fileName, bo return true; } -QByteArray VCSBaseSubmitEditor::fileContents() const +QByteArray VcsBaseSubmitEditor::fileContents() const { return d->m_widget->descriptionText().toLocal8Bit(); } -bool VCSBaseSubmitEditor::setFileContents(const QString &contents) +bool VcsBaseSubmitEditor::setFileContents(const QString &contents) { d->m_widget->setDescriptionText(contents); return true; @@ -572,8 +572,8 @@ bool VCSBaseSubmitEditor::setFileContents(const QString &contents) enum { checkDialogMinimumWidth = 500 }; -VCSBaseSubmitEditor::PromptSubmitResult - VCSBaseSubmitEditor::promptSubmit(const QString &title, +VcsBaseSubmitEditor::PromptSubmitResult + VcsBaseSubmitEditor::promptSubmit(const QString &title, const QString &question, const QString &checkFailureQuestion, bool *promptSetting, @@ -581,7 +581,7 @@ VCSBaseSubmitEditor::PromptSubmitResult bool canCommitOnFailure) const { SubmitEditorWidget *submitWidget = - static_cast<SubmitEditorWidget *>(const_cast<VCSBaseSubmitEditor *>(this)->widget()); + static_cast<SubmitEditorWidget *>(const_cast<VcsBaseSubmitEditor *>(this)->widget()); raiseSubmitEditor(); @@ -644,23 +644,23 @@ VCSBaseSubmitEditor::PromptSubmitResult return SubmitCanceled; } -QString VCSBaseSubmitEditor::promptForNickName() +QString VcsBaseSubmitEditor::promptForNickName() { if (!d->m_nickNameDialog) - d->m_nickNameDialog = new NickNameDialog(VCSPlugin::instance()->nickNameModel(), d->m_widget); + d->m_nickNameDialog = new NickNameDialog(VcsPlugin::instance()->nickNameModel(), d->m_widget); if (d->m_nickNameDialog->exec() == QDialog::Accepted) return d->m_nickNameDialog->nickName(); return QString(); } -void VCSBaseSubmitEditor::slotInsertNickName() +void VcsBaseSubmitEditor::slotInsertNickName() { const QString nick = promptForNickName(); if (!nick.isEmpty()) d->m_widget->descriptionEdit()->textCursor().insertText(nick); } -void VCSBaseSubmitEditor::slotSetFieldNickName(int i) +void VcsBaseSubmitEditor::slotSetFieldNickName(int i) { if (SubmitFieldWidget *sfw = d->m_widget->submitFieldWidgets().front()) { const QString nick = promptForNickName(); @@ -669,7 +669,7 @@ void VCSBaseSubmitEditor::slotSetFieldNickName(int i) } } -void VCSBaseSubmitEditor::slotCheckSubmitMessage() +void VcsBaseSubmitEditor::slotCheckSubmitMessage() { QString errorMessage; if (!checkSubmitMessage(&errorMessage)) { @@ -680,7 +680,7 @@ void VCSBaseSubmitEditor::slotCheckSubmitMessage() } } -bool VCSBaseSubmitEditor::checkSubmitMessage(QString *errorMessage) const +bool VcsBaseSubmitEditor::checkSubmitMessage(QString *errorMessage) const { const QString checkScript = submitMessageCheckScript(); if (checkScript.isEmpty()) @@ -695,12 +695,12 @@ static inline QString msgCheckScript(const QString &workingDir, const QString &c { const QString nativeCmd = QDir::toNativeSeparators(cmd); return workingDir.isEmpty() ? - VCSBaseSubmitEditor::tr("Executing %1").arg(nativeCmd) : - VCSBaseSubmitEditor::tr("Executing [%1] %2"). + VcsBaseSubmitEditor::tr("Executing %1").arg(nativeCmd) : + VcsBaseSubmitEditor::tr("Executing [%1] %2"). arg(QDir::toNativeSeparators(workingDir), nativeCmd); } -bool VCSBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript, QString *errorMessage) const +bool VcsBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript, QString *errorMessage) const { // Write out message QString tempFilePattern = QDir::tempPath(); @@ -712,7 +712,7 @@ bool VCSBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript if (!saver.finalize(errorMessage)) return false; // Run check process - VCSBaseOutputWindow *outputWindow = VCSBaseOutputWindow::instance(); + VcsBaseOutputWindow *outputWindow = VcsBaseOutputWindow::instance(); outputWindow->appendCommand(msgCheckScript(d->m_checkScriptWorkingDirectory, checkScript)); QProcess checkProcess; if (!d->m_checkScriptWorkingDirectory.isEmpty()) @@ -754,18 +754,18 @@ bool VCSBaseSubmitEditor::runSubmitMessageCheckScript(const QString &checkScript return true; } -QIcon VCSBaseSubmitEditor::diffIcon() +QIcon VcsBaseSubmitEditor::diffIcon() { return QIcon(QLatin1String(":/vcsbase/images/diff.png")); } -QIcon VCSBaseSubmitEditor::submitIcon() +QIcon VcsBaseSubmitEditor::submitIcon() { return QIcon(QLatin1String(":/vcsbase/images/submit.png")); } // Compile a list if files in the current projects. TODO: Recurse down qrc files? -QStringList VCSBaseSubmitEditor::currentProjectFiles(bool nativeSeparators, QString *name) +QStringList VcsBaseSubmitEditor::currentProjectFiles(bool nativeSeparators, QString *name) { if (name) name->clear(); @@ -788,11 +788,11 @@ QStringList VCSBaseSubmitEditor::currentProjectFiles(bool nativeSeparators, QStr // Reduce a list of untracked files reported by a VCS down to the files // that are actually part of the current project(s). -void VCSBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositoryDirectory, QStringList *untrackedFiles) +void VcsBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositoryDirectory, QStringList *untrackedFiles) { if (untrackedFiles->empty()) return; - const QStringList nativeProjectFiles = VCSBaseSubmitEditor::currentProjectFiles(true); + const QStringList nativeProjectFiles = VcsBaseSubmitEditor::currentProjectFiles(true); if (nativeProjectFiles.empty()) return; const QDir repoDir(repositoryDirectory); @@ -807,16 +807,16 @@ void VCSBaseSubmitEditor::filterUntrackedFilesOfProject(const QString &repositor } // Helper to raise an already open submit editor to prevent opening twice. -bool VCSBaseSubmitEditor::raiseSubmitEditor() +bool VcsBaseSubmitEditor::raiseSubmitEditor() { Core::EditorManager *em = Core::EditorManager::instance(); // Nothing to do? if (Core::IEditor *ce = em->currentEditor()) - if (qobject_cast<VCSBaseSubmitEditor*>(ce)) + if (qobject_cast<VcsBaseSubmitEditor*>(ce)) return true; // Try to activate a hidden one foreach (Core::IEditor *e, em->openedEditors()) { - if (qobject_cast<VCSBaseSubmitEditor*>(e)) { + if (qobject_cast<VcsBaseSubmitEditor*>(e)) { em->activateEditor(e, Core::EditorManager::IgnoreNavigationHistory | Core::EditorManager::ModeSwitch); return true; } @@ -824,4 +824,4 @@ bool VCSBaseSubmitEditor::raiseSubmitEditor() return false; } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/vcsbasesubmiteditor.h b/src/plugins/vcsbase/vcsbasesubmiteditor.h index 404131c2ea..98b26f2df6 100644 --- a/src/plugins/vcsbase/vcsbasesubmiteditor.h +++ b/src/plugins/vcsbase/vcsbasesubmiteditor.h @@ -47,13 +47,13 @@ QT_END_NAMESPACE namespace Utils { class SubmitEditorWidget; } -namespace VCSBase { +namespace VcsBase { namespace Internal { class CommonVcsSettings; } -struct VCSBaseSubmitEditorPrivate; +struct VcsBaseSubmitEditorPrivate; -class VCSBASE_EXPORT VCSBaseSubmitEditorParameters +class VCSBASE_EXPORT VcsBaseSubmitEditorParameters { public: const char *mimeType; @@ -62,7 +62,7 @@ public: const char *context; }; -class VCSBASE_EXPORT VCSBaseSubmitEditor : public Core::IEditor +class VCSBASE_EXPORT VcsBaseSubmitEditor : public Core::IEditor { Q_OBJECT Q_PROPERTY(int fileNameColumn READ fileNameColumn WRITE setFileNameColumn DESIGNABLE false) @@ -73,7 +73,7 @@ class VCSBASE_EXPORT VCSBaseSubmitEditor : public Core::IEditor Q_PROPERTY(bool emptyFileListEnabled READ isEmptyFileListEnabled WRITE setEmptyFileListEnabled DESIGNABLE true) protected: - explicit VCSBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters, + explicit VcsBaseSubmitEditor(const VcsBaseSubmitEditorParameters *parameters, Utils::SubmitEditorWidget *editorWidget); public: @@ -83,7 +83,7 @@ public: void unregisterActions(QAction *editorUndoAction, QAction *editorRedoAction, QAction *submitAction = 0, QAction *diffAction = 0); - ~VCSBaseSubmitEditor(); + ~VcsBaseSubmitEditor(); // A utility routine to be called when closing a submit editor. // Runs checks on the message and prompts according to configuration. @@ -157,13 +157,13 @@ signals: void diffSelectedFiles(const QStringList &files); private slots: - void slotDiffSelectedVCSFiles(const QStringList &rawList); + void slotDiffSelectedVcsFiles(const QStringList &rawList); bool save(QString *errorString, const QString &fileName, bool autoSave); void slotDescriptionChanged(); void slotCheckSubmitMessage(); void slotInsertNickName(); void slotSetFieldNickName(int); - void slotUpdateEditorSettings(const VCSBase::Internal::CommonVcsSettings &); + void slotUpdateEditorSettings(const VcsBase::Internal::CommonVcsSettings &); protected: /* These hooks allow for modifying the contents that goes to @@ -178,9 +178,9 @@ private: bool runSubmitMessageCheckScript(const QString &script, QString *errorMessage) const; QString promptForNickName(); - VCSBaseSubmitEditorPrivate *d; + VcsBaseSubmitEditorPrivate *d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASE_SUBMITEDITOR_H diff --git a/src/plugins/vcsbase/vcsbasetextdocument.cpp b/src/plugins/vcsbase/vcsbasetextdocument.cpp index 35bc8817fa..c3c695b6b5 100644 --- a/src/plugins/vcsbase/vcsbasetextdocument.cpp +++ b/src/plugins/vcsbase/vcsbasetextdocument.cpp @@ -32,33 +32,33 @@ #include "vcsbasetextdocument.h" -using namespace VCSBase::Internal; +using namespace VcsBase::Internal; -VCSBaseTextDocument::VCSBaseTextDocument() : +VcsBaseTextDocument::VcsBaseTextDocument() : m_forceReadOnly(false) { } -bool VCSBaseTextDocument::isReadOnly() const +bool VcsBaseTextDocument::isReadOnly() const { return m_forceReadOnly ? true : TextEditor::BaseTextDocument::isReadOnly(); } -bool VCSBaseTextDocument::isModified() const +bool VcsBaseTextDocument::isModified() const { return m_forceReadOnly ? false : TextEditor::BaseTextDocument::isModified(); } -void VCSBaseTextDocument::setForceReadOnly(bool b) +void VcsBaseTextDocument::setForceReadOnly(bool b) { m_forceReadOnly = b; } -bool VCSBaseTextDocument::isForceReadOnly() const +bool VcsBaseTextDocument::isForceReadOnly() const { return m_forceReadOnly; } diff --git a/src/plugins/vcsbase/vcsbasetextdocument.h b/src/plugins/vcsbase/vcsbasetextdocument.h index 67ada98b85..a010757a14 100644 --- a/src/plugins/vcsbase/vcsbasetextdocument.h +++ b/src/plugins/vcsbase/vcsbasetextdocument.h @@ -35,16 +35,16 @@ #include <texteditor/basetextdocument.h> -namespace VCSBase { +namespace VcsBase { namespace Internal { // A read-only text document. -class VCSBaseTextDocument : public TextEditor::BaseTextDocument +class VcsBaseTextDocument : public TextEditor::BaseTextDocument { Q_OBJECT public: - VCSBaseTextDocument(); + VcsBaseTextDocument(); bool isReadOnly() const; bool isModified() const; @@ -57,6 +57,6 @@ private: }; } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // VCSBASETEXTDOCUMENT_H diff --git a/src/plugins/vcsbase/vcsconfigurationpage.cpp b/src/plugins/vcsbase/vcsconfigurationpage.cpp index 44546af633..03b7a45e3f 100644 --- a/src/plugins/vcsbase/vcsconfigurationpage.cpp +++ b/src/plugins/vcsbase/vcsconfigurationpage.cpp @@ -40,7 +40,7 @@ #include <coreplugin/icore.h> #include <coreplugin/iversioncontrol.h> -namespace VCSBase { +namespace VcsBase { namespace Internal { class VcsConfigurationPagePrivate @@ -93,7 +93,7 @@ bool VcsConfigurationPage::isComplete() const void VcsConfigurationPage::openConfiguration() { Core::ICore *core = Core::ICore::instance(); - core->showOptionsDialog(VCSBase::Constants::VCS_SETTINGS_CATEGORY, d->m_versionControl->id()); + core->showOptionsDialog(VcsBase::Constants::VCS_SETTINGS_CATEGORY, d->m_versionControl->id()); } -} // namespace VCSBase +} // namespace VcsBase diff --git a/src/plugins/vcsbase/vcsconfigurationpage.h b/src/plugins/vcsbase/vcsconfigurationpage.h index b5de9330cd..71e9d2be7c 100644 --- a/src/plugins/vcsbase/vcsconfigurationpage.h +++ b/src/plugins/vcsbase/vcsconfigurationpage.h @@ -39,7 +39,7 @@ namespace Core { class IVersionControl; } -namespace VCSBase { +namespace VcsBase { namespace Internal { class VcsConfigurationPagePrivate; } @@ -60,6 +60,6 @@ private: Internal::VcsConfigurationPagePrivate *const d; }; -} // namespace VCSBase +} // namespace VcsBase #endif // VCSCONFIGURATIONPAGE_H diff --git a/src/plugins/vcsbase/vcsconfigurationpage.ui b/src/plugins/vcsbase/vcsconfigurationpage.ui index 7d0efca266..1bb6237879 100644 --- a/src/plugins/vcsbase/vcsconfigurationpage.ui +++ b/src/plugins/vcsbase/vcsconfigurationpage.ui @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>VCSBase::Internal::VcsConfigurationPage</class> - <widget class="QWizardPage" name="VCSBase::Internal::VcsConfigurationPage"> + <class>VcsBase::Internal::VcsConfigurationPage</class> + <widget class="QWizardPage" name="VcsBase::Internal::VcsConfigurationPage"> <property name="geometry"> <rect> <x>0</x> diff --git a/src/plugins/vcsbase/vcsplugin.cpp b/src/plugins/vcsbase/vcsplugin.cpp index 4fad0d30c2..29c2cb8693 100644 --- a/src/plugins/vcsbase/vcsplugin.cpp +++ b/src/plugins/vcsbase/vcsplugin.cpp @@ -45,12 +45,12 @@ #include <QtCore/QtPlugin> #include <QtCore/QDebug> -namespace VCSBase { +namespace VcsBase { namespace Internal { -VCSPlugin *VCSPlugin::m_instance = 0; +VcsPlugin *VcsPlugin::m_instance = 0; -VCSPlugin::VCSPlugin() : +VcsPlugin::VcsPlugin() : m_settingsPage(0), m_nickNameModel(0), m_coreListener(0) @@ -58,12 +58,12 @@ VCSPlugin::VCSPlugin() : m_instance = this; } -VCSPlugin::~VCSPlugin() +VcsPlugin::~VcsPlugin() { m_instance = 0; } -bool VCSPlugin::initialize(const QStringList &arguments, QString *errorMessage) +bool VcsPlugin::initialize(const QStringList &arguments, QString *errorMessage) { Q_UNUSED(arguments) @@ -76,36 +76,36 @@ bool VCSPlugin::initialize(const QStringList &arguments, QString *errorMessage) m_settingsPage = new CommonOptionsPage; addAutoReleasedObject(m_settingsPage); - addAutoReleasedObject(VCSBaseOutputWindow::instance()); - connect(m_settingsPage, SIGNAL(settingsChanged(VCSBase::Internal::CommonVcsSettings)), - this, SIGNAL(settingsChanged(VCSBase::Internal::CommonVcsSettings))); - connect(m_settingsPage, SIGNAL(settingsChanged(VCSBase::Internal::CommonVcsSettings)), + addAutoReleasedObject(VcsBaseOutputWindow::instance()); + connect(m_settingsPage, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)), + this, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings))); + connect(m_settingsPage, SIGNAL(settingsChanged(VcsBase::Internal::CommonVcsSettings)), this, SLOT(slotSettingsChanged())); slotSettingsChanged(); return true; } -void VCSPlugin::extensionsInitialized() +void VcsPlugin::extensionsInitialized() { } -VCSPlugin *VCSPlugin::instance() +VcsPlugin *VcsPlugin::instance() { return m_instance; } -CoreListener *VCSPlugin::coreListener() const +CoreListener *VcsPlugin::coreListener() const { return m_coreListener; } -CommonVcsSettings VCSPlugin::settings() const +CommonVcsSettings VcsPlugin::settings() const { return m_settingsPage->settings(); } /* Delayed creation/update of the nick name model. */ -QStandardItemModel *VCSPlugin::nickNameModel() +QStandardItemModel *VcsPlugin::nickNameModel() { if (!m_nickNameModel) { m_nickNameModel = NickNameDialog::createModel(this); @@ -114,7 +114,7 @@ QStandardItemModel *VCSPlugin::nickNameModel() return m_nickNameModel; } -void VCSPlugin::populateNickNameModel() +void VcsPlugin::populateNickNameModel() { QString errorMessage; if (!NickNameDialog::populateModelFromMailCapFile(settings().nickNameMailMap, @@ -124,13 +124,13 @@ void VCSPlugin::populateNickNameModel() } } -void VCSPlugin::slotSettingsChanged() +void VcsPlugin::slotSettingsChanged() { if (m_nickNameModel) populateNickNameModel(); } } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase -Q_EXPORT_PLUGIN(VCSBase::Internal::VCSPlugin) +Q_EXPORT_PLUGIN(VcsBase::Internal::VcsPlugin) diff --git a/src/plugins/vcsbase/vcsplugin.h b/src/plugins/vcsbase/vcsplugin.h index f92b50fa6b..bc064a6b66 100644 --- a/src/plugins/vcsbase/vcsplugin.h +++ b/src/plugins/vcsbase/vcsplugin.h @@ -41,26 +41,26 @@ QT_BEGIN_NAMESPACE class QStandardItemModel; QT_END_NAMESPACE -namespace VCSBase { +namespace VcsBase { namespace Internal { class CommonVcsSettings; class CommonOptionsPage; class CoreListener; -class VCSPlugin : public ExtensionSystem::IPlugin +class VcsPlugin : public ExtensionSystem::IPlugin { Q_OBJECT public: - VCSPlugin(); - ~VCSPlugin(); + VcsPlugin(); + ~VcsPlugin(); bool initialize(const QStringList &arguments, QString *errorMessage); void extensionsInitialized(); - static VCSPlugin *instance(); + static VcsPlugin *instance(); CoreListener *coreListener() const; @@ -72,7 +72,7 @@ public: QStandardItemModel *nickNameModel(); signals: - void settingsChanged(const VCSBase::Internal::CommonVcsSettings &s); + void settingsChanged(const VcsBase::Internal::CommonVcsSettings &s); private slots: void slotSettingsChanged(); @@ -80,13 +80,13 @@ private slots: private: void populateNickNameModel(); - static VCSPlugin *m_instance; + static VcsPlugin *m_instance; CommonOptionsPage *m_settingsPage; QStandardItemModel *m_nickNameModel; CoreListener *m_coreListener; }; } // namespace Internal -} // namespace VCSBase +} // namespace VcsBase #endif // VCSPLUGIN_H |