diff --git a/src/plugins/vcsbase/baseannotationhighlighter.cpp b/src/plugins/vcsbase/baseannotationhighlighter.cpp index 297568c9c39..e84f2e67425 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.cpp +++ b/src/plugins/vcsbase/baseannotationhighlighter.cpp @@ -56,15 +56,19 @@ typedef QMap ChangeNumberFormatMap; */ namespace VCSBase { +namespace Internal { -struct BaseAnnotationHighlighterPrivate { +class BaseAnnotationHighlighterPrivate { +public: ChangeNumberFormatMap m_changeNumberMap; }; +} // namespace Internal + BaseAnnotationHighlighter::BaseAnnotationHighlighter(const ChangeNumbers &changeNumbers, QTextDocument *document) : TextEditor::SyntaxHighlighter(document), - d(new BaseAnnotationHighlighterPrivate) + d(new Internal::BaseAnnotationHighlighterPrivate) { setChangeNumbers(changeNumbers); } diff --git a/src/plugins/vcsbase/baseannotationhighlighter.h b/src/plugins/vcsbase/baseannotationhighlighter.h index ef0058eb297..d5ee5c78dd1 100644 --- a/src/plugins/vcsbase/baseannotationhighlighter.h +++ b/src/plugins/vcsbase/baseannotationhighlighter.h @@ -38,8 +38,9 @@ #include namespace VCSBase { - -struct BaseAnnotationHighlighterPrivate; +namespace Internal { +class BaseAnnotationHighlighterPrivate; +} // namespace Internal class VCSBASE_EXPORT BaseAnnotationHighlighter : public TextEditor::SyntaxHighlighter { @@ -59,7 +60,7 @@ private: // Implement this to return the change number of a line virtual QString changeNumber(const QString &block) const = 0; - BaseAnnotationHighlighterPrivate *d; + Internal::BaseAnnotationHighlighterPrivate *const d; }; } // namespace VCSBase diff --git a/src/plugins/vcsbase/basecheckoutwizard.cpp b/src/plugins/vcsbase/basecheckoutwizard.cpp index ffcb1e45de8..779c25adc0d 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.cpp +++ b/src/plugins/vcsbase/basecheckoutwizard.cpp @@ -65,8 +65,11 @@ */ namespace VCSBase { +namespace Internal { -struct BaseCheckoutWizardPrivate { +class BaseCheckoutWizardPrivate +{ +public: BaseCheckoutWizardPrivate() : dialog(0) {} void clear(); @@ -83,9 +86,11 @@ void BaseCheckoutWizardPrivate::clear() checkoutPath.clear(); } +} // namespace Internal + BaseCheckoutWizard::BaseCheckoutWizard(QObject *parent) : Core::IWizard(parent), - d(new BaseCheckoutWizardPrivate) + d(new Internal::BaseCheckoutWizardPrivate) { } diff --git a/src/plugins/vcsbase/basecheckoutwizard.h b/src/plugins/vcsbase/basecheckoutwizard.h index 582efd561f8..7665bedb42f 100644 --- a/src/plugins/vcsbase/basecheckoutwizard.h +++ b/src/plugins/vcsbase/basecheckoutwizard.h @@ -44,9 +44,11 @@ class QWizardPage; QT_END_NAMESPACE namespace VCSBase { +namespace Internal { +class BaseCheckoutWizardPrivate; +} class AbstractCheckoutJob; -struct BaseCheckoutWizardPrivate; class VCSBASE_EXPORT BaseCheckoutWizard : public Core::IWizard { @@ -78,7 +80,7 @@ private slots: void slotProgressPageShown(); private: - BaseCheckoutWizardPrivate *d; + Internal::BaseCheckoutWizardPrivate *const d; }; } // namespace VCSBase diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.cpp b/src/plugins/vcsbase/basecheckoutwizardpage.cpp index 96853b7c4be..2a006701621 100644 --- a/src/plugins/vcsbase/basecheckoutwizardpage.cpp +++ b/src/plugins/vcsbase/basecheckoutwizardpage.cpp @@ -48,8 +48,11 @@ */ namespace VCSBase { +namespace Internal { -struct BaseCheckoutWizardPagePrivate { +class BaseCheckoutWizardPagePrivate +{ +public: BaseCheckoutWizardPagePrivate() : m_valid(false), m_directoryEdited(false) {} Internal::Ui::BaseCheckoutWizardPage ui; @@ -57,9 +60,11 @@ struct BaseCheckoutWizardPagePrivate { bool m_directoryEdited; }; +} // namespace Internal + BaseCheckoutWizardPage::BaseCheckoutWizardPage(QWidget *parent) : QWizardPage(parent), - d(new BaseCheckoutWizardPagePrivate) + d(new Internal::BaseCheckoutWizardPagePrivate) { d->ui.setupUi(this); diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.h b/src/plugins/vcsbase/basecheckoutwizardpage.h index b50dbcdd71c..b1efd7f9df1 100644 --- a/src/plugins/vcsbase/basecheckoutwizardpage.h +++ b/src/plugins/vcsbase/basecheckoutwizardpage.h @@ -40,12 +40,13 @@ namespace VCSBase { namespace Internal { +class BaseCheckoutWizardPagePrivate; + namespace Ui { class BaseCheckoutWizardPage; } // namespace Ui } // namespace Internal -struct BaseCheckoutWizardPagePrivate; class VCSBASE_EXPORT BaseCheckoutWizardPage : public QWizardPage { @@ -107,7 +108,7 @@ private slots: void slotRefreshBranches(); private: - BaseCheckoutWizardPagePrivate *d; + Internal::BaseCheckoutWizardPagePrivate *const d; }; } // namespace VCSBase diff --git a/src/plugins/vcsbase/basevcseditorfactory.cpp b/src/plugins/vcsbase/basevcseditorfactory.cpp index 9c2ee4c0f1f..59c3c453d6f 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.cpp +++ b/src/plugins/vcsbase/basevcseditorfactory.cpp @@ -49,9 +49,11 @@ */ namespace VCSBase { +namespace Internal { -struct BaseVCSEditorFactoryPrivate +class BaseVCSEditorFactoryPrivate { +public: BaseVCSEditorFactoryPrivate(const VCSBaseEditorParameters *t); const VCSBaseEditorParameters *m_type; @@ -69,8 +71,10 @@ BaseVCSEditorFactoryPrivate::BaseVCSEditorFactoryPrivate(const VCSBaseEditorPara { } +} // namespace Internal + BaseVCSEditorFactory::BaseVCSEditorFactory(const VCSBaseEditorParameters *t) - : d(new BaseVCSEditorFactoryPrivate(t)) + : d(new Internal::BaseVCSEditorFactoryPrivate(t)) { d->m_displayName = QCoreApplication::translate("VCS", t->displayName); } diff --git a/src/plugins/vcsbase/basevcseditorfactory.h b/src/plugins/vcsbase/basevcseditorfactory.h index f60d6a91b81..773295fb986 100644 --- a/src/plugins/vcsbase/basevcseditorfactory.h +++ b/src/plugins/vcsbase/basevcseditorfactory.h @@ -41,8 +41,9 @@ #include namespace VCSBase { - -struct BaseVCSEditorFactoryPrivate; +namespace Internal { +class BaseVCSEditorFactoryPrivate; +} // namespace Internal class VCSBASE_EXPORT BaseVCSEditorFactory : public Core::IEditorFactory { @@ -66,7 +67,7 @@ private: virtual VCSBaseEditorWidget *createVCSBaseEditor(const VCSBaseEditorParameters *type, QWidget *parent) = 0; - BaseVCSEditorFactoryPrivate *d; + Internal::BaseVCSEditorFactoryPrivate *const d; }; // Utility template to create an editor. diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp index b6e5d92b9bd..b401b1e1062 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.cpp @@ -37,8 +37,11 @@ namespace VCSBase { -struct BaseVCSSubmitEditorFactoryPrivate +namespace Internal { + +class BaseVCSSubmitEditorFactoryPrivate { +public: BaseVCSSubmitEditorFactoryPrivate(const VCSBaseSubmitEditorParameters *parameters); const VCSBaseSubmitEditorParameters *m_parameters; @@ -55,8 +58,10 @@ BaseVCSSubmitEditorFactoryPrivate::BaseVCSSubmitEditorFactoryPrivate(const VCSBa { } +} // namespace Internal + BaseVCSSubmitEditorFactory::BaseVCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters) : - d(new BaseVCSSubmitEditorFactoryPrivate(parameters)) + d(new Internal::BaseVCSSubmitEditorFactoryPrivate(parameters)) { } diff --git a/src/plugins/vcsbase/basevcssubmiteditorfactory.h b/src/plugins/vcsbase/basevcssubmiteditorfactory.h index 23e1b4c7c4b..a1f691d4715 100644 --- a/src/plugins/vcsbase/basevcssubmiteditorfactory.h +++ b/src/plugins/vcsbase/basevcssubmiteditorfactory.h @@ -39,9 +39,12 @@ namespace VCSBase { -class VCSBaseSubmitEditor; -struct VCSBaseSubmitEditorParameters; -struct BaseVCSSubmitEditorFactoryPrivate; +class VCSBaseSubmitEditor; +class VCSBaseSubmitEditorParameters; + +namespace Internal { +class BaseVCSSubmitEditorFactoryPrivate; +} // namespace Internal // Parametrizable base class for editor factories creating instances of // VCSBaseSubmitEditor subclasses. @@ -66,7 +69,7 @@ private: *createBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters, QWidget *parent) = 0; - BaseVCSSubmitEditorFactoryPrivate *d; + Internal::BaseVCSSubmitEditorFactoryPrivate *const d; }; // Utility template to create an editor that has a constructor taking the diff --git a/src/plugins/vcsbase/checkoutjobs.cpp b/src/plugins/vcsbase/checkoutjobs.cpp index 4d6aeec73c8..cc98a88accd 100644 --- a/src/plugins/vcsbase/checkoutjobs.cpp +++ b/src/plugins/vcsbase/checkoutjobs.cpp @@ -54,13 +54,20 @@ enum { debug = 0 }; namespace VCSBase { -AbstractCheckoutJob::AbstractCheckoutJob(QObject *parent) : - QObject(parent) +namespace Internal { + +// Use a terminal-less process to suppress SSH prompts. +static inline QSharedPointer createProcess() { + unsigned flags = 0; + if (VCSBasePlugin::isSshPromptConfigured()) + flags = Utils::SynchronousProcess::UnixTerminalDisabled; + return Utils::SynchronousProcess::createProcess(flags); } -struct ProcessCheckoutJobStep +class ProcessCheckoutJobStep { +public: ProcessCheckoutJobStep() {} explicit ProcessCheckoutJobStep(const QString &bin, const QStringList &args, @@ -74,7 +81,9 @@ struct ProcessCheckoutJobStep QProcessEnvironment environment; }; -struct ProcessCheckoutJobPrivate { +class ProcessCheckoutJobPrivate +{ +public: ProcessCheckoutJobPrivate(); QSharedPointer process; @@ -82,13 +91,16 @@ struct ProcessCheckoutJobPrivate { QString binary; }; -// Use a terminal-less process to suppress SSH prompts. -static inline QSharedPointer createProcess() +ProcessCheckoutJobPrivate::ProcessCheckoutJobPrivate() : + process(createProcess()) +{ +} + +} // namespace Internal + +AbstractCheckoutJob::AbstractCheckoutJob(QObject *parent) : + QObject(parent) { - unsigned flags = 0; - if (VCSBasePlugin::isSshPromptConfigured()) - flags = Utils::SynchronousProcess::UnixTerminalDisabled; - return Utils::SynchronousProcess::createProcess(flags); } /*! @@ -97,14 +109,9 @@ static inline QSharedPointer createProcess() \brief Convenience implementation of a VCSBase::AbstractCheckoutJob using a QProcess. */ -ProcessCheckoutJobPrivate::ProcessCheckoutJobPrivate() : - process(createProcess()) -{ -} - ProcessCheckoutJob::ProcessCheckoutJob(QObject *parent) : AbstractCheckoutJob(parent), - d(new ProcessCheckoutJobPrivate) + d(new Internal::ProcessCheckoutJobPrivate) { connect(d->process.data(), SIGNAL(error(QProcess::ProcessError)), this, SLOT(slotError(QProcess::ProcessError))); connect(d->process.data(), SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(slotFinished(int,QProcess::ExitStatus))); @@ -125,7 +132,7 @@ void ProcessCheckoutJob::addStep(const QString &binary, { if (debug) qDebug() << "ProcessCheckoutJob::addStep" << binary << args << workingDirectory; - d->stepQueue.enqueue(ProcessCheckoutJobStep(binary, args, workingDirectory, env)); + d->stepQueue.enqueue(Internal::ProcessCheckoutJobStep(binary, args, workingDirectory, env)); } void ProcessCheckoutJob::slotOutput() @@ -183,7 +190,7 @@ void ProcessCheckoutJob::slotNext() return; } // Launch next - const ProcessCheckoutJobStep step = d->stepQueue.dequeue(); + const Internal::ProcessCheckoutJobStep step = d->stepQueue.dequeue(); d->process->setWorkingDirectory(step.workingDirectory); // Set up SSH correctly. diff --git a/src/plugins/vcsbase/checkoutjobs.h b/src/plugins/vcsbase/checkoutjobs.h index 4f44b328b13..b7257a6faa4 100644 --- a/src/plugins/vcsbase/checkoutjobs.h +++ b/src/plugins/vcsbase/checkoutjobs.h @@ -47,7 +47,9 @@ QT_END_NAMESPACE namespace VCSBase { -struct ProcessCheckoutJobPrivate; +namespace Internal { +class ProcessCheckoutJobPrivate; +} // namespace Internal /* Abstract base class for a job creating an initial project checkout. * It should be something that runs in the background producing log @@ -91,7 +93,7 @@ private slots: void slotNext(); private: - ProcessCheckoutJobPrivate *d; + Internal::ProcessCheckoutJobPrivate *const d; }; } // namespace VCSBase diff --git a/src/plugins/vcsbase/cleandialog.cpp b/src/plugins/vcsbase/cleandialog.cpp index 00e867d332d..c484ab04786 100644 --- a/src/plugins/vcsbase/cleandialog.cpp +++ b/src/plugins/vcsbase/cleandialog.cpp @@ -52,16 +52,8 @@ #include #include -/*! - \class VCSBase::CleanDialog - - \brief File selector dialog for files not under version control. - - Completely clean a directory under version control - from all files that are not under version control based on a list - generated from the version control system. Presents the user with - a checkable list of files and/or directories. Double click opens a file. -*/ +namespace VCSBase { +namespace Internal { enum { nameColumn, columnCount }; enum { fileNameRole = Qt::UserRole, isDirectoryRole = Qt::UserRole + 1 }; @@ -91,12 +83,11 @@ static void removeFileRecursion(const QFileInfo &f, QString *errorMessage) } } -namespace VCSBase { - // A QFuture task for cleaning files in the background. // Emits error signal if not all files can be deleted. class CleanFilesTask : public QObject { Q_OBJECT + public: explicit CleanFilesTask(const QString &repository, const QStringList &files); @@ -134,7 +125,10 @@ void CleanFilesTask::run() } // ---------------- CleanDialogPrivate ---------------- -struct CleanDialogPrivate { + +class CleanDialogPrivate +{ +public: CleanDialogPrivate(); Internal::Ui::CleanDialog ui; @@ -146,9 +140,22 @@ CleanDialogPrivate::CleanDialogPrivate() : m_filesModel(new QStandardItemModel(0 { } +} // namespace Internal + +/*! + \class VCSBase::CleanDialog + + \brief File selector dialog for files not under version control. + + Completely clean a directory under version control + from all files that are not under version control based on a list + generated from the version control system. Presents the user with + a checkable list of files and/or directories. Double click opens a file. +*/ + CleanDialog::CleanDialog(QWidget *parent) : QDialog(parent), - d(new CleanDialogPrivate) + d(new Internal::CleanDialogPrivate) { setModal(true); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); @@ -200,8 +207,8 @@ void CleanDialog::setFileList(const QString &workingDirectory, const QStringList || fileName.endsWith(qmlProUserSuffix)); nameItem->setCheckable(true); nameItem->setCheckState(saveFile ? Qt::Unchecked : Qt::Checked); - nameItem->setData(QVariant(fi.absoluteFilePath()), fileNameRole); - nameItem->setData(QVariant(isDir), isDirectoryRole); + nameItem->setData(QVariant(fi.absoluteFilePath()), Internal::fileNameRole); + nameItem->setData(QVariant(isDir), Internal::isDirectoryRole); // Tooltip with size information if (fi.isFile()) { const QString lastModified = fi.lastModified().toString(Qt::DefaultLocaleShortDate); @@ -222,7 +229,7 @@ QStringList CleanDialog::checkedFiles() const for (int r = 0; r < rowCount; r++) { const QStandardItem *item = d->m_filesModel->item(r, 0); if (item->checkState() == Qt::Checked) - rc.push_back(item->data(fileNameRole).toString()); + rc.push_back(item->data(Internal::fileNameRole).toString()); } } return rc; @@ -247,12 +254,12 @@ bool CleanDialog::promptToDelete() return false; // Remove in background - CleanFilesTask *cleanTask = new CleanFilesTask(d->m_workingDirectory, selectedFiles); + Internal::CleanFilesTask *cleanTask = new Internal::CleanFilesTask(d->m_workingDirectory, selectedFiles); connect(cleanTask, SIGNAL(error(QString)), VCSBase::VCSBaseOutputWindow::instance(), SLOT(appendSilently(QString)), Qt::QueuedConnection); - QFuture task = QtConcurrent::run(cleanTask, &CleanFilesTask::run); + QFuture 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, @@ -264,8 +271,8 @@ void CleanDialog::slotDoubleClicked(const QModelIndex &index) { // Open file on doubleclick if (const QStandardItem *item = d->m_filesModel->itemFromIndex(index)) - if (!item->data(isDirectoryRole).toBool()) { - const QString fname = item->data(fileNameRole).toString(); + if (!item->data(Internal::isDirectoryRole).toBool()) { + const QString fname = item->data(Internal::fileNameRole).toString(); Core::EditorManager::instance()->openEditor(fname, Core::Id(), Core::EditorManager::ModeSwitch); } } diff --git a/src/plugins/vcsbase/cleandialog.h b/src/plugins/vcsbase/cleandialog.h index 4fd5a5d0ee1..9e52fa2dc11 100644 --- a/src/plugins/vcsbase/cleandialog.h +++ b/src/plugins/vcsbase/cleandialog.h @@ -42,7 +42,10 @@ class QModelIndex; QT_END_NAMESPACE namespace VCSBase { -struct CleanDialogPrivate; + +namespace Internal { +class CleanDialogPrivate; +} // namespace Internal class VCSBASE_EXPORT CleanDialog : public QDialog { Q_OBJECT @@ -65,7 +68,7 @@ private: QStringList checkedFiles() const; bool promptToDelete(); - CleanDialogPrivate *d; + Internal::CleanDialogPrivate *const d; }; } // namespace VCSBase diff --git a/src/plugins/vcsbase/command.cpp b/src/plugins/vcsbase/command.cpp index 077d1e39ecd..3edca505623 100644 --- a/src/plugins/vcsbase/command.cpp +++ b/src/plugins/vcsbase/command.cpp @@ -47,8 +47,6 @@ Q_DECLARE_METATYPE(QVariant) -namespace VCSBase { - static QString msgTermination(int exitCode, const QString &binaryPath, const QStringList &args) { QString cmd = QFileInfo(binaryPath).baseName(); @@ -61,6 +59,9 @@ 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 Internal { + class CommandPrivate { public: @@ -112,10 +113,12 @@ CommandPrivate::Job::Job(const QStringList &a, int t) : Q_UNUSED(qvMetaId) } +} // namespace Internal + Command::Command(const QString &binary, const QString &workingDirectory, const QProcessEnvironment &environment) : - d(new CommandPrivate(binary, workingDirectory, environment)) + d(new Internal::CommandPrivate(binary, workingDirectory, environment)) { } @@ -176,14 +179,11 @@ void Command::addJob(const QStringList &arguments) void Command::addJob(const QStringList &arguments, int timeout) { - d->m_jobs.push_back(CommandPrivate::Job(arguments, timeout)); + d->m_jobs.push_back(Internal::CommandPrivate::Job(arguments, timeout)); } void Command::execute() { - if (Constants::Internal::debug) - qDebug() << "Command::execute" << d->m_workingDirectory << d->m_jobs.size(); - d->m_lastExecSuccess = false; d->m_lastExecExitCode = -1; @@ -217,10 +217,6 @@ QString Command::msgTimeout(int seconds) void Command::run() { - if (Constants::Internal::debug) - qDebug() << "Command::run" << workingDirectory() << d->m_jobs.size() - << "terminal_disabled" << unixTerminalDisabled(); - // Check that the binary path is not empty if (binaryPath().trimmed().isEmpty()) { emit errorText(tr("Unable to start process, binary is empty")); @@ -244,9 +240,6 @@ void Command::run() int exitCode = -1; bool ok = true; for (int j = 0; j < count; j++) { - if (Constants::Internal::debug) - qDebug() << "Command::run" << j << '/' << count << d->m_jobs.at(j).arguments; - process->start(binaryPath(), d->m_jobs.at(j).arguments); if (!process->waitForStarted()) { ok = false; diff --git a/src/plugins/vcsbase/command.h b/src/plugins/vcsbase/command.h index 87ea74aa2cf..93881aefe05 100644 --- a/src/plugins/vcsbase/command.h +++ b/src/plugins/vcsbase/command.h @@ -42,6 +42,10 @@ namespace VCSBase { +namespace Internal { +class CommandPrivate; +} // namespace Internal + class VCSBASE_EXPORT Command : public QObject { Q_OBJECT @@ -97,7 +101,7 @@ signals: void success(const QVariant &cookie); private: - class CommandPrivate *d; + class Internal::CommandPrivate *const d; }; } //namespace VCSBase diff --git a/src/plugins/vcsbase/commonvcssettings.h b/src/plugins/vcsbase/commonvcssettings.h index 3018677a2a0..6315b5a5888 100644 --- a/src/plugins/vcsbase/commonvcssettings.h +++ b/src/plugins/vcsbase/commonvcssettings.h @@ -44,8 +44,9 @@ namespace VCSBase { namespace Internal { // Common VCS settings, message check script and user nick names. -struct CommonVcsSettings +class CommonVcsSettings { +public: CommonVcsSettings(); QString nickNameMailMap; diff --git a/src/plugins/vcsbase/diffhighlighter.h b/src/plugins/vcsbase/diffhighlighter.h index e1c5bf81e22..bf190922aa5 100644 --- a/src/plugins/vcsbase/diffhighlighter.h +++ b/src/plugins/vcsbase/diffhighlighter.h @@ -71,7 +71,7 @@ public: QRegExp filePattern() const; private: - Internal::DiffHighlighterPrivate *d; + Internal::DiffHighlighterPrivate *const d; }; } // namespace VCSBase diff --git a/src/plugins/vcsbase/nicknamedialog.cpp b/src/plugins/vcsbase/nicknamedialog.cpp index ab86c469702..29b504f26da 100644 --- a/src/plugins/vcsbase/nicknamedialog.cpp +++ b/src/plugins/vcsbase/nicknamedialog.cpp @@ -61,7 +61,8 @@ namespace Internal { // For code clarity, a struct representing the entries of a mail map file // with parse and model functions. -struct NickNameEntry { +class NickNameEntry { +public: void clear(); bool parse(const QString &); QString nickName() const; diff --git a/src/plugins/vcsbase/submitfilemodel.cpp b/src/plugins/vcsbase/submitfilemodel.cpp index 72995971822..113357dc981 100644 --- a/src/plugins/vcsbase/submitfilemodel.cpp +++ b/src/plugins/vcsbase/submitfilemodel.cpp @@ -154,8 +154,6 @@ unsigned SubmitFileModel::filter(const QStringList &filter, int column) qDeleteAll(takeRow(r)); rc++; } - if (VCSBase::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << " deleted " << rc << " items using " << filter << " , remaining " << rowCount(); return rc; } diff --git a/src/plugins/vcsbase/submitfilemodel.h b/src/plugins/vcsbase/submitfilemodel.h index 3185fd3bc1e..0d590ae4e3a 100644 --- a/src/plugins/vcsbase/submitfilemodel.h +++ b/src/plugins/vcsbase/submitfilemodel.h @@ -67,6 +67,6 @@ public: unsigned filter(const QStringList &filter, int column); }; -} +} // namespace VCSBase #endif // SUBMITMODEL_H diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp index 8e3949c2fcd..fb40dcb7e58 100644 --- a/src/plugins/vcsbase/vcsbaseclient.cpp +++ b/src/plugins/vcsbase/vcsbaseclient.cpp @@ -601,9 +601,6 @@ Command *VCSBaseClient::createCommand(const QString &workingDirectory, VCSBase::VCSBaseEditorWidget *editor, JobOutputBindMode mode) { - if (Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << workingDirectory << editor; - Command *cmd = new Command(d->m_clientSettings->stringValue(VCSBaseClientSettings::binaryPathKey), workingDirectory, processEnvironment()); cmd->setDefaultTimeout(d->m_clientSettings->intValue(VCSBaseClientSettings::timeoutKey)); diff --git a/src/plugins/vcsbase/vcsbaseclient.h b/src/plugins/vcsbase/vcsbaseclient.h index 9807223c27e..e8b1d1317e1 100644 --- a/src/plugins/vcsbase/vcsbaseclient.h +++ b/src/plugins/vcsbase/vcsbaseclient.h @@ -63,8 +63,9 @@ class VCSBASE_EXPORT VCSBaseClient : public QObject Q_OBJECT public: - struct VCSBASE_EXPORT StatusItem + class VCSBASE_EXPORT StatusItem { + public: StatusItem(); StatusItem(const QString &s, const QString &f); QString flags; diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index 82cd59301b9..cf302bbcd9c 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -156,6 +156,7 @@ bool operator==(const SettingValue &lhs, const SettingValue &rhs) namespace VCSBase { +namespace Internal { class VCSBaseClientSettingsPrivate : public QSharedData { public: @@ -176,6 +177,8 @@ public: QString m_settingsGroup; }; +} // namespace Internal + /*! \class VCSBase::VCSBaseClientSettings @@ -192,7 +195,7 @@ const QLatin1String VCSBaseClientSettings::promptOnSubmitKey("PromptOnSubmit"); const QLatin1String VCSBaseClientSettings::timeoutKey("Timeout"); VCSBaseClientSettings::VCSBaseClientSettings() : - d(new VCSBaseClientSettingsPrivate) + d(new Internal::VCSBaseClientSettingsPrivate) { declareKey(binaryPathKey, QLatin1String("")); declareKey(userNameKey, QLatin1String("")); diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index c4026e7f6bf..cdc4ad2ab00 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -45,7 +45,9 @@ QT_END_NAMESPACE namespace VCSBase { +namespace Internal { class VCSBaseClientSettingsPrivate; +} // namespace Internal class VCSBASE_EXPORT VCSBaseClientSettings { @@ -93,7 +95,7 @@ protected: private: friend bool equals(const VCSBaseClientSettings &rhs); friend class VCSBaseClientSettingsPrivate; - QSharedDataPointer d; + QSharedDataPointer d; }; inline bool operator==(const VCSBaseClientSettings &s1, const VCSBaseClientSettings &s2) diff --git a/src/plugins/vcsbase/vcsbaseconstants.h b/src/plugins/vcsbase/vcsbaseconstants.h index 986a126c12d..cd6e36348b8 100644 --- a/src/plugins/vcsbase/vcsbaseconstants.h +++ b/src/plugins/vcsbase/vcsbaseconstants.h @@ -52,10 +52,6 @@ const char VCS_ID_SUBVERSION[] = "J.Subversion"; const char VCS_ID_PERFORCE[] = "P.Perforce"; const char VCS_ID_CVS[] = "Z.CVS"; -namespace Internal { - enum { debug = 0 }; -} // namespace Internal - } // namespace Constants } // namespace VCSBase diff --git a/src/plugins/vcsbase/vcsbaseeditor.cpp b/src/plugins/vcsbase/vcsbaseeditor.cpp index 5ae6d97a857..eff7a179524 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.cpp +++ b/src/plugins/vcsbase/vcsbaseeditor.cpp @@ -210,8 +210,11 @@ VCSBaseDiffEditor::VCSBaseDiffEditor(VCSBaseEditorWidget *w, const VCSBaseEditor // ----------- VCSBaseEditorPrivate -struct VCSBaseEditorWidgetPrivate +namespace Internal { + +class VCSBaseEditorWidgetPrivate { +public: VCSBaseEditorWidgetPrivate(const VCSBaseEditorParameters *type); const VCSBaseEditorParameters *m_parameters; @@ -246,6 +249,8 @@ VCSBaseEditorWidgetPrivate::VCSBaseEditorWidgetPrivate(const VCSBaseEditorParame { } +} // namespace Internal + /*! \struct VCSBase::VCSBaseEditorParameters @@ -271,11 +276,8 @@ VCSBaseEditorWidgetPrivate::VCSBaseEditorWidgetPrivate(const VCSBaseEditorParame VCSBaseEditorWidget::VCSBaseEditorWidget(const VCSBaseEditorParameters *type, QWidget *parent) : BaseTextEditorWidget(parent), - d(new VCSBaseEditorWidgetPrivate(type)) + d(new Internal::VCSBaseEditorWidgetPrivate(type)) { - if (VCSBase::Constants::Internal::debug) - qDebug() << "VCSBaseEditor::VCSBaseEditor" << type->type << type->id; - viewport()->setMouseTracking(true); setBaseTextDocument(new Internal::VCSBaseTextDocument); setMimeType(QLatin1String(d->m_parameters->mimeType)); @@ -678,8 +680,6 @@ void VCSBaseEditorWidget::keyPressEvent(QKeyEvent *e) void VCSBaseEditorWidget::describe() { - if (VCSBase::Constants::Internal::debug) - qDebug() << "VCSBaseEditor::describe" << d->m_currentChange; if (!d->m_currentChange.isEmpty()) emit describeRequested(d->m_source, d->m_currentChange); } @@ -694,8 +694,6 @@ void VCSBaseEditorWidget::slotActivateAnnotation() const QSet changes = annotationChanges(); if (changes.isEmpty()) return; - if (VCSBase::Constants::Internal::debug) - qDebug() << "VCSBaseEditor::slotActivateAnnotation(): #" << changes.size(); disconnect(this, SIGNAL(textChanged()), this, SLOT(slotActivateAnnotation())); @@ -763,9 +761,6 @@ void VCSBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor) } } - if (VCSBase::Constants::Internal::debug) - qDebug() << "VCSBaseEditor::jumpToChangeFromDiff()1" << chunkStart << lineCount; - if (chunkStart == -1 || lineCount < 0 || !block.isValid()) return; @@ -777,9 +772,6 @@ void VCSBaseEditorWidget::jumpToChangeFromDiff(QTextCursor cursor) const bool exists = fileName.isEmpty() ? false : QFile::exists(fileName); - if (VCSBase::Constants::Internal::debug) - qDebug() << "VCSBaseEditor::jumpToChangeFromDiff()2" << fileName << "ex=" << exists << "line" << chunkStart << lineCount; - if (!exists) return; @@ -878,13 +870,9 @@ static QTextCodec *findFileCodec(const QString &source) for (EditorList::const_iterator it = editors.constBegin(); it != ecend; ++it) if (const TextEditor::BaseTextEditor *be = qobject_cast(*it)) { QTextCodec *codec = be->editorWidget()->textCodec(); - if (VCSBase::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << source << codec->name(); return codec; } } - if (VCSBase::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << source << "not found"; return 0; } @@ -901,13 +889,9 @@ static QTextCodec *findProjectCodec(const QString &dir) if (const Core::IFile *file = (*it)->file()) if (file->fileName().startsWith(dir)) { QTextCodec *codec = (*it)->editorConfiguration()->textCodec(); - if (VCSBase::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << dir << (*it)->displayName() << codec->name(); return codec; } } - if (VCSBase::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << dir << "not found"; return 0; } @@ -924,8 +908,6 @@ QTextCodec *VCSBaseEditorWidget::getCodec(const QString &source) return pc; } QTextCodec *sys = QTextCodec::codecForLocale(); - if (VCSBase::Constants::Internal::debug) - qDebug() << Q_FUNC_INFO << source << "defaulting to " << sys->name(); return sys; } @@ -1189,8 +1171,6 @@ Core::IEditor* VCSBaseEditorWidget::locateEditorByTag(const QString &tag) break; } } - if (VCSBase::Constants::Internal::debug) - qDebug() << "locateEditorByTag " << tag << rc; return rc; } diff --git a/src/plugins/vcsbase/vcsbaseeditor.h b/src/plugins/vcsbase/vcsbaseeditor.h index ce0692785b4..156787143b7 100644 --- a/src/plugins/vcsbase/vcsbaseeditor.h +++ b/src/plugins/vcsbase/vcsbaseeditor.h @@ -51,7 +51,10 @@ namespace Core { namespace VCSBase { -struct VCSBaseEditorWidgetPrivate; +namespace Internal { +class VCSBaseEditorWidgetPrivate; +} // namespace Internal + class DiffHighlighter; class BaseAnnotationHighlighter; @@ -63,8 +66,9 @@ enum EditorContentType { DiffOutput }; -struct VCSBASE_EXPORT VCSBaseEditorParameters +class VCSBASE_EXPORT VCSBaseEditorParameters { +public: EditorContentType type; const char *id; const char *displayName; @@ -263,7 +267,7 @@ private: QAction *createAnnotateAction(const QString &change, bool previous = false); QAction *createCopyRevisionAction(const QString &change); - VCSBaseEditorWidgetPrivate *d; + Internal::VCSBaseEditorWidgetPrivate *const d; }; } // namespace VCSBase diff --git a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp index 0c65239a0c0..5b9c93db93e 100644 --- a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp +++ b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.cpp @@ -80,19 +80,6 @@ private: Type m_type; }; -} // namespace Internal - -VCSBaseEditorParameterWidget::ComboBoxItem::ComboBoxItem() -{ -} - -VCSBaseEditorParameterWidget::ComboBoxItem::ComboBoxItem(const QString &text, - const QVariant &val) : - displayText(text), - value(val) -{ -} - class VCSBaseEditorParameterWidgetPrivate { public: @@ -103,10 +90,12 @@ public: QStringList m_baseArguments; QHBoxLayout *m_layout; QList m_optionMappings; - QHash m_settingMapping; + QHash m_settingMapping; QStringList m_comboBoxOptionTemplate; }; +} // namespace Internal + /*! \class VCSBase::VCSBaseEditorParameterWidget @@ -118,8 +107,19 @@ public: that should trigger the rerun of the VCS operation. */ +VCSBaseEditorParameterWidget::ComboBoxItem::ComboBoxItem() +{ +} + +VCSBaseEditorParameterWidget::ComboBoxItem::ComboBoxItem(const QString &text, + const QVariant &val) : + displayText(text), + value(val) +{ +} + VCSBaseEditorParameterWidget::VCSBaseEditorParameterWidget(QWidget *parent) : - QWidget(parent), d(new VCSBaseEditorParameterWidgetPrivate) + QWidget(parent), d(new Internal::VCSBaseEditorParameterWidgetPrivate) { d->m_layout = new QHBoxLayout(this); d->m_layout->setContentsMargins(3, 0, 3, 0); diff --git a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h index 4f8b6cb2ad0..9588e86ed6d 100644 --- a/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h +++ b/src/plugins/vcsbase/vcsbaseeditorparameterwidget.h @@ -45,7 +45,10 @@ class QToolButton; QT_END_NAMESPACE namespace VCSBase { + +namespace Internal { class VCSBaseEditorParameterWidgetPrivate; +} // namespace // Documentation->inside. class VCSBASE_EXPORT VCSBaseEditorParameterWidget : public QWidget @@ -103,8 +106,8 @@ protected: void updateMappedSettings(); private: - friend class VCSBaseEditorParameterWidgetPrivate; - VCSBaseEditorParameterWidgetPrivate *d; + friend class Internal::VCSBaseEditorParameterWidgetPrivate; + Internal::VCSBaseEditorParameterWidgetPrivate *const d; }; } // namespace VCSBase