From b9f92c29a0b4a15b3608320ca52fb8fc7dd9fc0c Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Tue, 7 Dec 2010 17:34:43 +0100 Subject: [PATCH] vcsmanager: coding convention --- src/plugins/coreplugin/coreimpl.cpp | 2 +- src/plugins/coreplugin/coreimpl.h | 2 +- src/plugins/coreplugin/icore.cpp | 2 +- src/plugins/coreplugin/icore.h | 4 +-- src/plugins/coreplugin/iversioncontrol.h | 2 +- src/plugins/coreplugin/mainwindow.cpp | 4 +-- src/plugins/coreplugin/mainwindow.h | 6 ++-- src/plugins/coreplugin/vcsmanager.cpp | 33 +++++++++++----------- src/plugins/coreplugin/vcsmanager.h | 19 ++++++------- src/plugins/cpptools/cpptoolsplugin.cpp | 2 +- src/plugins/qt4projectmanager/qt4nodes.cpp | 2 +- src/plugins/vcsbase/vcsbaseplugin.cpp | 2 +- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/src/plugins/coreplugin/coreimpl.cpp b/src/plugins/coreplugin/coreimpl.cpp index 1628bea8246..5bba15ce73f 100644 --- a/src/plugins/coreplugin/coreimpl.cpp +++ b/src/plugins/coreplugin/coreimpl.cpp @@ -129,7 +129,7 @@ VariableManager *CoreImpl::variableManager() const return m_mainwindow->variableManager(); } -VCSManager *CoreImpl::vcsManager() const +VcsManager *CoreImpl::vcsManager() const { return m_mainwindow->vcsManager(); } diff --git a/src/plugins/coreplugin/coreimpl.h b/src/plugins/coreplugin/coreimpl.h index 4fd1149e80f..1c7e2495be1 100644 --- a/src/plugins/coreplugin/coreimpl.h +++ b/src/plugins/coreplugin/coreimpl.h @@ -64,7 +64,7 @@ public: ProgressManager *progressManager() const; ScriptManager *scriptManager() const; VariableManager *variableManager() const; - VCSManager *vcsManager() const; + VcsManager *vcsManager() const; ModeManager *modeManager() const; MimeDatabase *mimeDatabase() const; HelpManager *helpManager() const; diff --git a/src/plugins/coreplugin/icore.cpp b/src/plugins/coreplugin/icore.cpp index b25e741893d..80bddac6b91 100644 --- a/src/plugins/coreplugin/icore.cpp +++ b/src/plugins/coreplugin/icore.cpp @@ -160,7 +160,7 @@ */ /*! - \fn VCSManager *ICore::vcsManager() const + \fn VcsManager *ICore::vcsManager() const \brief Returns the application's vcs manager. The vcs manager can be used to e.g. retrieve information about diff --git a/src/plugins/coreplugin/icore.h b/src/plugins/coreplugin/icore.h index 174a0d3f1bc..565c63b4ca3 100644 --- a/src/plugins/coreplugin/icore.h +++ b/src/plugins/coreplugin/icore.h @@ -59,7 +59,7 @@ class ScriptManager; class SettingsDatabase; class UniqueIDManager; class VariableManager; -class VCSManager; +class VcsManager; class CORE_EXPORT ICore : public QObject { @@ -93,7 +93,7 @@ public: virtual ProgressManager *progressManager() const = 0; virtual ScriptManager *scriptManager() const = 0; virtual VariableManager *variableManager() const = 0; - virtual VCSManager *vcsManager() const = 0; + virtual VcsManager *vcsManager() const = 0; virtual ModeManager *modeManager() const = 0; virtual MimeDatabase *mimeDatabase() const = 0; virtual HelpManager *helpManager() const = 0; diff --git a/src/plugins/coreplugin/iversioncontrol.h b/src/plugins/coreplugin/iversioncontrol.h index d0dd868b1a2..950df069d56 100644 --- a/src/plugins/coreplugin/iversioncontrol.h +++ b/src/plugins/coreplugin/iversioncontrol.h @@ -66,7 +66,7 @@ public: * Returns whether files in this directory should be managed with this * version control. * If \a topLevel is non-null, it should return the topmost directory, - * for which this IVersionControl should be used. The VCSManager assumes + * for which this IVersionControl should be used. The VcsManager assumes * that all files in the returned directory are managed by the same IVersionControl. */ diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index cdc38e30b11..36a52364b97 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -131,7 +131,7 @@ MainWindow::MainWindow() : m_progressManager(new ProgressManagerPrivate()), m_scriptManager(new ScriptManagerPrivate(this)), m_variableManager(new VariableManager), - m_vcsManager(new VCSManager), + m_vcsManager(new VcsManager), m_statusBarManager(0), m_modeManager(0), m_mimeDatabase(new MimeDatabase), @@ -1000,7 +1000,7 @@ MessageManager *MainWindow::messageManager() const return m_messageManager; } -VCSManager *MainWindow::vcsManager() const +VcsManager *MainWindow::vcsManager() const { return m_vcsManager; } diff --git a/src/plugins/coreplugin/mainwindow.h b/src/plugins/coreplugin/mainwindow.h index 90cad8dac6b..b5ec6c906b7 100644 --- a/src/plugins/coreplugin/mainwindow.h +++ b/src/plugins/coreplugin/mainwindow.h @@ -62,7 +62,7 @@ class ScriptManager; class SettingsDatabase; class UniqueIDManager; class VariableManager; -class VCSManager; +class VcsManager; namespace Internal { @@ -107,7 +107,7 @@ public: Core::MimeDatabase *mimeDatabase() const; Core::HelpManager *helpManager() const; - VCSManager *vcsManager() const; + VcsManager *vcsManager() const; QSettings *settings(QSettings::Scope scope) const; inline SettingsDatabase *settingsDatabase() const { return m_settingsDatabase; } virtual QPrinter *printer() const; @@ -186,7 +186,7 @@ private: ProgressManagerPrivate *m_progressManager; ScriptManager *m_scriptManager; QScopedPointer<VariableManager> m_variableManager; - VCSManager *m_vcsManager; + VcsManager *m_vcsManager; StatusBarManager *m_statusBarManager; ModeManager *m_modeManager; MimeDatabase *m_mimeDatabase; diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index a9f191ba13c..991d460a20f 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -59,22 +59,24 @@ static inline VersionControlList allVersionControls() // ---- VCSManagerPrivate: // Maintains a cache of top-level directory->version control. -struct VCSManagerPrivate { +class VcsManagerPrivate +{ +public: VersionControlCache m_cachedMatches; }; -VCSManager::VCSManager(QObject *parent) : +VcsManager::VcsManager(QObject *parent) : QObject(parent), - m_d(new VCSManagerPrivate) + m_d(new VcsManagerPrivate) { } -VCSManager::~VCSManager() +VcsManager::~VcsManager() { delete m_d; } -void VCSManager::extensionsInitialized() +void VcsManager::extensionsInitialized() { // Change signal connections FileManager *fileManager = ICore::instance()->fileManager(); @@ -91,7 +93,7 @@ static bool longerThanPath(QPair<QString, IVersionControl *> &pair1, QPair<QStri return pair1.first.size() > pair2.first.size(); } -IVersionControl* VCSManager::findVersionControlForDirectory(const QString &directory, +IVersionControl* VcsManager::findVersionControlForDirectory(const QString &directory, QString *topLevelDirectory) { typedef VersionControlCache::const_iterator VersionControlCacheConstIterator; @@ -181,14 +183,14 @@ IVersionControl* VCSManager::findVersionControlForDirectory(const QString &direc return 0; } -bool VCSManager::promptToDelete(const QString &fileName) +bool VcsManager::promptToDelete(const QString &fileName) { if (IVersionControl *vc = findVersionControlForDirectory(QFileInfo(fileName).absolutePath())) return promptToDelete(vc, fileName); return true; } -IVersionControl *VCSManager::checkout(const QString &versionControlType, +IVersionControl *VcsManager::checkout(const QString &versionControlType, const QString &directory, const QByteArray &url) { @@ -205,7 +207,7 @@ IVersionControl *VCSManager::checkout(const QString &versionControlType, return 0; } -bool VCSManager::findVersionControl(const QString &versionControlType) +bool VcsManager::findVersionControl(const QString &versionControlType) { foreach (IVersionControl * versionControl, allVersionControls()) { if (versionControl->displayName() == versionControlType) @@ -214,7 +216,7 @@ bool VCSManager::findVersionControl(const QString &versionControlType) return false; } -QString VCSManager::repositoryUrl(const QString &directory) +QString VcsManager::repositoryUrl(const QString &directory) { IVersionControl *vc = findVersionControlForDirectory(directory); @@ -223,15 +225,14 @@ QString VCSManager::repositoryUrl(const QString &directory) return QString(); } -bool VCSManager::promptToDelete(IVersionControl *vc, const QString &fileName) +bool VcsManager::promptToDelete(IVersionControl *vc, const QString &fileName) { QTC_ASSERT(vc, return true) if (!vc->supportsOperation(IVersionControl::DeleteOperation)) return true; - const QString title = QCoreApplication::translate("VCSManager", "Version Control"); - const QString msg = QCoreApplication::translate("VCSManager", - "Would you like to remove this file from the version control system (%1)?\n" - "Note: This might remove the local file.").arg(vc->displayName()); + const QString title = tr("Version Control"); + const QString msg = tr("Would you like to remove this file from the version control system (%1)?\n" + "Note: This might remove the local file.").arg(vc->displayName()); const QMessageBox::StandardButton button = QMessageBox::question(0, title, msg, QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); if (button != QMessageBox::Yes) @@ -239,7 +240,7 @@ bool VCSManager::promptToDelete(IVersionControl *vc, const QString &fileName) return vc->vcsDelete(fileName); } -CORE_EXPORT QDebug operator<<(QDebug in, const VCSManager &v) +CORE_EXPORT QDebug operator<<(QDebug in, const VcsManager &v) { QDebug nospace = in.nospace(); const VersionControlCache::const_iterator cend = v.m_d->m_cachedMatches.constEnd(); diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 124cd2b23f9..5fec545cda1 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -41,12 +41,12 @@ QT_END_NAMESPACE namespace Core { -struct VCSManagerPrivate; +class VcsManagerPrivate; class IVersionControl; -/* VCSManager: +/* VcsManager: * 1) Provides functionality for finding the IVersionControl * for a given - * filename (findVersionControlForDirectory). Note that the VCSManager assumes + * filename (findVersionControlForDirectory). Note that the VcsManager assumes * that if a IVersionControl * manages a directory, then it also manages * all the files and all the subdirectories. * It works by asking all IVersionControl * if they manage the file, and ask @@ -56,13 +56,12 @@ class IVersionControl; * branching repositories and routes them to its signals (repositoryChanged, * filesChanged). */ -class CORE_EXPORT VCSManager : public QObject +class CORE_EXPORT VcsManager : public QObject { Q_OBJECT - Q_DISABLE_COPY(VCSManager) public: - explicit VCSManager(QObject *parent = 0); - virtual ~VCSManager(); + explicit VcsManager(QObject *parent = 0); + virtual ~VcsManager(); void extensionsInitialized(); @@ -82,16 +81,16 @@ public: bool promptToDelete(const QString &fileName); bool promptToDelete(IVersionControl *versionControl, const QString &fileName); - friend CORE_EXPORT QDebug operator<<(QDebug in, const VCSManager &); + friend CORE_EXPORT QDebug operator<<(QDebug in, const VcsManager &); signals: void repositoryChanged(const QString &repository); private: - VCSManagerPrivate *m_d; + VcsManagerPrivate *m_d; }; -CORE_EXPORT QDebug operator<<(QDebug in, const VCSManager &); +CORE_EXPORT QDebug operator<<(QDebug in, const VcsManager &); } // namespace Core diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index 2ac188c5188..c3d43245d97 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -102,7 +102,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) // Objects m_modelManager = new CppModelManager(this); - Core::VCSManager *vcsManager = core->vcsManager(); + Core::VcsManager *vcsManager = core->vcsManager(); Core::FileManager *fileManager = core->fileManager(); connect(vcsManager, SIGNAL(repositoryChanged(QString)), m_modelManager, SLOT(updateModifiedSourceFiles())); diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp index 0d1d3335297..cba364d2573 100644 --- a/src/plugins/qt4projectmanager/qt4nodes.cpp +++ b/src/plugins/qt4projectmanager/qt4nodes.cpp @@ -1036,7 +1036,7 @@ void Qt4PriFileNode::changeFiles(const FileType fileType, QFileInfo fi(m_projectFilePath); if (!fi.isWritable()) { // Try via vcs manager - Core::VCSManager *vcsManager = Core::ICore::instance()->vcsManager(); + Core::VcsManager *vcsManager = Core::ICore::instance()->vcsManager(); Core::IVersionControl *versionControl = vcsManager->findVersionControlForDirectory(fi.absolutePath()); if (!versionControl || versionControl->vcsOpen(m_projectFilePath)) { bool makeWritable = QFile::setPermissions(m_projectFilePath, fi.permissions() | QFile::WriteUser); diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index ddd49ddd9ba..c244ff56ac9 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -202,7 +202,7 @@ void StateListener::slotStateChanged() { const ProjectExplorer::ProjectExplorerPlugin *pe = ProjectExplorer::ProjectExplorerPlugin::instance(); const Core::ICore *core = Core::ICore::instance(); - Core::VCSManager *vcsManager = core->vcsManager(); + Core::VcsManager *vcsManager = core->vcsManager(); // Get the current file. Are we on a temporary submit editor indicated by // temporary path prefix or does the file contains a hash, indicating a project -- GitLab