Commit 2eadc220 authored by hjk's avatar hjk

vcsbase: style

Change-Id: I139d9d46605383f03215c80bd9e9fd965021b435
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@nokia.com>
parent bf197d7a
...@@ -58,7 +58,8 @@ typedef QMap<QString, QTextCharFormat> ChangeNumberFormatMap; ...@@ -58,7 +58,8 @@ typedef QMap<QString, QTextCharFormat> ChangeNumberFormatMap;
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal {
class BaseAnnotationHighlighterPrivate { class BaseAnnotationHighlighterPrivate
{
public: public:
ChangeNumberFormatMap m_changeNumberMap; ChangeNumberFormatMap m_changeNumberMap;
}; };
......
...@@ -195,9 +195,9 @@ QString BaseCheckoutWizard::openProject(const QString &path, QString *errorMessa ...@@ -195,9 +195,9 @@ QString BaseCheckoutWizard::openProject(const QString &path, QString *errorMessa
return QString(); return QString();
// Open. Do not use a busy cursor here as additional wizards might pop up // Open. Do not use a busy cursor here as additional wizards might pop up
const QString projectFile = projectFiles.front().absoluteFilePath(); const QString projectFile = projectFiles.front().absoluteFilePath();
if (!pe->openProject(projectFile, errorMessage)) { if (!pe->openProject(projectFile, errorMessage))
return QString(); return QString();
}
return projectFile; return projectFile;
} }
......
...@@ -56,12 +56,12 @@ protected: ...@@ -56,12 +56,12 @@ protected:
explicit BaseVCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters); explicit BaseVCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters);
public: public:
virtual ~BaseVCSSubmitEditorFactory(); ~BaseVCSSubmitEditorFactory();
virtual Core::IEditor *createEditor(QWidget *parent); Core::IEditor *createEditor(QWidget *parent);
virtual Core::Id id() const; Core::Id id() const;
virtual QString displayName() const; QString displayName() const;
virtual QStringList mimeTypes() const; QStringList mimeTypes() const;
Core::IFile *open(const QString &fileName); Core::IFile *open(const QString &fileName);
private: private:
...@@ -79,27 +79,19 @@ template <class Editor> ...@@ -79,27 +79,19 @@ template <class Editor>
class VCSSubmitEditorFactory : public BaseVCSSubmitEditorFactory class VCSSubmitEditorFactory : public BaseVCSSubmitEditorFactory
{ {
public: public:
explicit VCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters); explicit VCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters)
: BaseVCSSubmitEditorFactory(parameters)
{
}
private: private:
virtual VCSBaseSubmitEditor VCSBaseSubmitEditor *createBaseSubmitEditor
*createBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters, (const VCSBaseSubmitEditorParameters *parameters, QWidget *parent)
QWidget *parent); {
return new Editor(parameters, parent);
}
}; };
template <class Editor>
VCSSubmitEditorFactory<Editor>::VCSSubmitEditorFactory(const VCSBaseSubmitEditorParameters *parameters) :
BaseVCSSubmitEditorFactory(parameters)
{
}
template <class Editor>
VCSBaseSubmitEditor *VCSSubmitEditorFactory<Editor>::createBaseSubmitEditor(const VCSBaseSubmitEditorParameters *parameters,
QWidget *parent)
{
return new Editor(parameters, parent);
}
} // namespace VCSBase } // namespace VCSBase
#endif // VCSBASE_BASEEDITOR_H #endif // VCSBASE_BASEEDITOR_H
...@@ -40,16 +40,9 @@ ...@@ -40,16 +40,9 @@
#include <QtCore/QProcess> #include <QtCore/QProcess>
#include <QtCore/QProcessEnvironment> #include <QtCore/QProcessEnvironment>
QT_BEGIN_NAMESPACE
class QStringList;
class QByteArray;
QT_END_NAMESPACE
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal { class ProcessCheckoutJobPrivate; }
class ProcessCheckoutJobPrivate;
} // namespace Internal
/* Abstract base class for a job creating an initial project checkout. /* Abstract base class for a job creating an initial project checkout.
* It should be something that runs in the background producing log * It should be something that runs in the background producing log
...@@ -58,6 +51,7 @@ class ProcessCheckoutJobPrivate; ...@@ -58,6 +51,7 @@ class ProcessCheckoutJobPrivate;
class VCSBASE_EXPORT AbstractCheckoutJob : public QObject class VCSBASE_EXPORT AbstractCheckoutJob : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
virtual void start() = 0; virtual void start() = 0;
virtual void cancel() = 0; virtual void cancel() = 0;
...@@ -74,17 +68,18 @@ signals: ...@@ -74,17 +68,18 @@ signals:
class VCSBASE_EXPORT ProcessCheckoutJob : public AbstractCheckoutJob class VCSBASE_EXPORT ProcessCheckoutJob : public AbstractCheckoutJob
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ProcessCheckoutJob(QObject *parent = 0); explicit ProcessCheckoutJob(QObject *parent = 0);
virtual ~ProcessCheckoutJob(); ~ProcessCheckoutJob();
void addStep(const QString &binary, void addStep(const QString &binary,
const QStringList &args, const QStringList &args,
const QString &workingDirectory = QString(), const QString &workingDirectory = QString(),
const QProcessEnvironment &env = QProcessEnvironment::systemEnvironment()); const QProcessEnvironment &env = QProcessEnvironment::systemEnvironment());
virtual void start(); void start();
virtual void cancel(); void cancel();
private slots: private slots:
void slotError(QProcess::ProcessError error); void slotError(QProcess::ProcessError error);
......
...@@ -41,9 +41,7 @@ class AbstractCheckoutJob; ...@@ -41,9 +41,7 @@ class AbstractCheckoutJob;
namespace Internal { namespace Internal {
namespace Ui { namespace Ui { class CheckoutProgressWizardPage; }
class CheckoutProgressWizardPage;
}
class CheckoutProgressWizardPage : public QWizardPage class CheckoutProgressWizardPage : public QWizardPage
{ {
...@@ -81,4 +79,5 @@ private: ...@@ -81,4 +79,5 @@ private:
} // namespace Internal } // namespace Internal
} // namespace VCSBase } // namespace VCSBase
#endif // CHECKOUTPROGRESSWIZARDPAGE_H #endif // CHECKOUTPROGRESSWIZARDPAGE_H
...@@ -88,11 +88,10 @@ void CheckoutWizardDialog::start(const QSharedPointer<AbstractCheckoutJob> &job) ...@@ -88,11 +88,10 @@ void CheckoutWizardDialog::start(const QSharedPointer<AbstractCheckoutJob> &job)
void CheckoutWizardDialog::reject() void CheckoutWizardDialog::reject()
{ {
// First click kills, 2nd closes // First click kills, 2nd closes
if (currentId() == m_progressPageId && m_progressPage->isRunning()) { if (currentId() == m_progressPageId && m_progressPage->isRunning())
m_progressPage->terminate(); m_progressPage->terminate();
} else { else
QWizard::reject(); QWizard::reject();
}
} }
} // namespace Internal } // namespace Internal
......
...@@ -43,8 +43,10 @@ class AbstractCheckoutJob; ...@@ -43,8 +43,10 @@ class AbstractCheckoutJob;
namespace Internal { namespace Internal {
class CheckoutProgressWizardPage; class CheckoutProgressWizardPage;
class CheckoutWizardDialog : public Utils::Wizard { class CheckoutWizardDialog : public Utils::Wizard
{
Q_OBJECT Q_OBJECT
public: public:
explicit CheckoutWizardDialog(const QList<QWizardPage *> &parameterPages, explicit CheckoutWizardDialog(const QList<QWizardPage *> &parameterPages,
QWidget *parent = 0); QWidget *parent = 0);
...@@ -66,4 +68,5 @@ private: ...@@ -66,4 +68,5 @@ private:
} // namespace Internal } // namespace Internal
} // namespace VCSBase } // namespace VCSBase
#endif // CHECKOUTWIZARDDIALOG_H #endif // CHECKOUTWIZARDDIALOG_H
...@@ -85,7 +85,8 @@ static void removeFileRecursion(const QFileInfo &f, QString *errorMessage) ...@@ -85,7 +85,8 @@ static void removeFileRecursion(const QFileInfo &f, QString *errorMessage)
// A QFuture task for cleaning files in the background. // A QFuture task for cleaning files in the background.
// Emits error signal if not all files can be deleted. // Emits error signal if not all files can be deleted.
class CleanFilesTask : public QObject { class CleanFilesTask : public QObject
{
Q_OBJECT Q_OBJECT
public: public:
...@@ -136,7 +137,8 @@ public: ...@@ -136,7 +137,8 @@ public:
QString m_workingDirectory; QString m_workingDirectory;
}; };
CleanDialogPrivate::CleanDialogPrivate() : m_filesModel(new QStandardItemModel(0, columnCount)) CleanDialogPrivate::CleanDialogPrivate() :
m_filesModel(new QStandardItemModel(0, columnCount))
{ {
} }
...@@ -195,7 +197,7 @@ void CleanDialog::setFileList(const QString &workingDirectory, const QStringList ...@@ -195,7 +197,7 @@ void CleanDialog::setFileList(const QString &workingDirectory, const QStringList
const QString qmlProUserSuffix = QLatin1String(".qmlproject.user"); const QString qmlProUserSuffix = QLatin1String(".qmlproject.user");
const QChar slash = QLatin1Char('/'); const QChar slash = QLatin1Char('/');
// Do not initially check patches or 'pro.user' files for deletion. // Do not initially check patches or 'pro.user' files for deletion.
foreach(const QString &fileName, l) { foreach (const QString &fileName, l) {
const QFileInfo fi(workingDirectory + slash + fileName); const QFileInfo fi(workingDirectory + slash + fileName);
const bool isDir = fi.isDir(); const bool isDir = fi.isDir();
QStandardItem *nameItem = new QStandardItem(QDir::toNativeSeparators(fileName)); QStandardItem *nameItem = new QStandardItem(QDir::toNativeSeparators(fileName));
......
...@@ -43,20 +43,20 @@ QT_END_NAMESPACE ...@@ -43,20 +43,20 @@ QT_END_NAMESPACE
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal { class CleanDialogPrivate; }
class CleanDialogPrivate;
} // namespace Internal
class VCSBASE_EXPORT CleanDialog : public QDialog { class VCSBASE_EXPORT CleanDialog : public QDialog
{
Q_OBJECT Q_OBJECT
public: public:
explicit CleanDialog(QWidget *parent = 0); explicit CleanDialog(QWidget *parent = 0);
virtual ~CleanDialog(); ~CleanDialog();
void setFileList(const QString &workingDirectory, const QStringList &); void setFileList(const QString &workingDirectory, const QStringList &);
public slots: public slots:
virtual void accept(); void accept();
protected: protected:
void changeEvent(QEvent *e); void changeEvent(QEvent *e);
...@@ -72,4 +72,5 @@ private: ...@@ -72,4 +72,5 @@ private:
}; };
} // namespace VCSBase } // namespace VCSBase
#endif // CLEANDIALOG_H #endif // CLEANDIALOG_H
...@@ -42,9 +42,7 @@ ...@@ -42,9 +42,7 @@
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal { class CommandPrivate; }
class CommandPrivate;
} // namespace Internal
class VCSBASE_EXPORT Command : public QObject class VCSBASE_EXPORT Command : public QObject
{ {
...@@ -52,9 +50,12 @@ class VCSBASE_EXPORT Command : public QObject ...@@ -52,9 +50,12 @@ class VCSBASE_EXPORT Command : public QObject
public: public:
// Where to report command termination with exit code if desired // Where to report command termination with exit code if desired
enum TerminationReportMode { NoReport, enum TerminationReportMode
ReportStdout, // This assumes UTF8 {
ReportStderr }; NoReport,
ReportStdout, // This assumes UTF8
ReportStderr
};
Command(const QString &binary, Command(const QString &binary,
const QString &workingDirectory, const QString &workingDirectory,
...@@ -104,6 +105,6 @@ private: ...@@ -104,6 +105,6 @@ private:
class Internal::CommandPrivate *const d; class Internal::CommandPrivate *const d;
}; };
} //namespace VCSBase } // namespace VCSBase
#endif // VCSBASE_COMMAND_H #endif // VCSBASE_COMMAND_H
...@@ -116,10 +116,6 @@ void CommonOptionsPage::updateNickNames() ...@@ -116,10 +116,6 @@ void CommonOptionsPage::updateNickNames()
{ {
} }
CommonOptionsPage::~CommonOptionsPage()
{
}
QString CommonOptionsPage::id() const QString CommonOptionsPage::id() const
{ {
return QLatin1String(Constants::VCS_COMMON_SETTINGS_ID); return QLatin1String(Constants::VCS_COMMON_SETTINGS_ID);
......
...@@ -51,7 +51,7 @@ class CommonSettingsWidget : public QWidget ...@@ -51,7 +51,7 @@ class CommonSettingsWidget : public QWidget
public: public:
explicit CommonSettingsWidget(QWidget *parent = 0); explicit CommonSettingsWidget(QWidget *parent = 0);
virtual ~CommonSettingsWidget(); ~CommonSettingsWidget();
CommonVcsSettings settings() const; CommonVcsSettings settings() const;
void setSettings(const CommonVcsSettings &s); void setSettings(const CommonVcsSettings &s);
...@@ -68,15 +68,14 @@ class CommonOptionsPage : public VCSBaseOptionsPage ...@@ -68,15 +68,14 @@ class CommonOptionsPage : public VCSBaseOptionsPage
public: public:
explicit CommonOptionsPage(QObject *parent = 0); explicit CommonOptionsPage(QObject *parent = 0);
virtual ~CommonOptionsPage();
virtual QString id() const; QString id() const;
virtual QString displayName() const; QString displayName() const;
virtual QWidget *createPage(QWidget *parent); QWidget *createPage(QWidget *parent);
virtual void apply(); void apply();
virtual void finish() { } void finish() { }
virtual bool matches(const QString &key) const; bool matches(const QString &key) const;
CommonVcsSettings settings() const { return m_settings; } CommonVcsSettings settings() const { return m_settings; }
......
...@@ -61,5 +61,5 @@ bool CoreListener::editorAboutToClose(Core::IEditor *editor) ...@@ -61,5 +61,5 @@ bool CoreListener::editorAboutToClose(Core::IEditor *editor)
return result; return result;
} }
} } // namespace Internal
} } // namespace VCSBase
...@@ -44,9 +44,10 @@ namespace Internal { ...@@ -44,9 +44,10 @@ namespace Internal {
class CoreListener : public Core::ICoreListener class CoreListener : public Core::ICoreListener
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit CoreListener(QObject *parent = 0); explicit CoreListener(QObject *parent = 0);
virtual bool editorAboutToClose(Core::IEditor *editor); bool editorAboutToClose(Core::IEditor *editor);
signals: signals:
void submitEditorAboutToClose(VCSBaseSubmitEditor *e, bool *result); void submitEditorAboutToClose(VCSBaseSubmitEditor *e, bool *result);
...@@ -54,4 +55,5 @@ signals: ...@@ -54,4 +55,5 @@ signals:
} // Internal } // Internal
} // VCSBase } // VCSBase
#endif // CORELISTENER_H #endif // CORELISTENER_H
...@@ -88,10 +88,12 @@ enum FoldingState { ...@@ -88,10 +88,12 @@ enum FoldingState {
}; };
// --- DiffHighlighterPrivate // --- DiffHighlighterPrivate
class DiffHighlighterPrivate { class DiffHighlighterPrivate
{
public: public:
DiffHighlighterPrivate(const QRegExp &filePattern); DiffHighlighterPrivate(const QRegExp &filePattern);
inline DiffFormats analyzeLine(const QString &block) const;
DiffFormats analyzeLine(const QString &block) const;
const QRegExp m_filePattern; const QRegExp m_filePattern;
const QString m_locationIndicator; const QString m_locationIndicator;
......
...@@ -42,28 +42,23 @@ class QRegExp; ...@@ -42,28 +42,23 @@ class QRegExp;
class QTextCharFormat; class QTextCharFormat;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core { namespace Core { class ICore; }
class ICore; namespace TextEditor { class FontSettingsPage; }
}
namespace TextEditor {
class FontSettingsPage;
}
namespace VCSBase { namespace VCSBase {
namespace Internal { namespace Internal { class DiffHighlighterPrivate; }
class DiffHighlighterPrivate;
} // namespace Internal
class VCSBASE_EXPORT DiffHighlighter : public TextEditor::SyntaxHighlighter class VCSBASE_EXPORT DiffHighlighter : public TextEditor::SyntaxHighlighter
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DiffHighlighter(const QRegExp &filePattern, explicit DiffHighlighter(const QRegExp &filePattern,
QTextDocument *document = 0); QTextDocument *document = 0);
virtual ~DiffHighlighter(); ~DiffHighlighter();
virtual void highlightBlock(const QString &text); void highlightBlock(const QString &text);
// Set formats from a sequence of type QTextCharFormat // Set formats from a sequence of type QTextCharFormat
void setFormats(const QVector<QTextCharFormat> &s); void setFormats(const QVector<QTextCharFormat> &s);
......
...@@ -61,7 +61,8 @@ namespace Internal { ...@@ -61,7 +61,8 @@ namespace Internal {
// For code clarity, a struct representing the entries of a mail map file // For code clarity, a struct representing the entries of a mail map file
// with parse and model functions. // with parse and model functions.
class NickNameEntry { class NickNameEntry
{
public: public:
void clear(); void clear();
bool parse(const QString &); bool parse(const QString &);
...@@ -276,5 +277,5 @@ QStringList NickNameDialog::nickNameList(const QStandardItemModel *model) ...@@ -276,5 +277,5 @@ QStringList NickNameDialog::nickNameList(const QStandardItemModel *model)
return rc; return rc;
} }
} } // namespace Internal
} } // namespace VCSBase
...@@ -55,7 +55,7 @@ void SubmitEditorFile::rename(const QString &newName) ...@@ -55,7 +55,7 @@ void SubmitEditorFile::rename(const QString &newName)
return; return;
} }
void SubmitEditorFile::setFileName(const QString name) void SubmitEditorFile::setFileName(const QString &name)
{ {
m_fileName = name; m_fileName = name;
emit changed(); emit changed();
......
...@@ -50,7 +50,7 @@ public: ...@@ -50,7 +50,7 @@ public:
QString suggestedFileName() const { return QString(); } QString suggestedFileName() const { return QString(); }
bool isModified() const { return m_modified; } bool isModified() const { return m_modified; }
virtual QString mimeType() const; QString mimeType() const;
bool isReadOnly() const { return false; } bool isReadOnly() const { return false; }
bool isSaveAsAllowed() const { return false; } bool isSaveAsAllowed() const { return false; }
bool save(QString *errorString, const QString &fileName, bool autoSave); bool save(QString *errorString, const QString &fileName, bool autoSave);
...@@ -58,7 +58,7 @@ public: ...@@ -58,7 +58,7 @@ public:
bool reload(QString *errorString, ReloadFlag flag, ChangeType type); bool reload(QString *errorString, ReloadFlag flag, ChangeType type);
void rename(const QString &newName); void rename(const QString &newName);
void setFileName(const QString name); void setFileName(const QString &name);
void setModified(bool modified = true); void setModified(bool modified = true);
signals: signals:
......
...@@ -157,4 +157,4 @@ unsigned SubmitFileModel::filter(const QStringList &filter, int column) ...@@ -157,4 +157,4 @@ unsigned SubmitFileModel::filter(const QStringList &filter, int column)
return rc; return rc;
} }
} } // namespace VCSBase
...@@ -167,10 +167,6 @@ void VCSBaseClientPrivate::commandFinishedGotoLine(QObject *editorObject) ...@@ -167,10 +167,6 @@ void VCSBaseClientPrivate::commandFinishedGotoLine(QObject *editorObject)
} }
} }
VCSBaseClient::StatusItem::StatusItem()
{
}