diff options
209 files changed, 897 insertions, 691 deletions
diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp index c3110f77d0..3c17b25583 100644 --- a/src/plugins/coreplugin/rightpane.cpp +++ b/src/plugins/coreplugin/rightpane.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "rightpane.h" #include <QtGui/QVBoxLayout> diff --git a/src/plugins/coreplugin/rightpane.h b/src/plugins/coreplugin/rightpane.h index 89e717cbb2..c542c85f4c 100644 --- a/src/plugins/coreplugin/rightpane.h +++ b/src/plugins/coreplugin/rightpane.h @@ -30,16 +30,18 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef RIGHTPANE_H #define RIGHTPANE_H #include "core_global.h" + #include <QtGui/QWidget> #include <QtCore/QSettings> namespace Core { -class IMode; +class IMode; class RightPaneWidget; // TODO: The right pane works only for the help plugin atm. @@ -104,5 +106,4 @@ private: } // namespace Core - #endif // RIGHTPANE_H diff --git a/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h b/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h index 02e04bc648..aa4ab9a4f5 100644 --- a/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h +++ b/src/plugins/coreplugin/scriptmanager/metatypedeclarations.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef METATYPEDECLARATIONS_H #define METATYPEDECLARATIONS_H diff --git a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp index 91a4365902..28c3c658e6 100644 --- a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp +++ b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp @@ -30,9 +30,14 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "qworkbench_wrapper.h" + #include <wrap_helpers.h> +#include <coreplugin/messagemanager.h> +#include <coreplugin/editormanager/editorgroup.h> + #include <QtCore/QDebug> #include <QtCore/QSettings> @@ -41,9 +46,6 @@ #include <QtGui/QToolBar> #include <QtScript/QScriptEngine> -#include <coreplugin/messagemanager.h> -#include <coreplugin/editormanager/editorgroup.h> - namespace { enum { debugQWorkbenchWrappers = 0 }; } @@ -377,5 +379,5 @@ Core::EditorGroup *EditorGroupPrototype::callee() const return rc; } -} -} +} // namespace Internal +} // namespace Core diff --git a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h index 7cf7bb86d6..4efa9cc8a6 100644 --- a/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h +++ b/src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef QWORKBENCH_WRAPPER_H #define QWORKBENCH_WRAPPER_H @@ -45,7 +46,8 @@ namespace Internal { // Script prototype for the core interface. -class CorePrototype : public QObject, public QScriptable { +class CorePrototype : public QObject, public QScriptable +{ Q_OBJECT Q_PROPERTY(Core::MessageManager* messageManager READ messageManager DESIGNABLE false SCRIPTABLE true STORED false) @@ -97,7 +99,8 @@ public slots: // Script prototype for the file manager interface. -class FileManagerPrototype : public QObject, public QScriptable { +class FileManagerPrototype : public QObject, public QScriptable +{ Q_OBJECT Q_PROPERTY(QStringList recentFiles READ recentFiles DESIGNABLE false SCRIPTABLE true STORED false) @@ -163,7 +166,8 @@ private: // Script prototype for the editor manager interface. -class EditorManagerPrototype : public QObject, public QScriptable { +class EditorManagerPrototype : public QObject, public QScriptable +{ Q_OBJECT Q_PROPERTY(Core::IEditor* currentEditor READ currentEditor WRITE setCurrentEditor DESIGNABLE false SCRIPTABLE true STORED false) Q_PROPERTY(QList<Core::IEditor*> openedEditors READ openedEditors DESIGNABLE false SCRIPTABLE true STORED false) @@ -195,7 +199,8 @@ private: // Script prototype for the editor interface. -class EditorPrototype : public QObject, public QScriptable { +class EditorPrototype : public QObject, public QScriptable +{ Q_OBJECT Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName DESIGNABLE false SCRIPTABLE true STORED false) Q_PROPERTY(QString kind READ kind DESIGNABLE false SCRIPTABLE true STORED false) @@ -228,7 +233,8 @@ private: // Script prototype for the editor group interface with Script-managed life cycle. -class EditorGroupPrototype : public QObject, public QScriptable { +class EditorGroupPrototype : public QObject, public QScriptable +{ Q_OBJECT Q_PROPERTY(int editorCount READ editorCount DESIGNABLE false SCRIPTABLE true STORED false) Q_PROPERTY(Core::IEditor* currentEditor READ currentEditor WRITE setCurrentEditor DESIGNABLE false SCRIPTABLE true STORED false) @@ -259,4 +265,4 @@ private: } // namespace Internal } // namespace Core -#endif //QWORKBENCH_WRAPPER_H +#endif // QWORKBENCH_WRAPPER_H diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp index f768daccbe..5613bd6781 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp +++ b/src/plugins/coreplugin/scriptmanager/scriptmanager.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "scriptmanager.h" #include "qworkbench_wrapper.h" #include "metatypedeclarations.h" @@ -309,5 +310,5 @@ QString ScriptManager::engineError(QScriptEngine &scriptEngine) return QObject::tr("Unknown error"); } -} -} +} // namespace Internal +} // namespace Core diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanager.h b/src/plugins/coreplugin/scriptmanager/scriptmanager.h index 0944ede127..06ef0ed3d6 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanager.h +++ b/src/plugins/coreplugin/scriptmanager/scriptmanager.h @@ -30,16 +30,17 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SCRIPTMANAGER_H #define SCRIPTMANAGER_H +#include <coreplugin/scriptmanager/scriptmanagerinterface.h> +#include <coreplugin/icore.h> + #include <QtCore/QObject> #include <QtCore/QList> #include <QtScript/QScriptEngine> -#include <coreplugin/scriptmanager/scriptmanagerinterface.h> -#include <coreplugin/icore.h> - namespace Core { namespace Internal { @@ -68,4 +69,4 @@ private: } // namespace Internal } // namespace Core -#endif //SCRIPTMANAGER_H +#endif // SCRIPTMANAGER_H diff --git a/src/plugins/coreplugin/scriptmanager/scriptmanagerinterface.h b/src/plugins/coreplugin/scriptmanager/scriptmanagerinterface.h index a5c7a53f7c..22ed62af2b 100644 --- a/src/plugins/coreplugin/scriptmanager/scriptmanagerinterface.h +++ b/src/plugins/coreplugin/scriptmanager/scriptmanagerinterface.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SCRIPTMANAGERINTERFACE_H #define SCRIPTMANAGERINTERFACE_H diff --git a/src/plugins/coreplugin/sidebar.cpp b/src/plugins/coreplugin/sidebar.cpp index d88ae74f65..0ef66fc809 100644 --- a/src/plugins/coreplugin/sidebar.cpp +++ b/src/plugins/coreplugin/sidebar.cpp @@ -30,9 +30,11 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "sidebar.h" #include "imode.h" #include "modemanager.h" + #include "actionmanager/actionmanagerinterface.h" #include <QtCore/QDebug> diff --git a/src/plugins/coreplugin/sidebar.h b/src/plugins/coreplugin/sidebar.h index 33876309fc..566342fa4e 100644 --- a/src/plugins/coreplugin/sidebar.h +++ b/src/plugins/coreplugin/sidebar.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SIDEBAR_H #define SIDEBAR_H diff --git a/src/plugins/coreplugin/styleanimator.cpp b/src/plugins/coreplugin/styleanimator.cpp index b23600e397..e69c48200d 100644 --- a/src/plugins/coreplugin/styleanimator.cpp +++ b/src/plugins/coreplugin/styleanimator.cpp @@ -30,11 +30,11 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "styleanimator.h" #include <QtGui/QStyleOption> - Animation * StyleAnimator::widgetAnimation(const QWidget *widget) const { if (!widget) diff --git a/src/plugins/coreplugin/styleanimator.h b/src/plugins/coreplugin/styleanimator.h index 594df3ecea..24e137dfbe 100644 --- a/src/plugins/coreplugin/styleanimator.h +++ b/src/plugins/coreplugin/styleanimator.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef ANIMATION_H #define ANIMATION_H diff --git a/src/plugins/coreplugin/stylehelper.cpp b/src/plugins/coreplugin/stylehelper.cpp index d2eed7a014..23769937bf 100644 --- a/src/plugins/coreplugin/stylehelper.cpp +++ b/src/plugins/coreplugin/stylehelper.cpp @@ -30,20 +30,23 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "stylehelper.h" #include <QtGui/QPixmapCache> #include <QtGui/QWidget> // Clamps float color values within (0, 255) -static int clamp(float x) { +static int clamp(float x) +{ const int val = x > 255 ? 255 : static_cast<int>(x); return val < 0 ? 0 : val; } // Clamps float color values within (0, 255) /* -static int range(float x, int min, int max) { +static int range(float x, int min, int max) +{ int val = x > max ? max : x; return val < min ? min : val; } diff --git a/src/plugins/coreplugin/stylehelper.h b/src/plugins/coreplugin/stylehelper.h index d57f14df78..2a3cf3f54b 100644 --- a/src/plugins/coreplugin/stylehelper.h +++ b/src/plugins/coreplugin/stylehelper.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef STYLEHELPER_H #define STYLEHELPER_H @@ -43,7 +44,8 @@ // Helper class holding all custom color values -class CORE_EXPORT StyleHelper { +class CORE_EXPORT StyleHelper +{ public: // Height of the project explorer navigation bar static int navigationWidgetHeight() { return 24; } diff --git a/src/plugins/coreplugin/tabpositionindicator.cpp b/src/plugins/coreplugin/tabpositionindicator.cpp index 5dcc02bbbd..2a4a267adb 100644 --- a/src/plugins/coreplugin/tabpositionindicator.cpp +++ b/src/plugins/coreplugin/tabpositionindicator.cpp @@ -30,19 +30,19 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + +#include "tabpositionindicator.h" + #include <QtGui/QPainter> #include <QtGui/QPaintEvent> #include <QtGui/QBrush> #include <QtGui/QPalette> -#include "tabpositionindicator.h" - using namespace Core::Internal; TabPositionIndicator::TabPositionIndicator() : QWidget(0, Qt::ToolTip) { - } void TabPositionIndicator::paintEvent(QPaintEvent *event) diff --git a/src/plugins/coreplugin/tabpositionindicator.h b/src/plugins/coreplugin/tabpositionindicator.h index ac4e87525f..1434248305 100644 --- a/src/plugins/coreplugin/tabpositionindicator.h +++ b/src/plugins/coreplugin/tabpositionindicator.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef TABPOSITIONINDICATOR_H #define TABPOSITIONINDICATOR_H @@ -43,9 +44,10 @@ namespace Internal { class TabPositionIndicator : public QWidget { Q_OBJECT + public: TabPositionIndicator(); - inline int indicatorWidth() { return TABPOSITIONINDICATOR_WIDTH; } + int indicatorWidth() { return TABPOSITIONINDICATOR_WIDTH; } private: void paintEvent(QPaintEvent *event); @@ -54,4 +56,4 @@ private: } // namespace Internal } // namespace Core -#endif //TABPOSITIONINDICATOR_H +#endif // TABPOSITIONINDICATOR_H diff --git a/src/plugins/coreplugin/uniqueidmanager.cpp b/src/plugins/coreplugin/uniqueidmanager.cpp index 2a8e42742e..6199180c7f 100644 --- a/src/plugins/coreplugin/uniqueidmanager.cpp +++ b/src/plugins/coreplugin/uniqueidmanager.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "uniqueidmanager.h" #include "coreconstants.h" diff --git a/src/plugins/coreplugin/uniqueidmanager.h b/src/plugins/coreplugin/uniqueidmanager.h index 9a42088c9f..e740ab8fe6 100644 --- a/src/plugins/coreplugin/uniqueidmanager.h +++ b/src/plugins/coreplugin/uniqueidmanager.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef UNIQUEIDMANAGER_H #define UNIQUEIDMANAGER_H diff --git a/src/plugins/coreplugin/variablemanager.cpp b/src/plugins/coreplugin/variablemanager.cpp index 2432ab37f6..44263e044a 100644 --- a/src/plugins/coreplugin/variablemanager.cpp +++ b/src/plugins/coreplugin/variablemanager.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "variablemanager.h" using namespace Core; diff --git a/src/plugins/coreplugin/variablemanager.h b/src/plugins/coreplugin/variablemanager.h index d5e7a6d815..a148551d9f 100644 --- a/src/plugins/coreplugin/variablemanager.h +++ b/src/plugins/coreplugin/variablemanager.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef VARIABLEMANAGER_H #define VARIABLEMANAGER_H diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp index fb88d44e4e..a0e1cc19c0 100644 --- a/src/plugins/coreplugin/vcsmanager.cpp +++ b/src/plugins/coreplugin/vcsmanager.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "vcsmanager.h" #include "iversioncontrol.h" @@ -110,4 +111,4 @@ void VCSManager::showDeleteDialog(const QString &fileName) } } -} +} // namespace Core diff --git a/src/plugins/coreplugin/vcsmanager.h b/src/plugins/coreplugin/vcsmanager.h index 8cbac49011..92e4f35d15 100644 --- a/src/plugins/coreplugin/vcsmanager.h +++ b/src/plugins/coreplugin/vcsmanager.h @@ -30,11 +30,12 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef VCSMANAGER_H #define VCSMANAGER_H - #include "core_global.h" + #include <QtCore/QString> namespace Core { diff --git a/src/plugins/coreplugin/versiondialog.cpp b/src/plugins/coreplugin/versiondialog.cpp index 5fc8fd1ab1..d2ad590ef6 100644 --- a/src/plugins/coreplugin/versiondialog.cpp +++ b/src/plugins/coreplugin/versiondialog.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "versiondialog.h" #include "coreconstants.h" #include "coreimpl.h" @@ -46,8 +47,8 @@ using namespace Core::Constants; #include <QtGui/QDialogButtonBox> #include <QtGui/QTextBrowser> -VersionDialog::VersionDialog(QWidget *parent): - QDialog(parent) +VersionDialog::VersionDialog(QWidget *parent) + : QDialog(parent) { // We need to set the window icon explicitly here since for some reason the // application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME) diff --git a/src/plugins/coreplugin/versiondialog.h b/src/plugins/coreplugin/versiondialog.h index 5019390032..d53adab9ab 100644 --- a/src/plugins/coreplugin/versiondialog.h +++ b/src/plugins/coreplugin/versiondialog.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef VERSIONDIALOG_H #define VERSIONDIALOG_H diff --git a/src/plugins/coreplugin/viewmanager.cpp b/src/plugins/coreplugin/viewmanager.cpp index d985a46bab..71ee113299 100644 --- a/src/plugins/coreplugin/viewmanager.cpp +++ b/src/plugins/coreplugin/viewmanager.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "viewmanager.h" #include "coreconstants.h" @@ -37,24 +38,23 @@ #include "uniqueidmanager.h" #include "iview.h" +#include <coreplugin/actionmanager/actionmanagerinterface.h> +#include <coreplugin/actionmanager/icommand.h> +#include <extensionsystem/ExtensionSystemInterfaces> +#include <aggregation/aggregate.h> + #include <QtCore/QSettings> #include <QtGui/QAction> #include <QtGui/QActionGroup> +#include <QtGui/QComboBox> #include <QtGui/QDockWidget> -#include <QtGui/QVBoxLayout> -#include <QtGui/QMenu> -#include <QtGui/QStatusBar> +#include <QtGui/QHBoxLayout> #include <QtGui/QLabel> -#include <QtGui/QComboBox> +#include <QtGui/QMenu> #include <QtGui/QStackedWidget> +#include <QtGui/QStatusBar> #include <QtGui/QToolButton> - -#include <coreplugin/actionmanager/actionmanagerinterface.h> -#include <coreplugin/actionmanager/icommand.h> -#include <extensionsystem/ExtensionSystemInterfaces> -#include <aggregation/aggregate.h> - -#include <QtGui/QHBoxLayout> +#include <QtGui/QVBoxLayout> using namespace Core; using namespace Core::Internal; diff --git a/src/plugins/coreplugin/viewmanager.h b/src/plugins/coreplugin/viewmanager.h index 96adcad18a..2405b57666 100644 --- a/src/plugins/coreplugin/viewmanager.h +++ b/src/plugins/coreplugin/viewmanager.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef VIEWMANAGER_H #define VIEWMANAGER_H @@ -83,4 +84,4 @@ private: } // namespace Internal } // namespace Core -#endif //VIEWMANAGER_H +#endif // VIEWMANAGER_H diff --git a/src/plugins/coreplugin/viewmanagerinterface.h b/src/plugins/coreplugin/viewmanagerinterface.h index 6a86a730bb..ddff06984a 100644 --- a/src/plugins/coreplugin/viewmanagerinterface.h +++ b/src/plugins/coreplugin/viewmanagerinterface.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef VIEWMANAGERINTERFACE_H #define VIEWMANAGERINTERFACE_H @@ -59,6 +60,6 @@ public: virtual IView * view(const QString & id) = 0; }; -} //namespace Core +} // namespace Core -#endif //VIEWMANAGERINTERFACE_H +#endif // VIEWMANAGERINTERFACE_H diff --git a/src/plugins/coreplugin/welcomemode.cpp b/src/plugins/coreplugin/welcomemode.cpp index 8ea880fcb4..e90a4db6bb 100644 --- a/src/plugins/coreplugin/welcomemode.cpp +++ b/src/plugins/coreplugin/welcomemode.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "welcomemode.h" #include "coreconstants.h" #include "uniqueidmanager.h" @@ -65,7 +66,8 @@ static QString readFile(const QString &name) return ts.readAll(); } -struct WelcomeModePrivate { +struct WelcomeModePrivate +{ WelcomeModePrivate(); QWidget *m_widget; diff --git a/src/plugins/coreplugin/welcomemode.h b/src/plugins/coreplugin/welcomemode.h index df99f37d5d..f69b8226a7 100644 --- a/src/plugins/coreplugin/welcomemode.h +++ b/src/plugins/coreplugin/welcomemode.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef WELCOMEMODE_H #define WELCOMEMODE_H @@ -44,7 +45,6 @@ class QLabel; QT_END_NAMESPACE namespace Core { - namespace Internal { struct WelcomeModePrivate; diff --git a/src/plugins/cpaster/cpasterplugin.cpp b/src/plugins/cpaster/cpasterplugin.cpp index ac7fc7624b..2a48088918 100644 --- a/src/plugins/cpaster/cpasterplugin.cpp +++ b/src/plugins/cpaster/cpasterplugin.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cpasterplugin.h" #include "ui_pasteselect.h" @@ -64,9 +65,7 @@ using namespace TextEditor; Core::ICore *gCoreInstance = NULL; CodepasterPlugin::CodepasterPlugin() - : m_settingsPage(0) - , m_fetcher(0) - , m_poster(0) + : m_settingsPage(0), m_fetcher(0), m_poster(0) { } @@ -125,7 +124,8 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *error_m void CodepasterPlugin::extensionsInitialized() { - m_projectExplorer = ExtensionSystem::PluginManager::instance()->getObject<ProjectExplorer::ProjectExplorerPlugin>(); + m_projectExplorer = ExtensionSystem::PluginManager::instance() + ->getObject<ProjectExplorer::ProjectExplorerPlugin>(); } void CodepasterPlugin::post() @@ -268,18 +268,14 @@ void CustomFetcher::list(QListWidget* list) Fetcher::fetch(url); } -CustomPoster::CustomPoster(const QString &host - , bool copyToClipboard - , bool displayOutput) - : Poster(host) - , m_copy(copyToClipboard) - , m_output(displayOutput) +CustomPoster::CustomPoster(const QString &host, bool copyToClipboard, bool displayOutput) + : Poster(host), m_copy(copyToClipboard), m_output(displayOutput) { // cpaster calls QCoreApplication::exit which we want to avoid here - disconnect(this, SIGNAL(requestFinished(int,bool)) - ,this, SLOT(gotRequestFinished(int,bool))); - connect(this, SIGNAL(requestFinished(int,bool)) - , SLOT(customRequestFinished(int,bool))); + disconnect(this, SIGNAL(requestFinished(int,bool)), + this, SLOT(gotRequestFinished(int,bool))); + connect(this, SIGNAL(requestFinished(int,bool)), + SLOT(customRequestFinished(int,bool))); } void CustomPoster::customRequestFinished(int, bool error) diff --git a/src/plugins/cpaster/cpasterplugin.h b/src/plugins/cpaster/cpasterplugin.h index f758352d18..3231fe48d9 100644 --- a/src/plugins/cpaster/cpasterplugin.h +++ b/src/plugins/cpaster/cpasterplugin.h @@ -30,8 +30,9 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ -#ifndef CodepasterPlugin_H -#define CodepasterPlugin_H + +#ifndef CODEPASTERPLUGIN_H +#define CODEPASTERPLUGIN_H #include "settingspage.h" #include "fetcher.h" @@ -58,62 +59,65 @@ class CodepasterPlugin : public ExtensionSystem::IPlugin Q_OBJECT public: - CodepasterPlugin(); - ~CodepasterPlugin(); + CodepasterPlugin(); + ~CodepasterPlugin(); - bool initialize(const QStringList &arguments - , QString *error_message); - void extensionsInitialized(); + bool initialize(const QStringList &arguments, QString *error_message); + void extensionsInitialized(); public slots: - void post(); - void fetch(); + void post(); + void fetch(); private: - QAction *m_postAction; - QAction *m_fetchAction; + QAction *m_postAction; + QAction *m_fetchAction; ProjectExplorer::ProjectExplorerPlugin *m_projectExplorer; - SettingsPage *m_settingsPage; - CustomFetcher *m_fetcher; - CustomPoster *m_poster; + SettingsPage *m_settingsPage; + CustomFetcher *m_fetcher; + CustomPoster *m_poster; }; + class CustomFetcher : public Fetcher { Q_OBJECT + public: - CustomFetcher(const QString &host); + CustomFetcher(const QString &host); - int fetch(int pasteID); - inline bool hadCustomError() { return m_customError; } + int fetch(int pasteID); + bool hadCustomError() { return m_customError; } + + void list(QListWidget *); - void list(QListWidget*); private slots: - void customRequestFinished(int id, bool error); + void customRequestFinished(int id, bool error); private: - QString m_host; - QListWidget *m_listWidget; - int m_id; - bool m_customError; + QString m_host; + QListWidget *m_listWidget; + int m_id; + bool m_customError; }; + class CustomPoster : public Poster { Q_OBJECT public: - CustomPoster(const QString &host - , bool copyToClipboard = true - , bool displayOutput = true); + CustomPoster(const QString &host, bool copyToClipboard = true, + bool displayOutput = true); private slots: - void customRequestFinished(int id, bool error); + void customRequestFinished(int id, bool error); + private: - bool m_copy; - bool m_output; + bool m_copy; + bool m_output; }; } // namespace CodePaster -#endif +#endif // CODEPASTERPLUGIN_H diff --git a/src/plugins/cpaster/settingspage.cpp b/src/plugins/cpaster/settingspage.cpp index ce3994504e..cc4d911725 100644 --- a/src/plugins/cpaster/settingspage.cpp +++ b/src/plugins/cpaster/settingspage.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "settingspage.h" #include <coreplugin/icore.h> diff --git a/src/plugins/cpaster/settingspage.h b/src/plugins/cpaster/settingspage.h index 947bf4c7d9..9830b97cca 100644 --- a/src/plugins/cpaster/settingspage.h +++ b/src/plugins/cpaster/settingspage.h @@ -30,15 +30,16 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SETTINGSPAGE_H #define SETTINGSPAGE_H -#include <QtCore/QUrl> -#include <QtGui/QWidget> +#include "ui_settingspage.h" #include <coreplugin/dialogs/ioptionspage.h> -#include "ui_settingspage.h" +#include <QtCore/QUrl> +#include <QtGui/QWidget> QT_BEGIN_NAMESPACE class QSettings; @@ -51,31 +52,31 @@ class SettingsPage : public Core::IOptionsPage Q_OBJECT public: - SettingsPage(); + SettingsPage(); - QString name() const; - QString category() const; - QString trCategory() const; + QString name() const; + QString category() const; + QString trCategory() const; - QWidget* createPage(QWidget *parent); - void finished(bool accepted); + QWidget *createPage(QWidget *parent); + void finished(bool accepted); - QString username() const; - QUrl serverUrl() const; + QString username() const; + QUrl serverUrl() const; - bool copyToClipBoard() const; - bool displayOutput() const; + bool copyToClipBoard() const; + bool displayOutput() const; private: - Ui_SettingsPage m_ui; - QSettings *m_settings; + Ui_SettingsPage m_ui; + QSettings *m_settings; - QString m_username; - QUrl m_server; - bool m_copy; - bool m_output; + QString m_username; + QUrl m_server; + bool m_copy; + bool m_output; }; -} //namespace CodePaster +} // namespace CodePaster -#endif +#endif // SETTINGSPAGE_H diff --git a/src/plugins/cppeditor/cppclasswizard.cpp b/src/plugins/cppeditor/cppclasswizard.cpp index 47ec495510..6730f5b9ed 100644 --- a/src/plugins/cppeditor/cppclasswizard.cpp +++ b/src/plugins/cppeditor/cppclasswizard.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cppclasswizard.h" #include "cppeditorconstants.h" diff --git a/src/plugins/cppeditor/cppclasswizard.h b/src/plugins/cppeditor/cppclasswizard.h index 2e498829c8..b0850d6928 100644 --- a/src/plugins/cppeditor/cppclasswizard.h +++ b/src/plugins/cppeditor/cppclasswizard.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPCLASSWIZARD_H #define CPPCLASSWIZARD_H @@ -45,9 +46,9 @@ class QComboBox; QT_END_NAMESPACE namespace Core { - namespace Utils { - class NewClassWidget; - } +namespace Utils { + class NewClassWidget; +} } namespace CppEditor { diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 4f37d489e2..254e9341de 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cppeditor.h" #include "cppeditorconstants.h" #include "cppplugin.h" @@ -138,7 +139,7 @@ QualifiedNameId *qualifiedNameIdForSymbol(Symbol *s, const LookupContext &contex } CPPEditorEditable::CPPEditorEditable(CPPEditor *editor) - :BaseTextEditorEditable(editor) + : BaseTextEditorEditable(editor) { Core::ICore *core = CppPlugin::core(); m_context << core->uniqueIDManager()->uniqueIdentifier(CppEditor::Constants::C_CPPEDITOR); diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h index 55794345be..e6c6d1aa86 100644 --- a/src/plugins/cppeditor/cppeditor.h +++ b/src/plugins/cppeditor/cppeditor.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPEDITOR_H #define CPPEDITOR_H diff --git a/src/plugins/cppeditor/cppeditor_global.h b/src/plugins/cppeditor/cppeditor_global.h index daff348df9..68adb513b6 100644 --- a/src/plugins/cppeditor/cppeditor_global.h +++ b/src/plugins/cppeditor/cppeditor_global.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPEDITOR_GLOBAL_H #define CPPEDITOR_GLOBAL_H diff --git a/src/plugins/cppeditor/cppeditoractionhandler.cpp b/src/plugins/cppeditor/cppeditoractionhandler.cpp index a570970404..f68a1cd1c0 100644 --- a/src/plugins/cppeditor/cppeditoractionhandler.cpp +++ b/src/plugins/cppeditor/cppeditoractionhandler.cpp @@ -48,7 +48,11 @@ CPPEditorActionHandler::~CPPEditorActionHandler() { } void CPPEditorActionHandler::createActions() -{ TextEditor::TextEditorActionHandler::createActions(); } +{ + TextEditor::TextEditorActionHandler::createActions(); +} void CPPEditorActionHandler::updateActions(UpdateMode um) -{ TextEditor::TextEditorActionHandler::updateActions(um); } +{ + TextEditor::TextEditorActionHandler::updateActions(um); +} diff --git a/src/plugins/cppeditor/cppeditoractionhandler.h b/src/plugins/cppeditor/cppeditoractionhandler.h index b194bcc2b0..a3514fa60b 100644 --- a/src/plugins/cppeditor/cppeditoractionhandler.h +++ b/src/plugins/cppeditor/cppeditoractionhandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPEDITORACTIONHANDLER_H #define CPPEDITORACTIONHANDLER_H diff --git a/src/plugins/cppeditor/cppeditorconstants.h b/src/plugins/cppeditor/cppeditorconstants.h index 5a8f015a48..a89d69f5b5 100644 --- a/src/plugins/cppeditor/cppeditorconstants.h +++ b/src/plugins/cppeditor/cppeditorconstants.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPPLUGIN_GLOBAL_H #define CPPPLUGIN_GLOBAL_H @@ -53,6 +54,7 @@ const char * const C_SOURCE_MIMETYPE = "text/x-csrc"; const char * const C_HEADER_MIMETYPE = "text/x-chdr"; const char * const CPP_SOURCE_MIMETYPE = "text/x-c++src"; const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr"; + } // namespace Constants } // namespace CppEditor diff --git a/src/plugins/cppeditor/cppeditorenums.h b/src/plugins/cppeditor/cppeditorenums.h index 5ab65f4dc8..f8e3dbe781 100644 --- a/src/plugins/cppeditor/cppeditorenums.h +++ b/src/plugins/cppeditor/cppeditorenums.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPPLUGIN_ENUMS_H #define CPPPLUGIN_ENUMS_H diff --git a/src/plugins/cppeditor/cppfilewizard.cpp b/src/plugins/cppeditor/cppfilewizard.cpp index be17994444..d5f834b91f 100644 --- a/src/plugins/cppeditor/cppfilewizard.cpp +++ b/src/plugins/cppeditor/cppfilewizard.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cppfilewizard.h" #include "cppeditor.h" #include "cppeditorconstants.h" diff --git a/src/plugins/cppeditor/cppfilewizard.h b/src/plugins/cppeditor/cppfilewizard.h index 7a9cd8bcc7..1e2e0b3324 100644 --- a/src/plugins/cppeditor/cppfilewizard.h +++ b/src/plugins/cppeditor/cppfilewizard.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPFILEWIZARD_H #define CPPFILEWIZARD_H diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp index d3baca0c5f..a16af7f851 100644 --- a/src/plugins/cppeditor/cpphighlighter.cpp +++ b/src/plugins/cppeditor/cpphighlighter.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cpphighlighter.h" #include <Token.h> diff --git a/src/plugins/cppeditor/cpphighlighter.h b/src/plugins/cppeditor/cpphighlighter.h index 80b03f1c71..6ffffbb2f5 100644 --- a/src/plugins/cppeditor/cpphighlighter.h +++ b/src/plugins/cppeditor/cpphighlighter.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPHIGHLIGHTER_H #define CPPHIGHLIGHTER_H diff --git a/src/plugins/cppeditor/cppplugin.cpp b/src/plugins/cppeditor/cppplugin.cpp index a03188a52a..ac4a74b051 100644 --- a/src/plugins/cppeditor/cppplugin.cpp +++ b/src/plugins/cppeditor/cppplugin.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cppplugin.h" #include "cppeditor.h" #include "cppeditorconstants.h" diff --git a/src/plugins/cppeditor/cppplugin.h b/src/plugins/cppeditor/cppplugin.h index 72447856f7..91ccafcdb2 100644 --- a/src/plugins/cppeditor/cppplugin.h +++ b/src/plugins/cppeditor/cppplugin.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPPLUGIN_H #define CPPPLUGIN_H diff --git a/src/plugins/cpptools/cppcodecompletion.cpp b/src/plugins/cpptools/cppcodecompletion.cpp index a56330083d..7568d2c887 100644 --- a/src/plugins/cpptools/cppcodecompletion.cpp +++ b/src/plugins/cpptools/cppcodecompletion.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cppcodecompletion.h" #include "cppmodelmanager.h" diff --git a/src/plugins/cpptools/cppcodecompletion.h b/src/plugins/cpptools/cppcodecompletion.h index 58e0d148a9..0217048248 100644 --- a/src/plugins/cpptools/cppcodecompletion.h +++ b/src/plugins/cpptools/cppcodecompletion.h @@ -30,13 +30,10 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPCODECOMPLETION_H #define CPPCODECOMPLETION_H -// Qt -#include <QtCore/QObject> -#include <QtCore/QPointer> - // C++ front-end #include <ASTfwd.h> #include <FullySpecifiedType.h> @@ -47,6 +44,10 @@ // Qt Creator #include <texteditor/icompletioncollector.h> +// Qt +#include <QtCore/QObject> +#include <QtCore/QPointer> + namespace Core { class ICore; } diff --git a/src/plugins/cpptools/cpphoverhandler.cpp b/src/plugins/cpptools/cpphoverhandler.cpp index 4f6196e9e2..37b63bda9c 100644 --- a/src/plugins/cpptools/cpphoverhandler.cpp +++ b/src/plugins/cpptools/cpphoverhandler.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cpphoverhandler.h" #include "cppmodelmanager.h" diff --git a/src/plugins/cpptools/cpphoverhandler.h b/src/plugins/cpptools/cpphoverhandler.h index 813305148a..9aaa17cb0f 100644 --- a/src/plugins/cpptools/cpphoverhandler.h +++ b/src/plugins/cpptools/cpphoverhandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPHOVERHANDLER_H #define CPPHOVERHANDLER_H diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp index 7d83ff2c34..1708e62de3 100644 --- a/src/plugins/cpptools/cppmodelmanager.cpp +++ b/src/plugins/cpptools/cppmodelmanager.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #define _SCL_SECURE_NO_WARNINGS 1 #include "pp.h" diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h index dd915efb75..187187cc5d 100644 --- a/src/plugins/cpptools/cppmodelmanager.h +++ b/src/plugins/cpptools/cppmodelmanager.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPMODELMANAGER_H #define CPPMODELMANAGER_H diff --git a/src/plugins/cpptools/cppmodelmanagerinterface.h b/src/plugins/cpptools/cppmodelmanagerinterface.h index bb1429ac7c..11be08a4b0 100644 --- a/src/plugins/cpptools/cppmodelmanagerinterface.h +++ b/src/plugins/cpptools/cppmodelmanagerinterface.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPMODELMANAGERINTERFACE_H #define CPPMODELMANAGERINTERFACE_H diff --git a/src/plugins/cpptools/cppquickopenfilter.cpp b/src/plugins/cpptools/cppquickopenfilter.cpp index 679c8d422b..9470ec4603 100644 --- a/src/plugins/cpptools/cppquickopenfilter.cpp +++ b/src/plugins/cpptools/cppquickopenfilter.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cppquickopenfilter.h" #include <Literals.h> diff --git a/src/plugins/cpptools/cppquickopenfilter.h b/src/plugins/cpptools/cppquickopenfilter.h index ac3fc0bf20..bf6696a02a 100644 --- a/src/plugins/cpptools/cppquickopenfilter.h +++ b/src/plugins/cpptools/cppquickopenfilter.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPQUICKOPENFILTER_H #define CPPQUICKOPENFILTER_H diff --git a/src/plugins/cpptools/cpptools.cpp b/src/plugins/cpptools/cpptools.cpp index ed22bc3d98..423ddf3016 100644 --- a/src/plugins/cpptools/cpptools.cpp +++ b/src/plugins/cpptools/cpptools.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "cpptools.h" #include "cppcodecompletion.h" #include "cpphoverhandler.h" diff --git a/src/plugins/cpptools/cpptools.h b/src/plugins/cpptools/cpptools.h index 2a3fd00257..a64bfcf9dc 100644 --- a/src/plugins/cpptools/cpptools.h +++ b/src/plugins/cpptools/cpptools.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPTOOLS_H #define CPPTOOLS_H diff --git a/src/plugins/cpptools/cpptools_global.h b/src/plugins/cpptools/cpptools_global.h index 959e9ace34..bbb7b0c764 100644 --- a/src/plugins/cpptools/cpptools_global.h +++ b/src/plugins/cpptools/cpptools_global.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPTOOLS_GLOBAL_H #define CPPTOOLS_GLOBAL_H diff --git a/src/plugins/cpptools/cpptoolsconstants.h b/src/plugins/cpptools/cpptoolsconstants.h index d1d80d0a7c..0eadabbd4a 100644 --- a/src/plugins/cpptools/cpptoolsconstants.h +++ b/src/plugins/cpptools/cpptoolsconstants.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPTOOLSCONSTANTS_H #define CPPTOOLSCONSTANTS_H @@ -43,7 +44,8 @@ const char * const C_SOURCE_MIMETYPE = "text/x-csrc"; const char * const C_HEADER_MIMETYPE = "text/x-chdr"; const char * const CPP_SOURCE_MIMETYPE = "text/x-c++src"; const char * const CPP_HEADER_MIMETYPE = "text/x-c++hdr"; -} -} -#endif //CPPTOOLSCONSTANTS_H +} // namespace Constants +} // namespace CppTools + +#endif // CPPTOOLSCONSTANTS_H diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp index c638b51324..fbca4c1a07 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.cpp +++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp @@ -35,6 +35,7 @@ #include "cppmodelmanager.h" #include <texteditor/itexteditor.h> + #include <QTimer> using namespace CppTools::Internal; diff --git a/src/plugins/cpptools/cpptoolseditorsupport.h b/src/plugins/cpptools/cpptoolseditorsupport.h index fd0d67941b..6cfb7dc201 100644 --- a/src/plugins/cpptools/cpptoolseditorsupport.h +++ b/src/plugins/cpptools/cpptoolseditorsupport.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CPPTOOLSEDITORSUPPORT_H #define CPPTOOLSEDITORSUPPORT_H @@ -81,7 +82,7 @@ private: QFuture<void> _documentParser; }; -} // end of namespace Internal -} // end of namespace CppTools +} // namespace Internal +} // namespace CppTools #endif // CPPTOOLSEDITORSUPPORT_H diff --git a/src/plugins/cpptools/rpp/pp-cctype.h b/src/plugins/cpptools/rpp/pp-cctype.h index ac643a5d41..62b44f0bf4 100644 --- a/src/plugins/cpptools/rpp/pp-cctype.h +++ b/src/plugins/cpptools/rpp/pp-cctype.h @@ -72,5 +72,3 @@ inline bool pp_isspace (int __ch) } // namespace rpp #endif // PP_CCTYPE_H - -// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/src/plugins/cpptools/rpp/pp-client.h b/src/plugins/cpptools/rpp/pp-client.h index 1d15813500..073fc44c36 100644 --- a/src/plugins/cpptools/rpp/pp-client.h +++ b/src/plugins/cpptools/rpp/pp-client.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef PP_CLIENT_H #define PP_CLIENT_H @@ -64,6 +65,6 @@ public: virtual void stopSkippingBlocks(unsigned offset) = 0; }; -} // end of namespace rpp +} // namespace rpp #endif // PP_CLIENT_H diff --git a/src/plugins/cpptools/rpp/pp-engine.cpp b/src/plugins/cpptools/rpp/pp-engine.cpp index a3f4ec6ed3..5128b4ce37 100644 --- a/src/plugins/cpptools/rpp/pp-engine.cpp +++ b/src/plugins/cpptools/rpp/pp-engine.cpp @@ -51,6 +51,7 @@ */ #include "pp.h" + #include <Lexer.h> #include <Token.h> #include <QtDebug> diff --git a/src/plugins/cpptools/rpp/pp-engine.h b/src/plugins/cpptools/rpp/pp-engine.h index 5f822c4378..13135f6a31 100644 --- a/src/plugins/cpptools/rpp/pp-engine.h +++ b/src/plugins/cpptools/rpp/pp-engine.h @@ -54,6 +54,7 @@ #define PP_ENGINE_H #include "pp-client.h" + #include <Token.h> #include <QVector> diff --git a/src/plugins/cpptools/rpp/pp-internal.h b/src/plugins/cpptools/rpp/pp-internal.h index 45a2a218da..13bc7c17e8 100644 --- a/src/plugins/cpptools/rpp/pp-internal.h +++ b/src/plugins/cpptools/rpp/pp-internal.h @@ -56,26 +56,23 @@ #include <QByteArray> namespace rpp { +namespace _PP_internal { - namespace _PP_internal - { +inline bool comment_p (const char *__first, const char *__last) +{ + if (__first == __last) + return false; - inline bool comment_p (const char *__first, const char *__last) - { - if (__first == __last) - return false; + if (*__first != '/') + return false; - if (*__first != '/') - return false; + if (++__first == __last) + return false; - if (++__first == __last) - return false; - - return (*__first == '/' || *__first == '*'); - } - - } // _PP_internal + return (*__first == '/' || *__first == '*'); +} +} // _PP_internal } // namespace rpp #endif // PP_INTERNAL_H diff --git a/src/plugins/cpptools/rpp/pp-macro-expander.cpp b/src/plugins/cpptools/rpp/pp-macro-expander.cpp index 1fee24e3fb..0b224d8eea 100644 --- a/src/plugins/cpptools/rpp/pp-macro-expander.cpp +++ b/src/plugins/cpptools/rpp/pp-macro-expander.cpp @@ -38,11 +38,11 @@ using namespace rpp; MacroExpander::MacroExpander (Environment &env, pp_frame *frame) - : env (env), frame (frame), - lines (0), generated_lines (0) + : env(env), frame(frame), + lines(0), generated_lines(0) { } -const QByteArray *MacroExpander::resolve_formal (const QByteArray &__name) +const QByteArray *MacroExpander::resolve_formal(const QByteArray &__name) { if (! (frame && frame->expanding_macro)) return 0; diff --git a/src/plugins/debugger/assert.h b/src/plugins/debugger/assert.h index 99ba81e8cf..014bb3b25d 100644 --- a/src/plugins/debugger/assert.h +++ b/src/plugins/debugger/assert.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_QWB_ASSERT_H #define DEBUGGER_QWB_ASSERT_H @@ -41,5 +42,5 @@ if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED";action;} #endif -#endif +#endif // DEBUGGER_QWB_ASSERT_H diff --git a/src/plugins/debugger/attachexternaldialog.cpp b/src/plugins/debugger/attachexternaldialog.cpp index 55825a9be4..1a376b3373 100644 --- a/src/plugins/debugger/attachexternaldialog.cpp +++ b/src/plugins/debugger/attachexternaldialog.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "attachexternaldialog.h" #include <QDebug> @@ -39,6 +40,13 @@ #include <QStandardItemModel> #include <QHeaderView> +#ifdef Q_OS_WINDOWS +#include <windows.h> +#include <tlhelp32.h> +#include <tchar.h> +#include <stdio.h> +#endif + using namespace Debugger::Internal; AttachExternalDialog::AttachExternalDialog(QWidget *parent, const QString &pid) @@ -70,7 +78,8 @@ static bool isProcessName(const QString &procname) return true; } -struct ProcData { +struct ProcData +{ QString ppid; QString name; QString state; @@ -143,11 +152,6 @@ void AttachExternalDialog::rebuildProcessList() #ifdef Q_OS_WINDOWS -#include <windows.h> -#include <tlhelp32.h> -#include <tchar.h> -#include <stdio.h> - // Forward declarations: BOOL GetProcessList( ); BOOL ListProcessModules( DWORD dwPID ); diff --git a/src/plugins/debugger/attachexternaldialog.h b/src/plugins/debugger/attachexternaldialog.h index 5095404977..b64691ef80 100644 --- a/src/plugins/debugger/attachexternaldialog.h +++ b/src/plugins/debugger/attachexternaldialog.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef ATTACHEXTERNALDIALOG_H #define ATTACHEXTERNALDIALOG_H diff --git a/src/plugins/debugger/attachremotedialog.cpp b/src/plugins/debugger/attachremotedialog.cpp index 18d6193c74..65b02f37f1 100644 --- a/src/plugins/debugger/attachremotedialog.cpp +++ b/src/plugins/debugger/attachremotedialog.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "attachremotedialog.h" #include <QDebug> diff --git a/src/plugins/debugger/attachremotedialog.h b/src/plugins/debugger/attachremotedialog.h index 86deec71a8..00177c89f2 100644 --- a/src/plugins/debugger/attachremotedialog.h +++ b/src/plugins/debugger/attachremotedialog.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef ATTACHREMOTE_DIALOG_H #define ATTACHREMOTE_DIALOG_H diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp index 105f7fb6b2..8199d4ab51 100644 --- a/src/plugins/debugger/breakhandler.cpp +++ b/src/plugins/debugger/breakhandler.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "breakhandler.h" #include "assert.h" diff --git a/src/plugins/debugger/breakhandler.h b/src/plugins/debugger/breakhandler.h index a915e89add..4581e3a4de 100644 --- a/src/plugins/debugger/breakhandler.h +++ b/src/plugins/debugger/breakhandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_BREAKHANDLER_H #define DEBUGGER_BREAKHANDLER_H diff --git a/src/plugins/debugger/breakwindow.cpp b/src/plugins/debugger/breakwindow.cpp index 18b27be90e..d393a3b21c 100644 --- a/src/plugins/debugger/breakwindow.cpp +++ b/src/plugins/debugger/breakwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "breakwindow.h" #include "ui_breakcondition.h" diff --git a/src/plugins/debugger/breakwindow.h b/src/plugins/debugger/breakwindow.h index aacf322fdd..8b45c8f121 100644 --- a/src/plugins/debugger/breakwindow.h +++ b/src/plugins/debugger/breakwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_BREAKWINDOW_H #define DEBUGGER_BREAKWINDOW_H diff --git a/src/plugins/debugger/debuggerconstants.h b/src/plugins/debugger/debuggerconstants.h index 66b4ce994a..a94fff8b59 100644 --- a/src/plugins/debugger/debuggerconstants.h +++ b/src/plugins/debugger/debuggerconstants.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGERCONSTANTS_H #define DEBUGGERCONSTANTS_H diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index 3de119e120..fd1e7cf5cb 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_DEBUGGERMANAGER_H #define DEBUGGER_DEBUGGERMANAGER_H diff --git a/src/plugins/debugger/debuggeroutputwindow.cpp b/src/plugins/debugger/debuggeroutputwindow.cpp index 66272fef06..7dc293cf35 100644 --- a/src/plugins/debugger/debuggeroutputwindow.cpp +++ b/src/plugins/debugger/debuggeroutputwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "debuggeroutputwindow.h" #include <QtCore/QDebug> diff --git a/src/plugins/debugger/debuggeroutputwindow.h b/src/plugins/debugger/debuggeroutputwindow.h index 6b5e16776f..0b2fd53fd5 100644 --- a/src/plugins/debugger/debuggeroutputwindow.h +++ b/src/plugins/debugger/debuggeroutputwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_OUTPUTWINDOW_H #define DEBUGGER_OUTPUTWINDOW_H diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index f5d52d20c6..b11472a524 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "debuggerplugin.h" #include "assert.h" diff --git a/src/plugins/debugger/debuggerplugin.h b/src/plugins/debugger/debuggerplugin.h index da5e1cddb8..7dfcae1ffe 100644 --- a/src/plugins/debugger/debuggerplugin.h +++ b/src/plugins/debugger/debuggerplugin.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGERPLUGIN_H #define DEBUGGERPLUGIN_H diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index ee49248675..c161c9bad9 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "debuggerrunner.h" #include "assert.h" diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index 56bb1cada4..8b9c6ce2b1 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGERRUNNER_H #define DEBUGGERRUNNER_H diff --git a/src/plugins/debugger/disassemblerhandler.cpp b/src/plugins/debugger/disassemblerhandler.cpp index cb910d4ae1..2ab255b29a 100644 --- a/src/plugins/debugger/disassemblerhandler.cpp +++ b/src/plugins/debugger/disassemblerhandler.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "disassemblerhandler.h" #include "assert.h" diff --git a/src/plugins/debugger/disassemblerhandler.h b/src/plugins/debugger/disassemblerhandler.h index b15060cdaf..f5f6e1c440 100644 --- a/src/plugins/debugger/disassemblerhandler.h +++ b/src/plugins/debugger/disassemblerhandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DISASSEMBLERHANDLER_H #define DISASSEMBLERHANDLER_H diff --git a/src/plugins/debugger/disassemblerwindow.cpp b/src/plugins/debugger/disassemblerwindow.cpp index 9b4e18c241..2a3dc7a99a 100644 --- a/src/plugins/debugger/disassemblerwindow.cpp +++ b/src/plugins/debugger/disassemblerwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "disassemblerwindow.h" #include <QAction> diff --git a/src/plugins/debugger/disassemblerwindow.h b/src/plugins/debugger/disassemblerwindow.h index a39c120943..7e2e91fc84 100644 --- a/src/plugins/debugger/disassemblerwindow.h +++ b/src/plugins/debugger/disassemblerwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_DISASSEMBLERWINDOW_H #define DEBUGGER_DISASSEMBLERWINDOW_H diff --git a/src/plugins/debugger/gdbengine.h b/src/plugins/debugger/gdbengine.h index 7d328a5a25..45eafcdb92 100644 --- a/src/plugins/debugger/gdbengine.h +++ b/src/plugins/debugger/gdbengine.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_GDBENGINE_H #define DEBUGGER_GDBENGINE_H diff --git a/src/plugins/debugger/gdbmi.cpp b/src/plugins/debugger/gdbmi.cpp index 9c0324cc20..ff976eff79 100644 --- a/src/plugins/debugger/gdbmi.cpp +++ b/src/plugins/debugger/gdbmi.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gdbmi.h" #include "assert.h" diff --git a/src/plugins/debugger/gdboptionpage.cpp b/src/plugins/debugger/gdboptionpage.cpp index 07a74b27f8..e05b811889 100644 --- a/src/plugins/debugger/gdboptionpage.cpp +++ b/src/plugins/debugger/gdboptionpage.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gdboptionpage.h" #include "gdbengine.h" diff --git a/src/plugins/debugger/gdboptionpage.h b/src/plugins/debugger/gdboptionpage.h index b618c8191a..1d71024bac 100644 --- a/src/plugins/debugger/gdboptionpage.h +++ b/src/plugins/debugger/gdboptionpage.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GDBOPTIONPAGE_H #define GDBOPTIONPAGE_H diff --git a/src/plugins/debugger/gdbtypemacros.cpp b/src/plugins/debugger/gdbtypemacros.cpp index 338265d9bd..a445a33632 100644 --- a/src/plugins/debugger/gdbtypemacros.cpp +++ b/src/plugins/debugger/gdbtypemacros.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gdboptionpage.h" #include "gdbengine.h" #include "imports.h" diff --git a/src/plugins/debugger/idebuggerengine.h b/src/plugins/debugger/idebuggerengine.h index 800a0dce49..22ed3ca184 100644 --- a/src/plugins/debugger/idebuggerengine.h +++ b/src/plugins/debugger/idebuggerengine.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_IDEBUGGERENGINE_H #define DEBUGGER_IDEBUGGERENGINE_H diff --git a/src/plugins/debugger/imports.h b/src/plugins/debugger/imports.h index ce3e8fb206..f780f31300 100644 --- a/src/plugins/debugger/imports.h +++ b/src/plugins/debugger/imports.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_IMPORTS_H #define DEBUGGER_IMPORTS_H diff --git a/src/plugins/debugger/mode.cpp b/src/plugins/debugger/mode.cpp index ed880bdaa4..3eef7dc832 100644 --- a/src/plugins/debugger/mode.cpp +++ b/src/plugins/debugger/mode.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "mode.h" #include "assert.h" diff --git a/src/plugins/debugger/mode.h b/src/plugins/debugger/mode.h index 2e5824e417..8aa2c69bbf 100644 --- a/src/plugins/debugger/mode.h +++ b/src/plugins/debugger/mode.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_DEBUGMODE_H #define DEBUGGER_DEBUGMODE_H diff --git a/src/plugins/debugger/moduleshandler.cpp b/src/plugins/debugger/moduleshandler.cpp index 27431c05a4..80d9060f7b 100644 --- a/src/plugins/debugger/moduleshandler.cpp +++ b/src/plugins/debugger/moduleshandler.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "moduleshandler.h" #include "assert.h" diff --git a/src/plugins/debugger/moduleshandler.h b/src/plugins/debugger/moduleshandler.h index 0d34e6817f..efd8aa9a49 100644 --- a/src/plugins/debugger/moduleshandler.h +++ b/src/plugins/debugger/moduleshandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_MODULESHANDLER_H #define DEBUGGER_MODULESHANDLER_H diff --git a/src/plugins/debugger/moduleswindow.cpp b/src/plugins/debugger/moduleswindow.cpp index 61512879a2..3ae127a034 100644 --- a/src/plugins/debugger/moduleswindow.cpp +++ b/src/plugins/debugger/moduleswindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "moduleswindow.h" #include "moduleshandler.h" // for model roles diff --git a/src/plugins/debugger/moduleswindow.h b/src/plugins/debugger/moduleswindow.h index 732fb79f71..1d9309c0bb 100644 --- a/src/plugins/debugger/moduleswindow.h +++ b/src/plugins/debugger/moduleswindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_MODULESWINDOW_H #define DEBUGGER_MODULESWINDOW_H diff --git a/src/plugins/debugger/procinterrupt.cpp b/src/plugins/debugger/procinterrupt.cpp index ebae02199a..c227de81ce 100644 --- a/src/plugins/debugger/procinterrupt.cpp +++ b/src/plugins/debugger/procinterrupt.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "procinterrupt.h" #ifdef Q_OS_WIN diff --git a/src/plugins/debugger/procinterrupt.h b/src/plugins/debugger/procinterrupt.h index 846661de69..960b6e0021 100644 --- a/src/plugins/debugger/procinterrupt.h +++ b/src/plugins/debugger/procinterrupt.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_PROCINTERRUPT_H #define DEBUGGER_PROCINTERRUPT_H diff --git a/src/plugins/debugger/registerhandler.cpp b/src/plugins/debugger/registerhandler.cpp index dc1da8913e..09beeb006f 100644 --- a/src/plugins/debugger/registerhandler.cpp +++ b/src/plugins/debugger/registerhandler.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "registerhandler.h" #include "assert.h" @@ -45,7 +46,6 @@ using namespace Debugger::Internal; using namespace Debugger::Constants; - ////////////////////////////////////////////////////////////////// // // RegisterHandler diff --git a/src/plugins/debugger/registerhandler.h b/src/plugins/debugger/registerhandler.h index 88e9471713..b80a9122a9 100644 --- a/src/plugins/debugger/registerhandler.h +++ b/src/plugins/debugger/registerhandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_REGISTERHANDLER_H #define DEBUGGER_REGISTERHANDLER_H diff --git a/src/plugins/debugger/registerwindow.cpp b/src/plugins/debugger/registerwindow.cpp index 750309ad06..0a9aac613e 100644 --- a/src/plugins/debugger/registerwindow.cpp +++ b/src/plugins/debugger/registerwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "registerwindow.h" #include "debuggerconstants.h" diff --git a/src/plugins/debugger/registerwindow.h b/src/plugins/debugger/registerwindow.h index b94d2356aa..00629b2077 100644 --- a/src/plugins/debugger/registerwindow.h +++ b/src/plugins/debugger/registerwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_REGISTERWINDOW_H #define DEBUGGER_REGISTERWINDOW_H diff --git a/src/plugins/debugger/scriptengine.h b/src/plugins/debugger/scriptengine.h index 472a2091c4..1c160a1ea3 100644 --- a/src/plugins/debugger/scriptengine.h +++ b/src/plugins/debugger/scriptengine.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_SCRIPTENGINE_H #define DEBUGGER_SCRIPTENGINE_H diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp index 06dada9bcd..d2a468b07c 100644 --- a/src/plugins/debugger/stackhandler.cpp +++ b/src/plugins/debugger/stackhandler.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "stackhandler.h" #include "assert.h" diff --git a/src/plugins/debugger/stackhandler.h b/src/plugins/debugger/stackhandler.h index e78cc3f4c3..16d77583af 100644 --- a/src/plugins/debugger/stackhandler.h +++ b/src/plugins/debugger/stackhandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_STACKHANDLER_H #define DEBUGGER_STACKHANDLER_H diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp index 5778243b32..a079b54c13 100644 --- a/src/plugins/debugger/stackwindow.cpp +++ b/src/plugins/debugger/stackwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "stackwindow.h" #include "assert.h" diff --git a/src/plugins/debugger/stackwindow.h b/src/plugins/debugger/stackwindow.h index 39689d1cc6..f1dffcf7b7 100644 --- a/src/plugins/debugger/stackwindow.h +++ b/src/plugins/debugger/stackwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_STACKWINDOW_H #define DEBUGGER_STACKWINDOW_H diff --git a/src/plugins/debugger/startexternaldialog.cpp b/src/plugins/debugger/startexternaldialog.cpp index 2d1b3de02b..785757b766 100644 --- a/src/plugins/debugger/startexternaldialog.cpp +++ b/src/plugins/debugger/startexternaldialog.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "startexternaldialog.h" #include <QtGui/QFileDialog> diff --git a/src/plugins/debugger/startexternaldialog.h b/src/plugins/debugger/startexternaldialog.h index 3bb64c8c5c..b71a514776 100644 --- a/src/plugins/debugger/startexternaldialog.h +++ b/src/plugins/debugger/startexternaldialog.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_STARTEXTERNALDIALOG_H #define DEBUGGER_STARTEXTERNALDIALOG_H diff --git a/src/plugins/debugger/threadswindow.cpp b/src/plugins/debugger/threadswindow.cpp index e3088a848b..354f1cba3e 100644 --- a/src/plugins/debugger/threadswindow.cpp +++ b/src/plugins/debugger/threadswindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "threadswindow.h" #include "assert.h" diff --git a/src/plugins/debugger/threadswindow.h b/src/plugins/debugger/threadswindow.h index 686424bab6..7d4f6c59b0 100644 --- a/src/plugins/debugger/threadswindow.h +++ b/src/plugins/debugger/threadswindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_THREADWINDOW_H #define DEBUGGER_THREADWINDOW_H diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 1fb6b9c338..3d99a84ad3 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "watchhandler.h" #if USE_MODEL_TEST diff --git a/src/plugins/debugger/watchhandler.h b/src/plugins/debugger/watchhandler.h index 4a876bae08..3841d55d30 100644 --- a/src/plugins/debugger/watchhandler.h +++ b/src/plugins/debugger/watchhandler.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_WATCHHANDLER_H #define DEBUGGER_WATCHHANDLER_H diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 7f5d61995f..7836619895 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "watchwindow.h" #include <QtCore/QDebug> diff --git a/src/plugins/debugger/watchwindow.h b/src/plugins/debugger/watchwindow.h index 0704ea92f1..9781f79fdb 100644 --- a/src/plugins/debugger/watchwindow.h +++ b/src/plugins/debugger/watchwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DEBUGGER_WATCHWINDOW_H #define DEBUGGER_WATCHWINDOW_H diff --git a/src/plugins/designer/cpp/formclasswizard.cpp b/src/plugins/designer/cpp/formclasswizard.cpp index cb240ea0b5..d1ce928547 100644 --- a/src/plugins/designer/cpp/formclasswizard.cpp +++ b/src/plugins/designer/cpp/formclasswizard.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formclasswizard.h" #include "formclasswizarddialog.h" #include "designerconstants.h" diff --git a/src/plugins/designer/cpp/formclasswizard.h b/src/plugins/designer/cpp/formclasswizard.h index 73460918f6..749ab86137 100644 --- a/src/plugins/designer/cpp/formclasswizard.h +++ b/src/plugins/designer/cpp/formclasswizard.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMCLASSWIZARD_H #define FORMCLASSWIZARD_H diff --git a/src/plugins/designer/cpp/formclasswizarddialog.cpp b/src/plugins/designer/cpp/formclasswizarddialog.cpp index 15bbd8d537..345309d45c 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.cpp +++ b/src/plugins/designer/cpp/formclasswizarddialog.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formclasswizarddialog.h" #include "formtemplatewizardpage.h" #include "formclasswizardpage.h" diff --git a/src/plugins/designer/cpp/formclasswizarddialog.h b/src/plugins/designer/cpp/formclasswizarddialog.h index 1e914ae860..cdb1f60d17 100644 --- a/src/plugins/designer/cpp/formclasswizarddialog.h +++ b/src/plugins/designer/cpp/formclasswizarddialog.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMCLASSWIZARDDIALOG_H #define FORMCLASSWIZARDDIALOG_H diff --git a/src/plugins/designer/cpp/formclasswizardpage.cpp b/src/plugins/designer/cpp/formclasswizardpage.cpp index 1f946aa311..d076753374 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.cpp +++ b/src/plugins/designer/cpp/formclasswizardpage.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formclasswizardpage.h" #include "ui_formclasswizardpage.h" #include "formclasswizardparameters.h" diff --git a/src/plugins/designer/cpp/formclasswizardpage.h b/src/plugins/designer/cpp/formclasswizardpage.h index 59e8e808e9..c0b53040c6 100644 --- a/src/plugins/designer/cpp/formclasswizardpage.h +++ b/src/plugins/designer/cpp/formclasswizardpage.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMCLASSWIZARDPAGE_H #define FORMCLASSWIZARDPAGE_H diff --git a/src/plugins/designer/cpp/formclasswizardparameters.cpp b/src/plugins/designer/cpp/formclasswizardparameters.cpp index b33dbab6fc..7dd0056186 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.cpp +++ b/src/plugins/designer/cpp/formclasswizardparameters.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formclasswizardparameters.h" #include "formtemplatewizardpage.h" diff --git a/src/plugins/designer/cpp/formclasswizardparameters.h b/src/plugins/designer/cpp/formclasswizardparameters.h index 32bea7603e..d72b8c5c2c 100644 --- a/src/plugins/designer/cpp/formclasswizardparameters.h +++ b/src/plugins/designer/cpp/formclasswizardparameters.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMCLASSWIZARDPARAMETERS_H #define FORMCLASSWIZARDPARAMETERS_H diff --git a/src/plugins/designer/designerconstants.h b/src/plugins/designer/designerconstants.h index 85c877efcf..2a30a8ea4f 100644 --- a/src/plugins/designer/designerconstants.h +++ b/src/plugins/designer/designerconstants.h @@ -30,36 +30,44 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DESIGNERPLUGIN_CONSTANTS_H #define DESIGNERPLUGIN_CONSTANTS_H namespace Designer { - namespace Constants { - // context - const char * const C_FORMEDITOR = "Formeditor"; - const char * const T_FORMEDITOR = "Formeditor.Toolbar"; - const char * const M_FORMEDITOR = "Formeditor.Menu"; - const char * const M_FORMEDITOR_PREVIEW = "Formeditor.Menu.Preview"; - const char * const C_FORMWINDOW = "Formwindow"; - // Wizard type - const char * const FORM_FILE_TYPE = "Qt4FormFiles"; - const char * const FORM_MIMETYPE = "application/x-designer"; +namespace Constants { + +// context +const char * const C_FORMEDITOR = "Formeditor"; +const char * const T_FORMEDITOR = "Formeditor.Toolbar"; +const char * const M_FORMEDITOR = "Formeditor.Menu"; +const char * const M_FORMEDITOR_PREVIEW = "Formeditor.Menu.Preview"; +const char * const C_FORMWINDOW = "Formwindow"; + +// Wizard type +const char * const FORM_FILE_TYPE = "Qt4FormFiles"; +const char * const FORM_MIMETYPE = "application/x-designer"; + +enum DesignerSubWindows +{ + WidgetBoxSubWindow, + ObjectInspectorSubWindow, + PropertyEditorSubWindow, + SignalSlotEditorSubWindow, + ActionEditorSubWindow, + DesignerSubWindowCount +}; - enum DesignerSubWindows { - WidgetBoxSubWindow, - ObjectInspectorSubWindow, - PropertyEditorSubWindow, - SignalSlotEditorSubWindow, - ActionEditorSubWindow, - DesignerSubWindowCount }; +enum EditModes +{ + EditModeWidgetEditor, + EditModeSignalsSlotEditor, + EditModeBuddyEditor, + EditModeTabOrderEditor, + NumEditModes +}; - enum EditModes { - EditModeWidgetEditor, - EditModeSignalsSlotEditor, - EditModeBuddyEditor, - EditModeTabOrderEditor, - NumEditModes }; - } -} +} // Constants +} // Designer #endif //DESIGNERPLUGIN_CONSTANTS_H diff --git a/src/plugins/designer/editorwidget.cpp b/src/plugins/designer/editorwidget.cpp index be941e9dc0..1a60dbb171 100644 --- a/src/plugins/designer/editorwidget.cpp +++ b/src/plugins/designer/editorwidget.cpp @@ -31,14 +31,14 @@ ** ***************************************************************************/ - #include "editorwidget.h" #include "formeditorw.h" +#include <coreplugin/minisplitter.h> + #include <QtCore/QEvent> #include <QtGui/QVBoxLayout> #include <QtGui/QTabWidget> -#include <coreplugin/minisplitter.h> using namespace Designer::Constants; @@ -49,222 +49,223 @@ enum { wantSignalSlotEditor = 0 }; namespace Designer { namespace Internal { - SharedSubWindow::SharedSubWindow(QWidget *shared, QWidget *parent) : - QWidget(parent), - m_shared(shared), - m_layout(new QVBoxLayout) - { - Q_ASSERT(m_shared); - m_layout->setContentsMargins(0, 0, 0, 0); - setLayout(m_layout); - } +SharedSubWindow::SharedSubWindow(QWidget *shared, QWidget *parent) : + QWidget(parent), + m_shared(shared), + m_layout(new QVBoxLayout) +{ + Q_ASSERT(m_shared); + m_layout->setContentsMargins(0, 0, 0, 0); + setLayout(m_layout); +} - void SharedSubWindow::activate() - { - // Take the widget off the other parent - Q_ASSERT(m_shared); - QWidget *currentParent = m_shared->parentWidget(); - if (currentParent == this) - return; +void SharedSubWindow::activate() +{ + // Take the widget off the other parent + Q_ASSERT(m_shared); + QWidget *currentParent = m_shared->parentWidget(); + if (currentParent == this) + return; - if (currentParent) { - QVBoxLayout *lt = qobject_cast<QVBoxLayout *>(currentParent->layout()); - Q_ASSERT(lt); - m_shared->setParent(0); - delete lt->takeAt(0); - } - m_layout->addWidget(m_shared); - m_layout->invalidate(); + if (currentParent) { + QVBoxLayout *lt = qobject_cast<QVBoxLayout *>(currentParent->layout()); + Q_ASSERT(lt); + m_shared->setParent(0); + delete lt->takeAt(0); } + m_layout->addWidget(m_shared); + m_layout->invalidate(); +} - SharedSubWindow::~SharedSubWindow() - { - // Do not destroy the shared sub window if we currently own it - if (m_layout->count()) { - m_shared->setParent(0); - delete m_layout->takeAt(0); - } +SharedSubWindow::~SharedSubWindow() +{ + // Do not destroy the shared sub window if we currently own it + if (m_layout->count()) { + m_shared->setParent(0); + delete m_layout->takeAt(0); } +} - // ---------- Global EditorState - Q_GLOBAL_STATIC(EditorWidgetState, editorWidgetState) +// ---------- Global EditorState +Q_GLOBAL_STATIC(EditorWidgetState, editorWidgetState) - enum { Version = 1 }; - // Simple conversion of an int list to QVariantList, size as leading element - static void intToVariantList(const QList<int> &il, QVariantList& vl) - { - const int size = il.size(); - vl.push_back(size); - if (size != 0) { - const QList<int>::const_iterator cend = il.constEnd(); - for (QList<int>::const_iterator it = il.constBegin(); it != cend; ++it) - vl.push_back(QVariant(*it)); - } - } - // Simple conversion of a QVariantList portion saved by the above function to int list - bool variantListToIntList(const QVariantList& vl, int &index, QList<int> &list) - { - list.clear(); - if (index >= vl.size()) - return false; - const int size = vl.at(index++).toInt(); - const int end = index + size; - if (end > vl.size()) - return false; - if (size != 0) { - for ( ; index < end; index++) - list.push_back(vl.at(index).toInt()); - } - return true; +enum { Version = 1 }; +// Simple conversion of an int list to QVariantList, size as leading element +static void intToVariantList(const QList<int> &il, QVariantList& vl) +{ + const int size = il.size(); + vl.push_back(size); + if (size != 0) { + const QList<int>::const_iterator cend = il.constEnd(); + for (QList<int>::const_iterator it = il.constBegin(); it != cend; ++it) + vl.push_back(QVariant(*it)); } - - // ------------------ EditorWidgetState - QVariant EditorWidgetState::toVariant() const - { - QVariantList rc; - rc.push_back(Version); - intToVariantList(horizontalSizes, rc); - intToVariantList(centerVerticalSizes, rc); - intToVariantList(rightVerticalSizes, rc); - return QVariant(rc); - } - - bool EditorWidgetState::fromVariant(const QVariant &v) - { - // Restore state. The weird thing is that QSettings might return - // a QStringList although it was saved as QVariantList<int>. - if (v.type() != QVariant::List && v.type() != QVariant::StringList) - return false; - const QVariantList vl = v.toList(); - if (vl.empty()) - return false; - int index = 0; - const QVariant &versionV = vl.at(index++); - if (versionV.type() != QVariant::Int && versionV.type() != QVariant::String) - return false; - if (versionV.toInt() > Version) - return false; - return variantListToIntList(vl, index, horizontalSizes) && - variantListToIntList(vl, index, centerVerticalSizes) && - variantListToIntList(vl, index, rightVerticalSizes); +} +// Simple conversion of a QVariantList portion saved by the above function to int list +bool variantListToIntList(const QVariantList& vl, int &index, QList<int> &list) +{ + list.clear(); + if (index >= vl.size()) + return false; + const int size = vl.at(index++).toInt(); + const int end = index + size; + if (end > vl.size()) + return false; + if (size != 0) { + for ( ; index < end; index++) + list.push_back(vl.at(index).toInt()); } + return true; +} - // ---------- EditorWidget - EditorWidget::EditorWidget(QWidget *formWindow) : - Core::MiniSplitter(Qt::Horizontal), - m_centerVertSplitter(new Core::MiniSplitter(Qt::Vertical)), - m_bottomTab(0), - m_rightVertSplitter(new Core::MiniSplitter(Qt::Vertical)) - { - // Get shared sub windows from Form Editor - FormEditorW *few = FormEditorW::instance(); - QWidget * const*subs = few->designerSubWindows(); - // Create shared sub windows except SignalSlotEditor - qFill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount, static_cast<SharedSubWindow*>(0)); - for (int i=0; i < DesignerSubWindowCount; i++) - if (wantSignalSlotEditor || i != SignalSlotEditorSubWindow) - m_designerSubWindows[i] = new SharedSubWindow(subs[i]); - // Create splitter - addWidget(m_designerSubWindows[WidgetBoxSubWindow]); +// ------------------ EditorWidgetState +QVariant EditorWidgetState::toVariant() const +{ + QVariantList rc; + rc.push_back(Version); + intToVariantList(horizontalSizes, rc); + intToVariantList(centerVerticalSizes, rc); + intToVariantList(rightVerticalSizes, rc); + return QVariant(rc); +} - // center - m_centerVertSplitter->addWidget(formWindow); +bool EditorWidgetState::fromVariant(const QVariant &v) +{ + // Restore state. The weird thing is that QSettings might return + // a QStringList although it was saved as QVariantList<int>. + if (v.type() != QVariant::List && v.type() != QVariant::StringList) + return false; + const QVariantList vl = v.toList(); + if (vl.empty()) + return false; + int index = 0; + const QVariant &versionV = vl.at(index++); + if (versionV.type() != QVariant::Int && versionV.type() != QVariant::String) + return false; + if (versionV.toInt() > Version) + return false; + return variantListToIntList(vl, index, horizontalSizes) && + variantListToIntList(vl, index, centerVerticalSizes) && + variantListToIntList(vl, index, rightVerticalSizes); +} - if (wantSignalSlotEditor) { - m_bottomTab = new QTabWidget; - m_bottomTab->setTabPosition(QTabWidget::South); - m_bottomTab->addTab(m_designerSubWindows[ActionEditorSubWindow], tr("Action editor")); - m_bottomTab->addTab(m_designerSubWindows[SignalSlotEditorSubWindow], tr("Signals and slots editor")); - m_centerVertSplitter->addWidget(m_bottomTab); - } else { - m_centerVertSplitter->addWidget(m_designerSubWindows[ActionEditorSubWindow]); - } +// ---------- EditorWidget +EditorWidget::EditorWidget(QWidget *formWindow) : + Core::MiniSplitter(Qt::Horizontal), + m_centerVertSplitter(new Core::MiniSplitter(Qt::Vertical)), + m_bottomTab(0), + m_rightVertSplitter(new Core::MiniSplitter(Qt::Vertical)) +{ + // Get shared sub windows from Form Editor + FormEditorW *few = FormEditorW::instance(); + QWidget * const*subs = few->designerSubWindows(); + // Create shared sub windows except SignalSlotEditor + qFill(m_designerSubWindows, m_designerSubWindows + DesignerSubWindowCount, static_cast<SharedSubWindow*>(0)); + for (int i=0; i < DesignerSubWindowCount; i++) + if (wantSignalSlotEditor || i != SignalSlotEditorSubWindow) + m_designerSubWindows[i] = new SharedSubWindow(subs[i]); + // Create splitter + addWidget(m_designerSubWindows[WidgetBoxSubWindow]); - addWidget(m_centerVertSplitter); + // center + m_centerVertSplitter->addWidget(formWindow); - m_rightVertSplitter->addWidget(m_designerSubWindows[ObjectInspectorSubWindow]); - m_rightVertSplitter->addWidget(m_designerSubWindows[PropertyEditorSubWindow]); - addWidget(m_rightVertSplitter); + if (wantSignalSlotEditor) { + m_bottomTab = new QTabWidget; + m_bottomTab->setTabPosition(QTabWidget::South); + m_bottomTab->addTab(m_designerSubWindows[ActionEditorSubWindow], tr("Action editor")); + m_bottomTab->addTab(m_designerSubWindows[SignalSlotEditorSubWindow], tr("Signals and slots editor")); + m_centerVertSplitter->addWidget(m_bottomTab); + } else { + m_centerVertSplitter->addWidget(m_designerSubWindows[ActionEditorSubWindow]); } - void EditorWidget::setInitialSizes() - { - QList<int> sizes; - // center vertical. Either the tab containing signal slot editor/ - // action editor or the action editor itself - const QWidget *bottomWidget = m_bottomTab; - if (!bottomWidget) - bottomWidget = m_designerSubWindows[ActionEditorSubWindow]; - const int tabHeight = bottomWidget->sizeHint().height(); - sizes.push_back(height() - handleWidth() - tabHeight); - sizes.push_back( tabHeight); - m_centerVertSplitter->setSizes(sizes); - // right vert - sizes.clear(); - sizes.push_back(height() /2 - (handleWidth() / 2)); - sizes.push_back(height() / 2 - (handleWidth() / 2)); - m_rightVertSplitter->setSizes(sizes); - // horiz sizes - sizes.clear(); - const int wboxWidth = m_designerSubWindows[WidgetBoxSubWindow]->sizeHint().width(); - const int vSplitterWidth = m_rightVertSplitter->sizeHint().width(); - sizes.push_back(wboxWidth); - sizes.push_back(width() - 2 * handleWidth() - wboxWidth - vSplitterWidth); - sizes.push_back(vSplitterWidth); - setSizes(sizes); - } + addWidget(m_centerVertSplitter); - void EditorWidget::activate() - { - for (int i=0; i < DesignerSubWindowCount; i++) - if (SharedSubWindow *sw = m_designerSubWindows[i]) // Signal slot might be deactivated - sw->activate(); - if (!restore(*editorWidgetState())) - setInitialSizes(); - } + m_rightVertSplitter->addWidget(m_designerSubWindows[ObjectInspectorSubWindow]); + m_rightVertSplitter->addWidget(m_designerSubWindows[PropertyEditorSubWindow]); + addWidget(m_rightVertSplitter); +} - bool EditorWidget::event(QEvent * e) - { - if (e->type() == QEvent::Hide) - *editorWidgetState() = save(); - return QSplitter::event(e); - } +void EditorWidget::setInitialSizes() +{ + QList<int> sizes; + // center vertical. Either the tab containing signal slot editor/ + // action editor or the action editor itself + const QWidget *bottomWidget = m_bottomTab; + if (!bottomWidget) + bottomWidget = m_designerSubWindows[ActionEditorSubWindow]; + const int tabHeight = bottomWidget->sizeHint().height(); + sizes.push_back(height() - handleWidth() - tabHeight); + sizes.push_back( tabHeight); + m_centerVertSplitter->setSizes(sizes); + // right vert + sizes.clear(); + sizes.push_back(height() /2 - (handleWidth() / 2)); + sizes.push_back(height() / 2 - (handleWidth() / 2)); + m_rightVertSplitter->setSizes(sizes); + // horiz sizes + sizes.clear(); + const int wboxWidth = m_designerSubWindows[WidgetBoxSubWindow]->sizeHint().width(); + const int vSplitterWidth = m_rightVertSplitter->sizeHint().width(); + sizes.push_back(wboxWidth); + sizes.push_back(width() - 2 * handleWidth() - wboxWidth - vSplitterWidth); + sizes.push_back(vSplitterWidth); + setSizes(sizes); +} - EditorWidgetState EditorWidget::save() const - { - EditorWidgetState rc; - rc.horizontalSizes = sizes(); - rc.centerVerticalSizes = m_centerVertSplitter->sizes(); - rc.rightVerticalSizes = m_rightVertSplitter->sizes(); - return rc; - } +void EditorWidget::activate() +{ + for (int i=0; i < DesignerSubWindowCount; i++) + if (SharedSubWindow *sw = m_designerSubWindows[i]) // Signal slot might be deactivated + sw->activate(); + if (!restore(*editorWidgetState())) + setInitialSizes(); +} - bool EditorWidget::restore(const EditorWidgetState &s) - { - if (s.horizontalSizes.size() != count() || - s.centerVerticalSizes.size() != m_centerVertSplitter->count() || - s.rightVerticalSizes.size() != m_rightVertSplitter->count()) - return false; - m_centerVertSplitter->setSizes(s.centerVerticalSizes); - m_rightVertSplitter->setSizes(s.rightVerticalSizes); - setSizes(s.horizontalSizes); - return true; - } +bool EditorWidget::event(QEvent * e) +{ + if (e->type() == QEvent::Hide) + *editorWidgetState() = save(); + return QSplitter::event(e); +} - void EditorWidget::toolChanged(int i) - { - if (m_bottomTab) - m_bottomTab->setCurrentIndex(i == EditModeSignalsSlotEditor ? SignalSlotEditorTab : ActionEditorTab); - } +EditorWidgetState EditorWidget::save() const +{ + EditorWidgetState rc; + rc.horizontalSizes = sizes(); + rc.centerVerticalSizes = m_centerVertSplitter->sizes(); + rc.rightVerticalSizes = m_rightVertSplitter->sizes(); + return rc; +} - EditorWidgetState EditorWidget::state() - { - return *editorWidgetState(); - } +bool EditorWidget::restore(const EditorWidgetState &s) +{ + if (s.horizontalSizes.size() != count() || + s.centerVerticalSizes.size() != m_centerVertSplitter->count() || + s.rightVerticalSizes.size() != m_rightVertSplitter->count()) + return false; + m_centerVertSplitter->setSizes(s.centerVerticalSizes); + m_rightVertSplitter->setSizes(s.rightVerticalSizes); + setSizes(s.horizontalSizes); + return true; +} - void EditorWidget::setState(const EditorWidgetState& st) - { - *editorWidgetState() = st; - } +void EditorWidget::toolChanged(int i) +{ + if (m_bottomTab) + m_bottomTab->setCurrentIndex(i == EditModeSignalsSlotEditor ? SignalSlotEditorTab : ActionEditorTab); } + +EditorWidgetState EditorWidget::state() +{ + return *editorWidgetState(); +} + +void EditorWidget::setState(const EditorWidgetState& st) +{ + *editorWidgetState() = st; } + +} // namespace Internal +} // namespace Designer diff --git a/src/plugins/designer/editorwidget.h b/src/plugins/designer/editorwidget.h index 4e0c78d974..a687f714c5 100644 --- a/src/plugins/designer/editorwidget.h +++ b/src/plugins/designer/editorwidget.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DESIGNER_EDITORWIDGET_H #define DESIGNER_EDITORWIDGET_H @@ -50,69 +51,73 @@ QT_END_NAMESPACE namespace Designer { namespace Internal { - /* A widget that shares its embedded sub window with others. For example, - * the designer editors need to share the widget box, etc. */ - class SharedSubWindow : public QWidget { - Q_OBJECT - Q_DISABLE_COPY(SharedSubWindow) - - public: - SharedSubWindow(QWidget *shared, QWidget *parent = 0); - virtual ~SharedSubWindow(); - - public slots: - // Takes the shared widget off the current parent and adds it to its - // layout - void activate(); - - private: - QPointer <QWidget> m_shared; - QVBoxLayout *m_layout; - }; - - /** State of the editor window (splitter sizes) - * Shared as a global struct between the instances and stored - * in QSettings. */ - struct EditorWidgetState { - QVariant toVariant() const; // API to conveniently store in QSettings - bool fromVariant(const QVariant &v); - - QList<int> horizontalSizes; - QList<int> centerVerticalSizes; - QList<int> rightVerticalSizes; - }; - - /* Form editor splitter used as editor window. Contains the shared designer - * windows. */ - class EditorWidget : public Core::MiniSplitter { - Q_OBJECT - Q_DISABLE_COPY(EditorWidget) - public: - explicit EditorWidget(QWidget *formWindow); - - virtual bool event(QEvent * e); - - EditorWidgetState save() const; - bool restore(const EditorWidgetState &s); - - // Get/Set the shared splitter state of all editors of that type for - // settings - static EditorWidgetState state(); - static void setState(const EditorWidgetState&st); - - public slots: - void activate(); - void toolChanged(int); - - private: - void setInitialSizes(); - - SharedSubWindow* m_designerSubWindows[Designer::Constants::DesignerSubWindowCount]; - QSplitter *m_centerVertSplitter; - QTabWidget *m_bottomTab; - QSplitter *m_rightVertSplitter; - }; -} -} - -#endif +/* A widget that shares its embedded sub window with others. For example, + * the designer editors need to share the widget box, etc. */ +class SharedSubWindow : public QWidget +{ + Q_OBJECT + Q_DISABLE_COPY(SharedSubWindow) + +public: + SharedSubWindow(QWidget *shared, QWidget *parent = 0); + virtual ~SharedSubWindow(); + +public slots: + // Takes the shared widget off the current parent and adds it to its + // layout + void activate(); + +private: + QPointer <QWidget> m_shared; + QVBoxLayout *m_layout; +}; + +/** State of the editor window (splitter sizes) + * Shared as a global struct between the instances and stored + * in QSettings. */ +struct EditorWidgetState +{ + QVariant toVariant() const; // API to conveniently store in QSettings + bool fromVariant(const QVariant &v); + + QList<int> horizontalSizes; + QList<int> centerVerticalSizes; + QList<int> rightVerticalSizes; +}; + +/* Form editor splitter used as editor window. Contains the shared designer + * windows. */ +class EditorWidget : public Core::MiniSplitter +{ + Q_OBJECT + Q_DISABLE_COPY(EditorWidget) +public: + explicit EditorWidget(QWidget *formWindow); + + virtual bool event(QEvent * e); + + EditorWidgetState save() const; + bool restore(const EditorWidgetState &s); + + // Get/Set the shared splitter state of all editors of that type for + // settings + static EditorWidgetState state(); + static void setState(const EditorWidgetState&st); + +public slots: + void activate(); + void toolChanged(int); + +private: + void setInitialSizes(); + + SharedSubWindow* m_designerSubWindows[Designer::Constants::DesignerSubWindowCount]; + QSplitter *m_centerVertSplitter; + QTabWidget *m_bottomTab; + QSplitter *m_rightVertSplitter; +}; + +} // namespace Internal +} // namespace Designer + +#endif // DESIGNER_EDITORWIDGET_H diff --git a/src/plugins/designer/formeditorfactory.cpp b/src/plugins/designer/formeditorfactory.cpp index aa0e7cf186..4c69966fdf 100644 --- a/src/plugins/designer/formeditorfactory.cpp +++ b/src/plugins/designer/formeditorfactory.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formeditorfactory.h" #include "formeditorw.h" #include "formwindoweditor.h" diff --git a/src/plugins/designer/formeditorfactory.h b/src/plugins/designer/formeditorfactory.h index a4c6d247fa..ae565f70c3 100644 --- a/src/plugins/designer/formeditorfactory.h +++ b/src/plugins/designer/formeditorfactory.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMEDITORFACTORY_H #define FORMEDITORFACTORY_H @@ -69,5 +70,4 @@ private: } // namespace Internal } // namespace Designer -#endif - +#endif // FORMEDITORFACTORY_H diff --git a/src/plugins/designer/formeditorplugin.cpp b/src/plugins/designer/formeditorplugin.cpp index 92dbd84805..0c3dbb4d6e 100644 --- a/src/plugins/designer/formeditorplugin.cpp +++ b/src/plugins/designer/formeditorplugin.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formeditorplugin.h" #include "formeditorfactory.h" #include "formeditorw.h" diff --git a/src/plugins/designer/formeditorplugin.h b/src/plugins/designer/formeditorplugin.h index 105bd740bb..9967cf3984 100644 --- a/src/plugins/designer/formeditorplugin.h +++ b/src/plugins/designer/formeditorplugin.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMEDITORPLUGIN_H #define FORMEDITORPLUGIN_H diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp index 5526b3a01f..c156dec1b7 100644 --- a/src/plugins/designer/formeditorw.cpp +++ b/src/plugins/designer/formeditorw.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formeditorw.h" #include "formwindoweditor.h" #include "designerconstants.h" diff --git a/src/plugins/designer/formeditorw.h b/src/plugins/designer/formeditorw.h index a5477bffe0..5eb0348bc8 100644 --- a/src/plugins/designer/formeditorw.h +++ b/src/plugins/designer/formeditorw.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMEDITORW_H #define FORMEDITORW_H diff --git a/src/plugins/designer/formtemplatewizardpage.cpp b/src/plugins/designer/formtemplatewizardpage.cpp index 77e008af09..1d57381796 100644 --- a/src/plugins/designer/formtemplatewizardpage.cpp +++ b/src/plugins/designer/formtemplatewizardpage.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formtemplatewizardpage.h" #include "formeditorw.h" @@ -325,6 +326,7 @@ QString FormTemplateWizardPagePage::changeUiClassName(const QString &uiXml, cons const QString rc = domUi.toString(); return rc; } -#endif +#endif // USE_XSLT + } // namespace Internal } // namespace Designer diff --git a/src/plugins/designer/formtemplatewizardpage.h b/src/plugins/designer/formtemplatewizardpage.h index ed35aa5c32..93bd4bcf42 100644 --- a/src/plugins/designer/formtemplatewizardpage.h +++ b/src/plugins/designer/formtemplatewizardpage.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMWIZARDPAGE_H #define FORMWIZARDPAGE_H @@ -76,4 +77,4 @@ private: } // namespace Internal } // namespace Designer -#endif //FORMTEMPLATEWIZARDPAGE_H +#endif // FORMTEMPLATEWIZARDPAGE_H diff --git a/src/plugins/designer/formwindoweditor.cpp b/src/plugins/designer/formwindoweditor.cpp index ab4223d531..86c69dd51a 100644 --- a/src/plugins/designer/formwindoweditor.cpp +++ b/src/plugins/designer/formwindoweditor.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "designerconstants.h" #include "editorwidget.h" #include "formeditorw.h" @@ -65,7 +66,8 @@ using ProjectExplorer::FileNode; enum { debugFormWindowEditor = 0 }; -class QrcFilesVisitor : public NodesVisitor { +class QrcFilesVisitor : public NodesVisitor +{ public: QStringList qrcFiles() const; diff --git a/src/plugins/designer/formwindoweditor.h b/src/plugins/designer/formwindoweditor.h index 6a1dc26725..dbeaeae2fd 100644 --- a/src/plugins/designer/formwindoweditor.h +++ b/src/plugins/designer/formwindoweditor.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMWINDOWEDITOR_H #define FORMWINDOWEDITOR_H @@ -125,4 +126,4 @@ private: } // namespace Internal } // namespace Designer -#endif //FORMWINDOWEDITOR_H +#endif // FORMWINDOWEDITOR_H diff --git a/src/plugins/designer/formwindowfile.cpp b/src/plugins/designer/formwindowfile.cpp index 0fcf9b5a18..c7681848ae 100644 --- a/src/plugins/designer/formwindowfile.cpp +++ b/src/plugins/designer/formwindowfile.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formwindowfile.h" #include "designerconstants.h" diff --git a/src/plugins/designer/formwindowfile.h b/src/plugins/designer/formwindowfile.h index b008d061da..8425d56e05 100644 --- a/src/plugins/designer/formwindowfile.h +++ b/src/plugins/designer/formwindowfile.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMWINDOWFILE_H #define FORMWINDOWFILE_H @@ -102,4 +103,4 @@ private: } // namespace Internal } // namespace Designer -#endif //FORMWINDOWFILE_H +#endif // FORMWINDOWFILE_H diff --git a/src/plugins/designer/formwindowhost.cpp b/src/plugins/designer/formwindowhost.cpp index f80d3a8a9d..5cbc5c882d 100644 --- a/src/plugins/designer/formwindowhost.cpp +++ b/src/plugins/designer/formwindowhost.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formwindowhost.h" #include "formeditorw.h" diff --git a/src/plugins/designer/formwindowhost.h b/src/plugins/designer/formwindowhost.h index 2201d2f642..8f0bc17aa6 100644 --- a/src/plugins/designer/formwindowhost.h +++ b/src/plugins/designer/formwindowhost.h @@ -30,10 +30,10 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMWINDOWHOST_H #define FORMWINDOWHOST_H - #include "widgethost.h" class QDesignerFormWindowInterface; @@ -58,4 +58,4 @@ private slots: } // namespace Internal } // namespace Designer -#endif //FORMWINDOWHOST_H +#endif // FORMWINDOWHOST_H diff --git a/src/plugins/designer/formwizard.cpp b/src/plugins/designer/formwizard.cpp index 427e8a0c03..0aa877f05b 100644 --- a/src/plugins/designer/formwizard.cpp +++ b/src/plugins/designer/formwizard.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formwizard.h" #include "formwizarddialog.h" #include "formwindoweditor.h" diff --git a/src/plugins/designer/formwizard.h b/src/plugins/designer/formwizard.h index d2d82a858c..7eb53a629f 100644 --- a/src/plugins/designer/formwizard.h +++ b/src/plugins/designer/formwizard.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMWIZARD_H #define FORMWIZARD_H diff --git a/src/plugins/designer/formwizarddialog.cpp b/src/plugins/designer/formwizarddialog.cpp index d48be36118..e813d73748 100644 --- a/src/plugins/designer/formwizarddialog.cpp +++ b/src/plugins/designer/formwizarddialog.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formwizarddialog.h" #include "formtemplatewizardpage.h" #include "formeditorw.h" @@ -123,5 +124,6 @@ void FormFileWizardDialog::slotCurrentIdChanged(int id) } } } + } // namespace Internal } // namespace Designer diff --git a/src/plugins/designer/formwizarddialog.h b/src/plugins/designer/formwizarddialog.h index 98cff5e8eb..b537947618 100644 --- a/src/plugins/designer/formwizarddialog.h +++ b/src/plugins/designer/formwizarddialog.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FORMWIZARDDIALOG_H #define FORMWIZARDDIALOG_H @@ -101,4 +102,4 @@ private: } // namespace Internal } // namespace Designer -#endif //FORMWIZARDDIALOG_H +#endif // FORMWIZARDDIALOG_H diff --git a/src/plugins/designer/settingsmanager.cpp b/src/plugins/designer/settingsmanager.cpp index a911d139cb..1f2305de14 100644 --- a/src/plugins/designer/settingsmanager.cpp +++ b/src/plugins/designer/settingsmanager.cpp @@ -30,7 +30,9 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ -#include <settingsmanager.h> + +#include "settingsmanager.h" + #include <QtCore/QDebug> using namespace Designer::Internal; diff --git a/src/plugins/designer/settingsmanager.h b/src/plugins/designer/settingsmanager.h index d580d90eee..795a61ddfa 100644 --- a/src/plugins/designer/settingsmanager.h +++ b/src/plugins/designer/settingsmanager.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SETTINGSMANAGER_H #define SETTINGSMANAGER_H @@ -61,4 +62,4 @@ private: } // namespace Internal } // namespace Designer -#endif //SETTINGSMANAGER_H +#endif // SETTINGSMANAGER_H diff --git a/src/plugins/designer/settingspage.cpp b/src/plugins/designer/settingspage.cpp index c2fddc2202..269c6a1169 100644 --- a/src/plugins/designer/settingspage.cpp +++ b/src/plugins/designer/settingspage.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "settingspage.h" #include <extensionsystem/pluginmanager.h> diff --git a/src/plugins/designer/settingspage.h b/src/plugins/designer/settingspage.h index 9970826878..f794afa634 100644 --- a/src/plugins/designer/settingspage.h +++ b/src/plugins/designer/settingspage.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef DESIGNER_SETTINGSPAGE_H #define DESIGNER_SETTINGSPAGE_H @@ -64,7 +65,7 @@ private: QDesignerOptionsPageInterface *m_designerPage; }; -} //namespace Internal -} //namespace QuickOpen +} // namespace Internal +} // namespace QuickOpen #endif // DESIGNER_SETTINGSPAGE_H diff --git a/src/plugins/designer/workbenchintegration.cpp b/src/plugins/designer/workbenchintegration.cpp index 6db411e0b2..4e49218a5c 100644 --- a/src/plugins/designer/workbenchintegration.cpp +++ b/src/plugins/designer/workbenchintegration.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "formeditorplugin.h" #include "workbenchintegration.h" #include "formeditorw.h" diff --git a/src/plugins/designer/workbenchintegration.h b/src/plugins/designer/workbenchintegration.h index ce6f5f431b..c13e27620e 100644 --- a/src/plugins/designer/workbenchintegration.h +++ b/src/plugins/designer/workbenchintegration.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef WORKBENCHINTEGRATION_H #define WORKBENCHINTEGRATION_H diff --git a/src/plugins/find/basetextfind.cpp b/src/plugins/find/basetextfind.cpp index 0819d893ec..63740d3652 100644 --- a/src/plugins/find/basetextfind.cpp +++ b/src/plugins/find/basetextfind.cpp @@ -30,7 +30,9 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "basetextfind.h" + #include <QtGui/QTextBlock> using namespace Find; diff --git a/src/plugins/find/basetextfind.h b/src/plugins/find/basetextfind.h index e3d3bc97bc..ed8435981c 100644 --- a/src/plugins/find/basetextfind.h +++ b/src/plugins/find/basetextfind.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef BASETEXTFIND_H #define BASETEXTFIND_H diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp index bf60c1078d..091c307d3d 100644 --- a/src/plugins/find/currentdocumentfind.cpp +++ b/src/plugins/find/currentdocumentfind.cpp @@ -30,7 +30,9 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "currentdocumentfind.h" + #include <aggregation/aggregate.h> #include <coreplugin/coreconstants.h> #include <coreplugin/modemanager.h> diff --git a/src/plugins/find/currentdocumentfind.h b/src/plugins/find/currentdocumentfind.h index 99c4a83c30..815182e88c 100644 --- a/src/plugins/find/currentdocumentfind.h +++ b/src/plugins/find/currentdocumentfind.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CURRENTDOCUMENTFIND_H #define CURRENTDOCUMENTFIND_H diff --git a/src/plugins/find/find_global.h b/src/plugins/find/find_global.h index b390577994..800b7cccce 100644 --- a/src/plugins/find/find_global.h +++ b/src/plugins/find/find_global.h @@ -30,19 +30,6 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ -/**************************************************************************** -** -** Copyright (C) 1992-$THISYEAR$ Trolltech AS. All rights reserved. -** -** This file is part of the $MODULE$ of the Qt Toolkit. -** -** $LICENSE$ -** -** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -** -****************************************************************************/ - #ifndef FIND_GLOBAL_H #define FIND_GLOBAL_H diff --git a/src/plugins/find/findplugin.h b/src/plugins/find/findplugin.h index 5c99198473..538797f516 100644 --- a/src/plugins/find/findplugin.h +++ b/src/plugins/find/findplugin.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FINDPLUGIN_H #define FINDPLUGIN_H diff --git a/src/plugins/find/findtoolbar.cpp b/src/plugins/find/findtoolbar.cpp index 88e25afc4c..6a28c4d93c 100644 --- a/src/plugins/find/findtoolbar.cpp +++ b/src/plugins/find/findtoolbar.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "findtoolbar.h" #include "findplugin.h" #include "textfindconstants.h" diff --git a/src/plugins/find/findtoolbar.h b/src/plugins/find/findtoolbar.h index ddf556aeea..790a1e0300 100644 --- a/src/plugins/find/findtoolbar.h +++ b/src/plugins/find/findtoolbar.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FINDTOOLBAR_H #define FINDTOOLBAR_H diff --git a/src/plugins/find/findtoolwindow.cpp b/src/plugins/find/findtoolwindow.cpp index ba9ea2b54f..6b1ac69deb 100644 --- a/src/plugins/find/findtoolwindow.cpp +++ b/src/plugins/find/findtoolwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "findtoolwindow.h" #include "findplugin.h" diff --git a/src/plugins/find/findtoolwindow.h b/src/plugins/find/findtoolwindow.h index 2a8576a7fd..71d3200b3c 100644 --- a/src/plugins/find/findtoolwindow.h +++ b/src/plugins/find/findtoolwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef FINDTOOLWINDOW_H #define FINDTOOLWINDOW_H diff --git a/src/plugins/find/ifindfilter.h b/src/plugins/find/ifindfilter.h index fe88ce9e2d..057b56acd4 100644 --- a/src/plugins/find/ifindfilter.h +++ b/src/plugins/find/ifindfilter.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef IFINDFILTER_H #define IFINDFILTER_H diff --git a/src/plugins/find/ifindsupport.h b/src/plugins/find/ifindsupport.h index a5dfc36e5f..6bf5ede776 100644 --- a/src/plugins/find/ifindsupport.h +++ b/src/plugins/find/ifindsupport.h @@ -30,10 +30,12 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef IFINDSUPPORT_H #define IFINDSUPPORT_H #include "find_global.h" + #include <QtGui/QTextDocument> namespace Find { @@ -69,7 +71,7 @@ signals: }; -inline void IFindSupport::highlightAll(const QString &, QTextDocument::FindFlags){} +inline void IFindSupport::highlightAll(const QString &, QTextDocument::FindFlags) {} } // namespace Find diff --git a/src/plugins/find/searchresulttreeitemdelegate.cpp b/src/plugins/find/searchresulttreeitemdelegate.cpp index 52b3bc63ff..6be35f71b8 100644 --- a/src/plugins/find/searchresulttreeitemdelegate.cpp +++ b/src/plugins/find/searchresulttreeitemdelegate.cpp @@ -30,32 +30,30 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "searchresulttreeitemdelegate.h" #include "searchresulttreeitemroles.h" -#include <math.h> - #include <QModelIndex> #include <QTextDocument> #include <QPainter> #include <QAbstractTextDocumentLayout> #include <QApplication> +#include <math.h> + using namespace Find::Internal; SearchResultTreeItemDelegate::SearchResultTreeItemDelegate(QObject *parent) -: QItemDelegate(parent) + : QItemDelegate(parent) { } void SearchResultTreeItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { - if (index.model()->data(index, ItemDataRoles::TypeRole).toString().compare("file") == 0) - { + if (index.model()->data(index, ItemDataRoles::TypeRole).toString().compare("file") == 0) { QItemDelegate::paint(painter, option, index); - } - else - { + } else { painter->save(); QStyleOptionViewItemV3 opt = setOptions(index, option); diff --git a/src/plugins/find/searchresulttreeitemdelegate.h b/src/plugins/find/searchresulttreeitemdelegate.h index 7b5237b3c7..a79db17383 100644 --- a/src/plugins/find/searchresulttreeitemdelegate.h +++ b/src/plugins/find/searchresulttreeitemdelegate.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SEARCHRESULTTREEITEMDELEGATE_H #define SEARCHRESULTTREEITEMDELEGATE_H @@ -51,7 +52,7 @@ private: static const int m_minimumLineNumberDigits = 6; }; -} //Internal -} //Find +} // namespace Internal +} // namespace Find -#endif +#endif // SEARCHRESULTTREEITEMDELEGATE_H diff --git a/src/plugins/find/searchresulttreeitemroles.h b/src/plugins/find/searchresulttreeitemroles.h index 569f5ad5c6..a1998cdeaa 100644 --- a/src/plugins/find/searchresulttreeitemroles.h +++ b/src/plugins/find/searchresulttreeitemroles.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SEARCHRESULTTREEITEMROLES_H #define SEARCHRESULTTREEITEMROLES_H @@ -50,8 +51,8 @@ enum roles RowOfItem // The ?-th child of its parent is this this item }; -} //Internal -} //Find -} //itemDataRoles +} // namespace Internal +} // namespace Find +} // namespace itemDataRoles -#endif +#endif // SEARCHRESULTTREEITEMROLES_H diff --git a/src/plugins/find/searchresulttreeitems.cpp b/src/plugins/find/searchresulttreeitems.cpp index 897aad1762..a098350005 100644 --- a/src/plugins/find/searchresulttreeitems.cpp +++ b/src/plugins/find/searchresulttreeitems.cpp @@ -30,13 +30,13 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "searchresulttreeitems.h" using namespace Find::Internal; SearchResultTreeItem::SearchResultTreeItem(SearchResultTreeItem::itemType type, const SearchResultTreeItem *parent) -: m_type(type) -, m_parent(parent) + : m_type(type), m_parent(parent) { } @@ -118,8 +118,7 @@ int SearchResultTextRow::searchTermLength() const } SearchResultFile::SearchResultFile(const QString &fileName, const SearchResultTreeItem *parent) -: SearchResultTreeItem(resultFile, parent) -, m_fileName(fileName) + : SearchResultTreeItem(resultFile, parent), m_fileName(fileName) { } diff --git a/src/plugins/find/searchresulttreeitems.h b/src/plugins/find/searchresulttreeitems.h index 3fc9eccaf2..0dd6b88676 100644 --- a/src/plugins/find/searchresulttreeitems.h +++ b/src/plugins/find/searchresulttreeitems.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SEARCHRESULTTREEITEMS_H #define SEARCHRESULTTREEITEMS_H @@ -55,13 +56,13 @@ public: SearchResultTreeItem(itemType type = root, const SearchResultTreeItem *parent = NULL); virtual ~SearchResultTreeItem(); - itemType getItemType(void) const; - const SearchResultTreeItem *getParent(void) const; + itemType getItemType() const; + const SearchResultTreeItem *getParent() const; const SearchResultTreeItem *getChild(int index) const; void appendChild(SearchResultTreeItem *child); - int getChildrenCount(void) const; - int getRowOfItem(void) const; - void clearChildren(void); + int getChildrenCount() const; + int getRowOfItem() const; + void clearChildren(); private: itemType m_type; @@ -92,7 +93,7 @@ class SearchResultFile: public SearchResultTreeItem { public: SearchResultFile(const QString &fileName, const SearchResultTreeItem *parent); - QString getFileName(void) const; + QString getFileName() const; void appendResultLine(int index, int lineNumber, const QString &rowText, int searchTermStart, int searchTermLength); @@ -100,7 +101,7 @@ private: QString m_fileName; }; -} //Internal -} //Find +} // namespace Internal +} // namespace Find -#endif +#endif // SEARCHRESULTTREEITEMS_H diff --git a/src/plugins/find/searchresulttreemodel.cpp b/src/plugins/find/searchresulttreemodel.cpp index bf77243bca..f99e9d8e45 100644 --- a/src/plugins/find/searchresulttreemodel.cpp +++ b/src/plugins/find/searchresulttreemodel.cpp @@ -30,17 +30,18 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "searchresulttreemodel.h" #include "searchresulttreeitems.h" #include "searchresulttreeitemroles.h" + #include <QtGui/QFont> #include <QtGui/QColor> using namespace Find::Internal; SearchResultTreeModel::SearchResultTreeModel(QObject *parent) -: QAbstractItemModel(parent) -, m_lastAppendedResultFile(NULL) + : QAbstractItemModel(parent), m_lastAppendedResultFile(0) { m_rootItem = new SearchResultTreeItem(); } diff --git a/src/plugins/find/searchresulttreemodel.h b/src/plugins/find/searchresulttreemodel.h index 76c77b2585..5a1518d9f0 100644 --- a/src/plugins/find/searchresulttreemodel.h +++ b/src/plugins/find/searchresulttreemodel.h @@ -30,19 +30,20 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SEARCHRESULTTREEMODEL_H #define SEARCHRESULTTREEMODEL_H #include <QtCore/QAbstractItemModel> -namespace Find{ +namespace Find { namespace Internal { class SearchResultTreeItem; class SearchResultTextRow; class SearchResultFile; -class SearchResultTreeModel: public QAbstractItemModel +class SearchResultTreeModel : public QAbstractItemModel { Q_OBJECT @@ -81,7 +82,7 @@ private: SearchResultFile *m_lastAppendedResultFile; }; -} //Internal -} //Find +} // namespace Internal +} // namespace Find -#endif +#endif // SEARCHRESULTTREEMODEL_H diff --git a/src/plugins/find/searchresulttreeview.cpp b/src/plugins/find/searchresulttreeview.cpp index 4e7c78937e..6cd0f41c1f 100644 --- a/src/plugins/find/searchresulttreeview.cpp +++ b/src/plugins/find/searchresulttreeview.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "searchresulttreeview.h" #include "searchresulttreeitemroles.h" #include "searchresulttreemodel.h" @@ -40,8 +41,7 @@ using namespace Find::Internal; SearchResultTreeView::SearchResultTreeView(QWidget *parent) -: QTreeView(parent) -, m_autoExpandResults(false) + : QTreeView(parent), m_autoExpandResults(false) { m_model = new SearchResultTreeModel(this); setModel(m_model); @@ -71,7 +71,7 @@ void SearchResultTreeView::appendResultLine(int index, const QString &fileName, int rowsAfter = m_model->rowCount(); if (m_autoExpandResults && (rowsAfter > rowsBefore)) - setExpanded(model()->index(model()->rowCount()-1, 0), true); + setExpanded(model()->index(model()->rowCount() - 1, 0), true); } void SearchResultTreeView::emitJumpToSearchResult(const QModelIndex &index) diff --git a/src/plugins/find/searchresulttreeview.h b/src/plugins/find/searchresulttreeview.h index b1af27b100..578e57d9e4 100644 --- a/src/plugins/find/searchresulttreeview.h +++ b/src/plugins/find/searchresulttreeview.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SEARCHRESULTTREEVIEW_H #define SEARCHRESULTTREEVIEW_H @@ -41,7 +42,7 @@ namespace Internal { class SearchResultTreeModel; -class SearchResultTreeView: public QTreeView +class SearchResultTreeView : public QTreeView { Q_OBJECT diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp index 3ce2d26365..d9b040f80f 100644 --- a/src/plugins/find/searchresultwindow.cpp +++ b/src/plugins/find/searchresultwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "searchresultwindow.h" #include "searchresulttreemodel.h" @@ -45,7 +46,7 @@ using namespace Find::Internal; static const QString SETTINGSKEYSECTIONNAME("SearchResults"); static const QString SETTINGSKEYEXPANDRESULTS("ExpandResults"); -SearchResultWindow::SearchResultWindow(Core::ICore *core): +SearchResultWindow::SearchResultWindow(Core::ICore *core) : m_core(core), m_widget(new QStackedWidget()) { diff --git a/src/plugins/find/searchresultwindow.h b/src/plugins/find/searchresultwindow.h index 150f20354a..7d616b1b11 100644 --- a/src/plugins/find/searchresultwindow.h +++ b/src/plugins/find/searchresultwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SEARCHRESULTWINDOW_H #define SEARCHRESULTWINDOW_H @@ -91,8 +92,8 @@ private slots: int searchTermStart, int searchTermLength); private: - void readSettings(void); - void writeSettings(void); + void readSettings(); + void writeSettings(); Internal::SearchResultTreeView *m_searchResultTreeView; QListWidget *m_noMatchesFoundDisplay; diff --git a/src/plugins/find/textfindconstants.h b/src/plugins/find/textfindconstants.h index 1ebb8c60cf..86d74b7b3d 100644 --- a/src/plugins/find/textfindconstants.h +++ b/src/plugins/find/textfindconstants.h @@ -30,28 +30,31 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef TEXTFINDCONSTANTS_H #define TEXTFINDCONSTANTS_H - namespace Find { - namespace Constants { - const char * const M_FIND = "Find.FindMenu"; - const char * const G_FIND_FILTERS = "Find.FindMenu.Filters"; - const char * const G_FIND_FLAGS = "Find.FindMenu.Flags"; - const char * const G_FIND_ACTIONS = "Find.FindMenu.Actions"; +namespace Find { +namespace Constants { + +const char * const M_FIND = "Find.FindMenu"; +const char * const G_FIND_FILTERS = "Find.FindMenu.Filters"; +const char * const G_FIND_FLAGS = "Find.FindMenu.Flags"; +const char * const G_FIND_ACTIONS = "Find.FindMenu.Actions"; + +const char * const FIND = "Find.FindReplace"; +const char * const FIND_IN_DOCUMENT = "Find.FindInCurrentDocument"; +const char * const FIND_NEXT = "Find.FindNext"; +const char * const FIND_PREVIOUS = "Find.FindPrevious"; +const char * const FIND_ALL = "Find.FindAll"; +const char * const REPLACE_NEXT = "Find.ReplaceNext"; +const char * const REPLACE_PREVIOUS = "Find.ReplacePrevious"; +const char * const REPLACE_ALL = "Find.ReplaceAll"; +const char * const CASE_SENSITIVE = "Find.CaseSensitive"; +const char * const WHOLE_WORDS = "Find.WholeWords"; +const char * const TASK_SEARCH = "Find.Task.Search"; - const char * const FIND = "Find.FindReplace"; - const char * const FIND_IN_DOCUMENT = "Find.FindInCurrentDocument"; - const char * const FIND_NEXT = "Find.FindNext"; - const char * const FIND_PREVIOUS = "Find.FindPrevious"; - const char * const FIND_ALL = "Find.FindAll"; - const char * const REPLACE_NEXT = "Find.ReplaceNext"; - const char * const REPLACE_PREVIOUS = "Find.ReplacePrevious"; - const char * const REPLACE_ALL = "Find.ReplaceAll"; - const char * const CASE_SENSITIVE = "Find.CaseSensitive"; - const char * const WHOLE_WORDS = "Find.WholeWords"; - const char * const TASK_SEARCH = "Find.Task.Search"; - } - } //Find +} // namespace Constants +} // namespace Find -#endif //TEXTFINDCONSTANTS_H +#endif // TEXTFINDCONSTANTS_H diff --git a/src/plugins/git/annotationhighlighter.cpp b/src/plugins/git/annotationhighlighter.cpp index a1436b93ef..9c85deff13 100644 --- a/src/plugins/git/annotationhighlighter.cpp +++ b/src/plugins/git/annotationhighlighter.cpp @@ -30,7 +30,9 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "annotationhighlighter.h" + #include <QtCore/QDebug> namespace Git { @@ -49,5 +51,5 @@ QString GitAnnotationHighlighter::changeNumber(const QString &block) const return pos > 1 ? block.left(pos) : QString(); } -} -} +} // namespace Internal +} // namespace Git diff --git a/src/plugins/git/annotationhighlighter.h b/src/plugins/git/annotationhighlighter.h index f1cfed9db6..ebc8f199f9 100644 --- a/src/plugins/git/annotationhighlighter.h +++ b/src/plugins/git/annotationhighlighter.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef ANNOTATIONHIGHLIGHTER_H #define ANNOTATIONHIGHLIGHTER_H @@ -52,7 +53,7 @@ private: const QChar m_blank; }; -} //namespace Git -} //namespace Internal +} // namespace Internal +} // namespace Git -#endif +#endif // ANNOTATIONHIGHLIGHTER_H diff --git a/src/plugins/git/changeselectiondialog.cpp b/src/plugins/git/changeselectiondialog.cpp index 94b55cebd4..70004dbadf 100644 --- a/src/plugins/git/changeselectiondialog.cpp +++ b/src/plugins/git/changeselectiondialog.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "changeselectiondialog.h" #include <QtGui/QFileDialog> diff --git a/src/plugins/git/changeselectiondialog.h b/src/plugins/git/changeselectiondialog.h index ee47f7a828..7ccb439a8a 100644 --- a/src/plugins/git/changeselectiondialog.h +++ b/src/plugins/git/changeselectiondialog.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CHANGESELECTIONDIALOG_H #define CHANGESELECTIONDIALOG_H @@ -40,7 +41,7 @@ namespace Git { namespace Internal { - class GitPlugin; +class GitPlugin; class ChangeSelectionDialog : public QDialog { @@ -57,7 +58,7 @@ private: }; -} //namespace Internal -} //namespace Git +} // namespace Internal +} // namespace Git #endif // CHANGESELECTIONDIALOG_H diff --git a/src/plugins/git/commitdata.cpp b/src/plugins/git/commitdata.cpp index b1d0131377..60e2173a66 100644 --- a/src/plugins/git/commitdata.cpp +++ b/src/plugins/git/commitdata.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "commitdata.h" #include <QtCore/QDebug> @@ -92,5 +93,5 @@ QDebug operator<<(QDebug d, const CommitData &data) return d; } -} -} +} // namespace Internal +} // namespace Git diff --git a/src/plugins/git/commitdata.h b/src/plugins/git/commitdata.h index 1a6d4c04f2..9cd5a83eb1 100644 --- a/src/plugins/git/commitdata.h +++ b/src/plugins/git/commitdata.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef COMMITDATA_H #define COMMITDATA_H @@ -42,40 +43,43 @@ QT_END_NAMESPACE namespace Git { namespace Internal { - // Read-only - struct GitSubmitEditorPanelInfo { - void clear(); - QString repository; - QString description; - QString branch; - }; +// Read-only +struct GitSubmitEditorPanelInfo +{ + void clear(); + QString repository; + QString description; + QString branch; +}; - QDebug operator<<(QDebug d, const GitSubmitEditorPanelInfo &); +QDebug operator<<(QDebug d, const GitSubmitEditorPanelInfo &); - struct GitSubmitEditorPanelData { - void clear(); - // Format as "John Doe <jdoe@foobar.com>" - QString authorString() const; +struct GitSubmitEditorPanelData +{ + void clear(); + // Format as "John Doe <jdoe@foobar.com>" + QString authorString() const; - QString author; - QString email; - }; + QString author; + QString email; +}; - QDebug operator<<(QDebug d, const GitSubmitEditorPanelData &); +QDebug operator<<(QDebug d, const GitSubmitEditorPanelData &); - struct CommitData { - void clear(); - GitSubmitEditorPanelInfo panelInfo; - GitSubmitEditorPanelData panelData; - QStringList commitFiles; - QStringList notUpdatedFiles; - QStringList untrackedFiles; - }; +struct CommitData +{ + void clear(); + GitSubmitEditorPanelInfo panelInfo; + GitSubmitEditorPanelData panelData; + QStringList commitFiles; + QStringList notUpdatedFiles; + QStringList untrackedFiles; +}; - QDebug operator<<(QDebug d, const CommitData &); +QDebug operator<<(QDebug d, const CommitData &); -} -} +} // namespace Internal +} // namespace Git -#endif +#endif // COMMITDATA_H diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 41f576e357..d021881dbb 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gitclient.h" #include "gitplugin.h" #include "gitconstants.h" diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 872a89334e..944041afa3 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GITCLIENT_H #define GITCLIENT_H @@ -64,62 +65,53 @@ struct GitSubmitEditorPanelData; class GitClient : public Core::IVersionControl { Q_OBJECT + public: - explicit GitClient(GitPlugin *plugin, Core::ICore *core); - ~GitClient(); - bool vcsOpen(const QString &fileName); - bool vcsAdd(const QString&) {return false;} - bool vcsDelete(const QString&) {return false;} - bool managesDirectory(const QString&) const {return false;} - QString findTopLevelForDirectory(const QString&) const {return QString();} - - static QString findRepositoryForFile(const QString &fileName); - static QString findRepositoryForDirectory(const QString &dir); - - void diff(const QString &workingDirectory, - const QString &fileName); - void diff(const QString &workingDirectory, - const QStringList &fileNames); - - void status(const QString &workingDirectory); - void log(const QString &workingDirectory - , const QString &fileName); - void blame(const QString &workingDirectory - , const QString &fileName); - void showCommit(const QString &workingDirectory - , const QString &commit); - void checkout(const QString &workingDirectory - , const QString &file); - void hardReset(const QString &workingDirectory - , const QString &commit); - void addFile(const QString &workingDirectory - , const QString &fileName); - bool synchronousAdd(const QString &workingDirectory, - const QStringList &files); - void pull(const QString &workingDirectory); - void push(const QString &workingDirectory); - - QString readConfig(const QString &workingDirectory - , const QStringList &configVar); - - QString readConfigValue(const QString &workingDirectory, - const QString &configVar); - - bool getCommitData(const QString &workingDirectory, - QString *commitTemplate, - CommitData *d, - QString *errorMessage); - - bool addAndCommit(const QString &workingDirectory, - const GitSubmitEditorPanelData &data, - const QString &messageFile, - const QStringList &files); + GitClient(GitPlugin *plugin, Core::ICore *core); + ~GitClient(); + + bool vcsOpen(const QString &fileName); + bool vcsAdd(const QString &) { return false; } + bool vcsDelete(const QString &) { return false; } + bool managesDirectory(const QString &) const { return false; } + QString findTopLevelForDirectory(const QString &) const { return QString(); } + + static QString findRepositoryForFile(const QString &fileName); + static QString findRepositoryForDirectory(const QString &dir); + + void diff(const QString &workingDirectory, const QString &fileName); + void diff(const QString &workingDirectory, const QStringList &fileNames); + + void status(const QString &workingDirectory); + void log(const QString &workingDirectory, const QString &fileName); + void blame(const QString &workingDirectory, const QString &fileName); + void showCommit(const QString &workingDirectory, const QString &commit); + void checkout(const QString &workingDirectory, const QString &file); + void hardReset(const QString &workingDirectory, const QString &commit); + void addFile(const QString &workingDirectory, const QString &fileName); + bool synchronousAdd(const QString &workingDirectory, const QStringList &files); + void pull(const QString &workingDirectory); + void push(const QString &workingDirectory); + + QString readConfig(const QString &workingDirectory, const QStringList &configVar); + + QString readConfigValue(const QString &workingDirectory, const QString &configVar); + + bool getCommitData(const QString &workingDirectory, + QString *commitTemplate, + CommitData *d, + QString *errorMessage); + + bool addAndCommit(const QString &workingDirectory, + const GitSubmitEditorPanelData &data, + const QString &messageFile, + const QStringList &files); public slots: void show(const QString &source, const QString &id); private: - VCSBase::VCSBaseEditor *createVCSEditor(const QString &kind, + VCSBase::VCSBaseEditor *createVCSEditor(const QString &kind, QString title, const QString &source, bool setSourceCodec, @@ -127,20 +119,20 @@ private: const QString &dynamicPropertyValue) const; - void executeGit(const QString &workingDirectory - , const QStringList &arguments - , GitOutputWindow *outputWindow - , VCSBase::VCSBaseEditor* editor = 0 - , bool outputToWindow = false); + void executeGit(const QString &workingDirectory, + const QStringList &arguments, + GitOutputWindow *outputWindow, + VCSBase::VCSBaseEditor* editor = 0, + bool outputToWindow = false); - bool synchronousGit(const QString &workingDirectory - , const QStringList &arguments - , QByteArray* outputText = 0 - , QByteArray* errorText = 0); + bool synchronousGit(const QString &workingDirectory, + const QStringList &arguments, + QByteArray* outputText = 0, + QByteArray* errorText = 0); - const QString m_msgWait; - GitPlugin *m_plugin; - Core::ICore *m_core; + const QString m_msgWait; + GitPlugin *m_plugin; + Core::ICore *m_core; }; class GitCommand : public QObject @@ -149,12 +141,12 @@ class GitCommand : public QObject public: GitCommand(); ~GitCommand(); - void execute(const QStringList &arguments - , const QString &workingDirectory - , const ProjectExplorer::Environment &environment); - void run(const QStringList &arguments - , const QString &workingDirectory - , const ProjectExplorer::Environment &environment); + void execute(const QStringList &arguments, + const QString &workingDirectory, + const ProjectExplorer::Environment &environment); + void run(const QStringList &arguments, + const QString &workingDirectory, + const ProjectExplorer::Environment &environment); Q_SIGNALS: void outputData(const QByteArray&); @@ -162,7 +154,7 @@ Q_SIGNALS: void errorText(const QString&); }; - } -} +} // namespace Internal +} // namespace Git #endif // GITCLIENT_H diff --git a/src/plugins/git/gitconstants.h b/src/plugins/git/gitconstants.h index af5e5f15b2..935310f68e 100644 --- a/src/plugins/git/gitconstants.h +++ b/src/plugins/git/gitconstants.h @@ -30,29 +30,32 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GIT_CONSTANTS_H #define GIT_CONSTANTS_H namespace Git { - namespace Constants { - const char * const GIT_COMMAND_LOG_EDITOR_KIND = "Git Command Log Editor"; - const char * const GIT_LOG_EDITOR_KIND = "Git File Log Editor"; - const char * const GIT_BLAME_EDITOR_KIND = "Git Annotation Editor"; - const char * const GIT_DIFF_EDITOR_KIND = "Git Diff Editor"; - - const char * const C_GITSUBMITEDITOR = "Git Submit Editor"; - const char * const GITSUBMITEDITOR_KIND = "Git Submit Editor"; - const char * const SUBMIT_CURRENT = "Nokia.Git.SubmitCurrentLog"; - const char * const DIFF_SELECTED = "Nokia.Git.DiffSelectedFilesInLog"; - const char * const SUBMIT_MIMETYPE = "application/vnd.nokia.text.git.submit"; - - // TODO: For the moment, trust p4 is loaded... - const char * const ICON_SUBMIT = ":/trolltech.perforce/images/submit.png"; - const char * const ICON_DIFF = ":/trolltech.perforce/images/diff.png"; - - const char * const DIFF_FILE_INDICATOR = "--- "; - enum { debug = 0 }; - } -} +namespace Constants { + +const char * const GIT_COMMAND_LOG_EDITOR_KIND = "Git Command Log Editor"; +const char * const GIT_LOG_EDITOR_KIND = "Git File Log Editor"; +const char * const GIT_BLAME_EDITOR_KIND = "Git Annotation Editor"; +const char * const GIT_DIFF_EDITOR_KIND = "Git Diff Editor"; + +const char * const C_GITSUBMITEDITOR = "Git Submit Editor"; +const char * const GITSUBMITEDITOR_KIND = "Git Submit Editor"; +const char * const SUBMIT_CURRENT = "Nokia.Git.SubmitCurrentLog"; +const char * const DIFF_SELECTED = "Nokia.Git.DiffSelectedFilesInLog"; +const char * const SUBMIT_MIMETYPE = "application/vnd.nokia.text.git.submit"; + +// TODO: For the moment, trust p4 is loaded... +const char * const ICON_SUBMIT = ":/trolltech.perforce/images/submit.png"; +const char * const ICON_DIFF = ":/trolltech.perforce/images/diff.png"; + +const char * const DIFF_FILE_INDICATOR = "--- "; +enum { debug = 0 }; + +} // namespace Constants +} // namespace Git #endif // GIT_CONSTANTS_H diff --git a/src/plugins/git/giteditor.cpp b/src/plugins/git/giteditor.cpp index b6f43c4346..733a6abc0d 100644 --- a/src/plugins/git/giteditor.cpp +++ b/src/plugins/git/giteditor.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "giteditor.h" #include "annotationhighlighter.h" #include "gitconstants.h" @@ -141,5 +142,5 @@ QString GitEditor::fileNameFromDiffSpecification(const QTextBlock &inBlock) cons return QString(); } -} -} +} // namespace Internal +} // namespace Git diff --git a/src/plugins/git/giteditor.h b/src/plugins/git/giteditor.h index 6b848ed02c..1ef4b34c02 100644 --- a/src/plugins/git/giteditor.h +++ b/src/plugins/git/giteditor.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GITEDITOR_H #define GITEDITOR_H diff --git a/src/plugins/git/gitoutputwindow.cpp b/src/plugins/git/gitoutputwindow.cpp index a32064a8fc..a321449b1e 100644 --- a/src/plugins/git/gitoutputwindow.cpp +++ b/src/plugins/git/gitoutputwindow.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gitoutputwindow.h" #include <QtCore/QTextCodec> diff --git a/src/plugins/git/gitoutputwindow.h b/src/plugins/git/gitoutputwindow.h index 6097d2115e..af5a5027bb 100644 --- a/src/plugins/git/gitoutputwindow.h +++ b/src/plugins/git/gitoutputwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GITOUTPUTWINDOW_H #define GITOUTPUTWINDOW_H @@ -42,7 +43,6 @@ namespace Git { namespace Internal { - class GitOutputWindow : public Core::IOutputPane { Q_OBJECT @@ -52,7 +52,7 @@ public: ~GitOutputWindow(); QWidget *outputWidget(QWidget *parent); - QList<QWidget*> toolBarWidgets(void) const { return QList<QWidget *>(); } + QList<QWidget*> toolBarWidgets() const { return QList<QWidget *>(); } QString name() const; int priorityInStatusBar() const; @@ -76,4 +76,4 @@ private: } // namespace Internal } // namespace Git -#endif +#endif // GITOUTPUTWINDOW_H diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 5239148232..3b6342db8e 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gitplugin.h" #include "gitclient.h" #include "giteditor.h" diff --git a/src/plugins/git/gitplugin.h b/src/plugins/git/gitplugin.h index f39ebaf059..7becc05e7d 100644 --- a/src/plugins/git/gitplugin.h +++ b/src/plugins/git/gitplugin.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GITPLUGIN_H #define GITPLUGIN_H @@ -160,4 +161,4 @@ private: } // namespace Git } // namespace Internal -#endif +#endif // GITPLUGIN_H diff --git a/src/plugins/git/gitsubmiteditor.cpp b/src/plugins/git/gitsubmiteditor.cpp index 01e75ed56f..4f0e201d66 100644 --- a/src/plugins/git/gitsubmiteditor.cpp +++ b/src/plugins/git/gitsubmiteditor.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gitsubmiteditor.h" #include "gitsubmiteditorwidget.h" #include "gitconstants.h" @@ -88,5 +89,6 @@ QString GitSubmitEditor::fileFromChangeLine(const QString &line) rc.remove(0, 1); return rc; } -} -} + +} // namespace Internal +} // namespace Git diff --git a/src/plugins/git/gitsubmiteditor.h b/src/plugins/git/gitsubmiteditor.h index ff5d7c94d3..e0554758a2 100644 --- a/src/plugins/git/gitsubmiteditor.h +++ b/src/plugins/git/gitsubmiteditor.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GITSUBMITEDITOR_H #define GITSUBMITEDITOR_H diff --git a/src/plugins/git/gitsubmiteditorwidget.cpp b/src/plugins/git/gitsubmiteditorwidget.cpp index e5271333dd..99400952f1 100644 --- a/src/plugins/git/gitsubmiteditorwidget.cpp +++ b/src/plugins/git/gitsubmiteditorwidget.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "gitsubmiteditorwidget.h" #include "commitdata.h" @@ -65,5 +66,5 @@ void GitSubmitEditorWidget::setPanelData(const GitSubmitEditorPanelData &data) m_gitSubmitPanelUi.emailLineEdit->setText(data.email); } -} -} +} // namespace Internal +} // namespace Git diff --git a/src/plugins/git/gitsubmiteditorwidget.h b/src/plugins/git/gitsubmiteditorwidget.h index 7e52f70cce..06a96cb534 100644 --- a/src/plugins/git/gitsubmiteditorwidget.h +++ b/src/plugins/git/gitsubmiteditorwidget.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef GITSUBMITEDITORWIDGET_H #define GITSUBMITEDITORWIDGET_H diff --git a/src/plugins/git/settingspage.cpp b/src/plugins/git/settingspage.cpp index f4aa641c23..7b0c37284a 100644 --- a/src/plugins/git/settingspage.cpp +++ b/src/plugins/git/settingspage.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "settingspage.h" #include <coreplugin/icore.h> diff --git a/src/plugins/git/settingspage.h b/src/plugins/git/settingspage.h index 6871a2478e..95147cf655 100644 --- a/src/plugins/git/settingspage.h +++ b/src/plugins/git/settingspage.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef SETTINGSPAGE_H #define SETTINGSPAGE_H @@ -76,7 +77,7 @@ private: int m_logCount; }; -} //namespace Internal -} //namespace Git +} // namespace Internal +} // namespace Git -#endif +#endif // SETTINGSPAGE_H diff --git a/src/plugins/helloworld/helloworldplugin.cpp b/src/plugins/helloworld/helloworldplugin.cpp index 299c069338..9b1c9ea2f3 100644 --- a/src/plugins/helloworld/helloworldplugin.cpp +++ b/src/plugins/helloworld/helloworldplugin.cpp @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #include "helloworldplugin.h" #include "helloworldwindow.h" diff --git a/src/plugins/helloworld/helloworldplugin.h b/src/plugins/helloworld/helloworldplugin.h index cd18f77f9c..877087ec60 100644 --- a/src/plugins/helloworld/helloworldplugin.h +++ b/src/plugins/helloworld/helloworldplugin.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef HELLOWORLDPLUGIN_H #define HELLOWORLDPLUGIN_H @@ -62,4 +63,4 @@ private: } // namespace Internal } // namespace HelloWorld -#endif //HELLOWORLDPLUGIN_H +#endif // HELLOWORLDPLUGIN_H diff --git a/src/plugins/helloworld/helloworldwindow.cpp b/src/plugins/helloworld/helloworldwindow.cpp index 2c06587c31..03fb45c8bf 100644 --- a/src/plugins/helloworld/helloworldwindow.cpp +++ b/src/plugins/helloworld/helloworldwindow.cpp @@ -30,15 +30,16 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ -#include <QtGui/QTextEdit> -#include <QtGui/QVBoxLayout> #include "helloworldwindow.h" +#include <QtGui/QTextEdit> +#include <QtGui/QVBoxLayout> + using namespace HelloWorld::Internal; HelloWorldWindow::HelloWorldWindow(QWidget *parent) - :QWidget(parent) + : QWidget(parent) { QBoxLayout *layout = new QVBoxLayout(this); layout->addWidget(new QTextEdit("Focus me to activate my context!")); diff --git a/src/plugins/helloworld/helloworldwindow.h b/src/plugins/helloworld/helloworldwindow.h index d0e1f885bd..9c38a5d0c3 100644 --- a/src/plugins/helloworld/helloworldwindow.h +++ b/src/plugins/helloworld/helloworldwindow.h @@ -30,6 +30,7 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef HELLOWORLDWINDOW_H #define HELLOWORLDWINDOW_H diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h index b3d1a0d26a..0ca15ce5c5 100644 --- a/src/plugins/help/centralwidget.h +++ b/src/plugins/help/centralwidget.h @@ -59,11 +59,9 @@ QT_END_NAMESPACE namespace Help { namespace Internal { - class PrintHelper; - -} -} +} // namespace Internal +} // namespace Help QT_BEGIN_NAMESPACE diff --git a/src/plugins/help/contentstoolwindow.cpp b/src/plugins/help/contentstoolwindow.cpp index 2331e4ecc7..ccd540bfef 100644 --- a/src/plugins/help/contentstoolwindow.cpp +++ b/src/plugins/help/contentstoolwindow.cpp @@ -30,14 +30,15 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + +#include "contentstoolwindow.h" +#include "helpengine.h" + #include <QtCore/QDebug> #include <QtCore/QStack> #include <QtGui/QFocusEvent> #include <QtGui/QKeyEvent> -#include "contentstoolwindow.h" -#include "helpengine.h" - using namespace Help::Internal; ContentsToolWidget::ContentsToolWidget() diff --git a/src/plugins/help/contentstoolwindow.h b/src/plugins/help/contentstoolwindow.h index a7dd5f5d80..4c13827523 100644 --- a/src/plugins/help/contentstoolwindow.h +++ b/src/plugins/help/contentstoolwindow.h @@ -30,13 +30,14 @@ ** version 1.2, included in the file GPL_EXCEPTION.txt in this package. ** ***************************************************************************/ + #ifndef CONTENTSTOOLWINDOW_H #define CONTENTSTOOLWINDOW_H -#include <QtGui/QTreeWidget> - #include <coreplugin/iview.h> +#include <QtGui/QTreeWidget> + namespace Help { namespace Internal { @@ -96,7 +97,7 @@ private: ContentsToolWidget *m_widget; }; -} //namespace Internal -} //namespace Help +} // namespace Internal +} // namespace Help -#endif +#endif // CONTENTSTOOLWINDOW_H |