diff --git a/bridge.h b/bridge.h index 9b34fbde5..35efc9012 100644 --- a/bridge.h +++ b/bridge.h @@ -31,7 +31,7 @@ class Client; class Bridge : public KDecorationBridgeUnstable { public: - Bridge(Client* cl); + explicit Bridge(Client* cl); virtual bool isActive() const; virtual bool isCloseable() const; virtual bool isMaximizable() const; diff --git a/client.h b/client.h index e8ae850de..cd0cc47cd 100644 --- a/client.h +++ b/client.h @@ -281,7 +281,7 @@ class Client **/ Q_PROPERTY(bool decorationHasAlpha READ decorationHasAlpha) public: - Client(Workspace* ws); + explicit Client(Workspace* ws); Window wrapperId() const; Window decorationId() const; Window inputId() const { return input_window; } @@ -1002,7 +1002,7 @@ private: class GeometryUpdatesBlocker { public: - GeometryUpdatesBlocker(Client* c) + explicit GeometryUpdatesBlocker(Client* c) : cl(c) { cl->blockGeometryUpdates(true); } diff --git a/clients/aurorae/src/colorhelper.h b/clients/aurorae/src/colorhelper.h index ece5a512b..6282321ce 100644 --- a/clients/aurorae/src/colorhelper.h +++ b/clients/aurorae/src/colorhelper.h @@ -36,7 +36,7 @@ class ColorHelper : public QObject **/ Q_PROPERTY(qreal contrast READ contrast CONSTANT) public: - ColorHelper(QObject *parent = 0); + explicit ColorHelper(QObject *parent = 0); ~ColorHelper(); /** * This enumeration describes the color shade being selected from the given diff --git a/clients/aurorae/src/lib/auroraetheme.h b/clients/aurorae/src/lib/auroraetheme.h index 3705932b7..84415f290 100644 --- a/clients/aurorae/src/lib/auroraetheme.h +++ b/clients/aurorae/src/lib/auroraetheme.h @@ -110,7 +110,7 @@ class /*LIBAURORAE_EXPORT*/ AuroraeTheme : public QObject Q_PROPERTY(QString defaultButtonsLeft READ defaultButtonsLeft NOTIFY themeChanged) Q_PROPERTY(QString defaultButtonsRight READ defaultButtonsRight NOTIFY themeChanged) public: - AuroraeTheme(QObject* parent = 0); + explicit AuroraeTheme(QObject* parent = 0); virtual ~AuroraeTheme(); // TODO: KSharedConfigPtr void loadTheme(const QString &name, const KConfig &config); diff --git a/clients/b2/b2client.h b/clients/b2/b2client.h index c9e9b57c3..c50104b25 100644 --- a/clients/b2/b2client.h +++ b/clients/b2/b2client.h @@ -87,7 +87,7 @@ class B2Titlebar : public QWidget { friend class B2Client; public: - B2Titlebar(B2Client *parent); + explicit B2Titlebar(B2Client *parent); ~B2Titlebar(){;} bool isFullyObscured() const {return isfullyobscured;} void recalcBuffer(); diff --git a/clients/oxygen/config/oxygenconfigurationui.h b/clients/oxygen/config/oxygenconfigurationui.h index 772cce887..99879606d 100644 --- a/clients/oxygen/config/oxygenconfigurationui.h +++ b/clients/oxygen/config/oxygenconfigurationui.h @@ -49,7 +49,7 @@ namespace Oxygen public: //! constructor - ConfigurationUi( QWidget* ); + explicit ConfigurationUi( QWidget* ); //! destructor virtual ~ConfigurationUi( void ) diff --git a/clients/oxygen/config/oxygendetectwidget.h b/clients/oxygen/config/oxygendetectwidget.h index b5755641f..800196007 100644 --- a/clients/oxygen/config/oxygendetectwidget.h +++ b/clients/oxygen/config/oxygendetectwidget.h @@ -53,7 +53,7 @@ namespace Oxygen public: //! constructor - DetectDialog( QWidget* ); + explicit DetectDialog( QWidget* ); //! read window properties or select one from mouse grab void detect( WId window ); diff --git a/clients/oxygen/config/oxygenexceptiondialog.h b/clients/oxygen/config/oxygenexceptiondialog.h index 8ec6d8baa..b4d41771f 100644 --- a/clients/oxygen/config/oxygenexceptiondialog.h +++ b/clients/oxygen/config/oxygenexceptiondialog.h @@ -49,7 +49,7 @@ namespace Oxygen public: //! constructor - ExceptionDialog( QWidget* parent ); + explicit ExceptionDialog( QWidget* parent ); //! set exception void setException( Exception ); diff --git a/clients/oxygen/config/oxygenshadowconfigurationui.h b/clients/oxygen/config/oxygenshadowconfigurationui.h index f7e81c4d9..530e04cc4 100644 --- a/clients/oxygen/config/oxygenshadowconfigurationui.h +++ b/clients/oxygen/config/oxygenshadowconfigurationui.h @@ -40,7 +40,7 @@ namespace Oxygen public: //! constructor - ShadowConfigurationUi( QWidget* ); + explicit ShadowConfigurationUi( QWidget* ); Ui_ShadowConfiguraionUI ui; signals: diff --git a/clients/oxygen/oxygenclientgroupitemdata.h b/clients/oxygen/oxygenclientgroupitemdata.h index 76a6c0402..e4678ed99 100644 --- a/clients/oxygen/oxygenclientgroupitemdata.h +++ b/clients/oxygen/oxygenclientgroupitemdata.h @@ -109,7 +109,7 @@ namespace Oxygen enum { NoItem = -1 }; //! constructor - ClientGroupItemDataList( Client* parent ); + explicit ClientGroupItemDataList( Client* parent ); //! dirty state void setDirty( const bool& value ) diff --git a/clients/oxygen/oxygenconfiguration.h b/clients/oxygen/oxygenconfiguration.h index 52fd69028..2bc87a9d2 100644 --- a/clients/oxygen/oxygenconfiguration.h +++ b/clients/oxygen/oxygenconfiguration.h @@ -130,7 +130,7 @@ namespace Oxygen Configuration( void ); //! constructor from KConfig - Configuration( KConfigGroup ); + explicit Configuration( KConfigGroup ); //! destructor virtual ~Configuration( void ) diff --git a/clients/oxygen/oxygendecohelper.h b/clients/oxygen/oxygendecohelper.h index e86687254..cfad8bd0e 100644 --- a/clients/oxygen/oxygendecohelper.h +++ b/clients/oxygen/oxygendecohelper.h @@ -34,7 +34,7 @@ namespace Oxygen public: //! constructor - DecoHelper(const QByteArray &componentName); + explicit DecoHelper(const QByteArray &componentName); //! destructor virtual ~DecoHelper() diff --git a/clients/oxygen/oxygenexception.h b/clients/oxygen/oxygenexception.h index 22a700eea..422bd1c55 100644 --- a/clients/oxygen/oxygenexception.h +++ b/clients/oxygen/oxygenexception.h @@ -78,7 +78,7 @@ namespace Oxygen {} //! constructor - Exception( KConfigGroup ); + explicit Exception( KConfigGroup ); //! destructor virtual ~Exception( void ) diff --git a/clients/oxygen/oxygenexceptionlist.h b/clients/oxygen/oxygenexceptionlist.h index 640cc3b4a..a275031fb 100644 --- a/clients/oxygen/oxygenexceptionlist.h +++ b/clients/oxygen/oxygenexceptionlist.h @@ -46,7 +46,7 @@ namespace Oxygen {} //! default constructor - ExceptionList( const KConfig& config ) + explicit ExceptionList( const KConfig& config ) { read( config ); } //! read from KConfig diff --git a/clients/oxygen/oxygensizegrip.h b/clients/oxygen/oxygensizegrip.h index 5bfb22bac..20cf63a4e 100644 --- a/clients/oxygen/oxygensizegrip.h +++ b/clients/oxygen/oxygensizegrip.h @@ -43,7 +43,7 @@ namespace Oxygen public: //! constructor - SizeGrip( Client* ); + explicit SizeGrip( Client* ); //! constructor virtual ~SizeGrip( void ); diff --git a/clients/oxygen/oxygentitleanimationdata.h b/clients/oxygen/oxygentitleanimationdata.h index 4634577eb..050860d49 100644 --- a/clients/oxygen/oxygentitleanimationdata.h +++ b/clients/oxygen/oxygentitleanimationdata.h @@ -53,7 +53,7 @@ namespace Oxygen typedef QWeakPointer Pointer; //! constructor - TitleAnimationData( QObject* ); + explicit TitleAnimationData( QObject* ); //! reset void reset( void ) diff --git a/dbusinterface.h b/dbusinterface.h index d8e8cd350..7c28c7338 100644 --- a/dbusinterface.h +++ b/dbusinterface.h @@ -53,7 +53,7 @@ class DBusInterface: public QObject Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.KWin") public: - DBusInterface(QObject *parent); + explicit DBusInterface(QObject *parent); virtual ~DBusInterface(); public: // PROPERTIES diff --git a/effects.h b/effects.h index d985de4e4..1f0955072 100644 --- a/effects.h +++ b/effects.h @@ -243,7 +243,7 @@ class EffectWindowImpl : public EffectWindow { Q_OBJECT public: - EffectWindowImpl(Toplevel *toplevel); + explicit EffectWindowImpl(Toplevel *toplevel); virtual ~EffectWindowImpl(); virtual void enablePainting(int reason); @@ -295,7 +295,7 @@ class EffectWindowGroupImpl : public EffectWindowGroup { public: - EffectWindowGroupImpl(Group* g); + explicit EffectWindowGroupImpl(Group* g); virtual EffectWindowList members() const; private: Group* group; diff --git a/effects/boxswitch/boxswitch_proxy.h b/effects/boxswitch/boxswitch_proxy.h index eab863c0f..ad3d31239 100644 --- a/effects/boxswitch/boxswitch_proxy.h +++ b/effects/boxswitch/boxswitch_proxy.h @@ -31,7 +31,7 @@ class BoxSwitchEffect; class BoxSwitchEffectProxy { public: - BoxSwitchEffectProxy(BoxSwitchEffect* effect); + explicit BoxSwitchEffectProxy(BoxSwitchEffect* effect); ~BoxSwitchEffectProxy(); /** diff --git a/effects/cube/cube_proxy.h b/effects/cube/cube_proxy.h index f28b9a41e..0b758a69f 100644 --- a/effects/cube/cube_proxy.h +++ b/effects/cube/cube_proxy.h @@ -30,7 +30,7 @@ class CubeInsideEffect; class CubeEffectProxy { public: - CubeEffectProxy(CubeEffect* effect); + explicit CubeEffectProxy(CubeEffect* effect); ~CubeEffectProxy(); void registerCubeInsideEffect(CubeInsideEffect* effect); diff --git a/effects/desktopgrid/desktopgrid.h b/effects/desktopgrid/desktopgrid.h index 498e2fde4..f968fc183 100644 --- a/effects/desktopgrid/desktopgrid.h +++ b/effects/desktopgrid/desktopgrid.h @@ -43,7 +43,7 @@ class DesktopButtonsView : public QGraphicsView { Q_OBJECT public: - DesktopButtonsView(QWidget* parent = 0); + explicit DesktopButtonsView(QWidget* parent = 0); void windowInputMouseEvent(QMouseEvent* e); void setAddDesktopEnabled(bool enable); void setRemoveDesktopEnabled(bool enable); diff --git a/effects/presentwindows/presentwindows.h b/effects/presentwindows/presentwindows.h index e891715aa..61df300a9 100644 --- a/effects/presentwindows/presentwindows.h +++ b/effects/presentwindows/presentwindows.h @@ -42,7 +42,7 @@ class CloseWindowView : public QGraphicsView { Q_OBJECT public: - CloseWindowView(QWidget* parent = 0); + explicit CloseWindowView(QWidget* parent = 0); void windowInputMouseEvent(QMouseEvent* e); virtual void drawBackground(QPainter* painter, const QRectF& rect); diff --git a/effects/presentwindows/presentwindows_proxy.h b/effects/presentwindows/presentwindows_proxy.h index efcd81ffe..1381f3040 100644 --- a/effects/presentwindows/presentwindows_proxy.h +++ b/effects/presentwindows/presentwindows_proxy.h @@ -30,7 +30,7 @@ class PresentWindowsEffect; class PresentWindowsEffectProxy { public: - PresentWindowsEffectProxy(PresentWindowsEffect* effect); + explicit PresentWindowsEffectProxy(PresentWindowsEffect* effect); ~PresentWindowsEffectProxy(); void calculateWindowTransformations(EffectWindowList windows, int screen, WindowMotionManager& manager); diff --git a/kcmkwin/kwindecoration/buttons.h b/kcmkwin/kwindecoration/buttons.h index 1eaa298ef..f81490c16 100644 --- a/kcmkwin/kwindecoration/buttons.h +++ b/kcmkwin/kwindecoration/buttons.h @@ -61,7 +61,7 @@ public: class ButtonDrag : public QMimeData { public: - ButtonDrag(Button btn); + explicit ButtonDrag(Button btn); ~ButtonDrag() {} static bool canDecode(QDropEvent* e); @@ -74,7 +74,7 @@ public: class ButtonDropSiteItem { public: - ButtonDropSiteItem(const Button& btn); + explicit ButtonDropSiteItem(const Button& btn); ~ButtonDropSiteItem(); Button button(); @@ -112,7 +112,7 @@ class ButtonSource : public QListWidget Q_OBJECT public: - ButtonSource(QWidget *parent = 0); + explicit ButtonSource(QWidget *parent = 0); virtual ~ButtonSource(); QSize sizeHint() const; diff --git a/kcmkwin/kwindecoration/decorationmodel.h b/kcmkwin/kwindecoration/decorationmodel.h index efc6d7ad7..de324c4ba 100644 --- a/kcmkwin/kwindecoration/decorationmodel.h +++ b/kcmkwin/kwindecoration/decorationmodel.h @@ -90,7 +90,7 @@ public: QmlMainScriptRole = Qt::UserRole + 14, CloseOnDblClickRole = Qt::UserRole + 15 }; - DecorationModel(KSharedConfigPtr config, QObject* parent = 0); + explicit DecorationModel(KSharedConfigPtr config, QObject* parent = 0); ~DecorationModel(); virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; diff --git a/kcmkwin/kwindecoration/preview.h b/kcmkwin/kwindecoration/preview.h index 72cf7c144..ce7508882 100644 --- a/kcmkwin/kwindecoration/preview.h +++ b/kcmkwin/kwindecoration/preview.h @@ -45,7 +45,7 @@ public: // and an inactive window. enum Windows { Inactive = 0, Active, NumWindows }; - KDecorationPreview(QWidget* parent = NULL); + explicit KDecorationPreview(QWidget* parent = NULL); virtual ~KDecorationPreview(); bool recreateDecoration(KDecorationPlugins* plugin); void enablePreview(); @@ -166,7 +166,7 @@ class KDecorationPreviewPlugins : public KDecorationPlugins { public: - KDecorationPreviewPlugins(const KSharedConfigPtr &cfg); + explicit KDecorationPreviewPlugins(const KSharedConfigPtr &cfg); virtual bool provides(Requirement); }; diff --git a/kcmkwin/kwindesktop/desktopnameswidget.h b/kcmkwin/kwindesktop/desktopnameswidget.h index fccf0663e..e69861c06 100644 --- a/kcmkwin/kwindesktop/desktopnameswidget.h +++ b/kcmkwin/kwindesktop/desktopnameswidget.h @@ -36,7 +36,7 @@ class DesktopNamesWidget : public QWidget { Q_OBJECT public: - DesktopNamesWidget(QWidget *parent); + explicit DesktopNamesWidget(QWidget *parent); ~DesktopNamesWidget(); QString name(int desktop); void setName(int desktop, QString desktopName); diff --git a/kcmkwin/kwinrules/ruleslist.h b/kcmkwin/kwinrules/ruleslist.h index b49f2594d..b7187837b 100644 --- a/kcmkwin/kwinrules/ruleslist.h +++ b/kcmkwin/kwinrules/ruleslist.h @@ -32,7 +32,7 @@ class KCMRulesList { Q_OBJECT public: - KCMRulesList(QWidget* parent = NULL); + explicit KCMRulesList(QWidget* parent = NULL); virtual ~KCMRulesList(); void load(); void save(); diff --git a/kcmkwin/kwinrules/ruleswidget.h b/kcmkwin/kwinrules/ruleswidget.h index a4b5b9133..585c4fede 100644 --- a/kcmkwin/kwinrules/ruleswidget.h +++ b/kcmkwin/kwinrules/ruleswidget.h @@ -38,7 +38,7 @@ class RulesWidget { Q_OBJECT public: - RulesWidget(QWidget* parent = NULL); + explicit RulesWidget(QWidget* parent = NULL); void setRules(Rules* r); Rules* rules() const; bool finalCheck(); @@ -125,7 +125,7 @@ class EditShortcut { Q_OBJECT public: - EditShortcut(QWidget* parent = NULL); + explicit EditShortcut(QWidget* parent = NULL); protected slots: void editShortcut(); void clearShortcut(); diff --git a/kcmkwin/kwinrules/yesnobox.h b/kcmkwin/kwinrules/yesnobox.h index cc226e3fa..d49538b1e 100644 --- a/kcmkwin/kwinrules/yesnobox.h +++ b/kcmkwin/kwinrules/yesnobox.h @@ -28,7 +28,7 @@ class YesNoBox : public QWidget { Q_OBJECT public: - YesNoBox( QWidget *parent ) : QWidget(parent) + explicit YesNoBox( QWidget *parent ) : QWidget(parent) { QHBoxLayout *l = new QHBoxLayout(this); l->setContentsMargins(0, 0, 0, 0); diff --git a/kcmkwin/kwinscreenedges/monitor.h b/kcmkwin/kwinscreenedges/monitor.h index bf0392eff..68aa87fa9 100644 --- a/kcmkwin/kwinscreenedges/monitor.h +++ b/kcmkwin/kwinscreenedges/monitor.h @@ -46,7 +46,7 @@ class Monitor { Q_OBJECT public: - Monitor(QWidget* parent); + explicit Monitor(QWidget* parent); void setEdge(int edge, bool set); bool edge(int edge) const; void setEdgeHidden(int edge, bool set); diff --git a/kcmkwin/kwinscripts/module.h b/kcmkwin/kwinscripts/module.h index f2e195cd9..1a6550ae6 100644 --- a/kcmkwin/kwinscripts/module.h +++ b/kcmkwin/kwinscripts/module.h @@ -37,7 +37,7 @@ public: * @param parent Parent widget of the module * @param args Arguments for the module */ - Module(QWidget *parent, const QVariantList &args = QVariantList()); + explicit Module(QWidget *parent, const QVariantList &args = QVariantList()); /** * Destructor. diff --git a/kcmkwin/kwintabbox/layoutpreview.h b/kcmkwin/kwintabbox/layoutpreview.h index 1eee65aa7..220c5a35f 100644 --- a/kcmkwin/kwintabbox/layoutpreview.h +++ b/kcmkwin/kwintabbox/layoutpreview.h @@ -34,7 +34,7 @@ class LayoutPreview : public QDeclarativeView { Q_OBJECT public: - LayoutPreview(QWidget *parent = NULL); + explicit LayoutPreview(QWidget *parent = NULL); virtual ~LayoutPreview(); void setLayout(const QString &path, const QString &name); @@ -43,7 +43,7 @@ public: class TabBoxImageProvider : public QDeclarativeImageProvider { public: - TabBoxImageProvider(QAbstractListModel *model); + explicit TabBoxImageProvider(QAbstractListModel *model); virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize); private: QAbstractListModel *m_model; @@ -53,7 +53,7 @@ class ExampleClientModel : public QAbstractListModel { Q_OBJECT public: - ExampleClientModel(QObject *parent = NULL); + explicit ExampleClientModel(QObject *parent = NULL); virtual ~ExampleClientModel(); virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; diff --git a/kcmkwin/kwintabbox/thumbnailitem.h b/kcmkwin/kwintabbox/thumbnailitem.h index 04977d6d6..eeff90907 100644 --- a/kcmkwin/kwintabbox/thumbnailitem.h +++ b/kcmkwin/kwintabbox/thumbnailitem.h @@ -31,7 +31,7 @@ class ThumbnailItem : public QDeclarativeItem Q_OBJECT Q_PROPERTY(qulonglong wId READ wId WRITE setWId NOTIFY wIdChanged SCRIPTABLE true) public: - ThumbnailItem(QDeclarativeItem *parent = 0); + explicit ThumbnailItem(QDeclarativeItem *parent = 0); virtual ~ThumbnailItem(); qulonglong wId() const { diff --git a/lanczosfilter.h b/lanczosfilter.h index 07d67b0e8..39c686d01 100644 --- a/lanczosfilter.h +++ b/lanczosfilter.h @@ -46,7 +46,7 @@ class LanczosFilter Q_OBJECT public: - LanczosFilter(QObject* parent = 0); + explicit LanczosFilter(QObject* parent = 0); ~LanczosFilter(); void performPaint(EffectWindowImpl* w, int mask, QRegion region, WindowPaintData& data); diff --git a/libkdecorations/kdecoration_plugins_p.h b/libkdecorations/kdecoration_plugins_p.h index e23e33206..87ce51931 100644 --- a/libkdecorations/kdecoration_plugins_p.h +++ b/libkdecorations/kdecoration_plugins_p.h @@ -46,7 +46,7 @@ class KWIN_EXPORT KDecorationPlugins : public KDecorationProvides { public: - KDecorationPlugins(const KSharedConfigPtr &cfg); + explicit KDecorationPlugins(const KSharedConfigPtr &cfg); virtual ~KDecorationPlugins(); /** Whether the plugin with @p name can be loaded * if @p loadedLib is passed, the library is NOT unloaded and freed diff --git a/libkwineffects/anidata_p.h b/libkwineffects/anidata_p.h index df4e088b5..a0c450bc0 100644 --- a/libkwineffects/anidata_p.h +++ b/libkwineffects/anidata_p.h @@ -33,7 +33,7 @@ public: AniData(AnimationEffect::Attribute a, int meta, int ms, const FPx2 &to, QEasingCurve curve, int delay, const FPx2 &from, bool waitAtSource ); AniData(const AniData &other); - AniData(const QString &str); + explicit AniData(const QString &str); inline void addTime(int t) { time += t; } inline bool isOneDimensional() const { return from[0] == from[1] && to[0] == to[1]; diff --git a/libkwineffects/kwinanimationeffect.h b/libkwineffects/kwinanimationeffect.h index 76a5b9b50..d7b672205 100644 --- a/libkwineffects/kwinanimationeffect.h +++ b/libkwineffects/kwinanimationeffect.h @@ -33,13 +33,13 @@ namespace KWin class KWIN_EXPORT FPx2 { public: FPx2() { f[0] = f[1] = 0.0; valid = false; } - FPx2(float v) { f[0] = f[1] = v; valid = true; } + explicit FPx2(float v) { f[0] = f[1] = v; valid = true; } FPx2(float v1, float v2) { f[0] = v1; f[1] = v2; valid = true; } FPx2(const FPx2 &other) { f[0] = other.f[0]; f[1] = other.f[1]; valid = other.valid; } - FPx2(const QPoint &other) { f[0] = other.x(); f[1] = other.y(); valid = true; } - FPx2(const QPointF &other) { f[0] = other.x(); f[1] = other.y(); valid = true; } - FPx2(const QSize &other) { f[0] = other.width(); f[1] = other.height(); valid = true; } - FPx2(const QSizeF &other) { f[0] = other.width(); f[1] = other.height(); valid = true; } + explicit FPx2(const QPoint &other) { f[0] = other.x(); f[1] = other.y(); valid = true; } + explicit FPx2(const QPointF &other) { f[0] = other.x(); f[1] = other.y(); valid = true; } + explicit FPx2(const QSize &other) { f[0] = other.width(); f[1] = other.height(); valid = true; } + explicit FPx2(const QSizeF &other) { f[0] = other.width(); f[1] = other.height(); valid = true; } inline void invalidate() { valid = false; } inline bool isValid() const { return valid; } inline float operator[](int n) const { return f[n]; } diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 6aea85d20..aa5d9e8b6 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -618,7 +618,7 @@ class KWIN_EXPORT EffectsHandler : public QObject Q_PROPERTY(QPoint cursorPos READ cursorPos) friend class Effect; public: - EffectsHandler(CompositingType type); + explicit EffectsHandler(CompositingType type); virtual ~EffectsHandler(); // for use by effects virtual void prePaintScreen(ScreenPrePaintData& data, int time) = 0; @@ -1348,7 +1348,7 @@ public: PAINT_DISABLED_BY_ACTIVITY = 1 << 5 }; - EffectWindow(QObject *parent = NULL); + explicit EffectWindow(QObject *parent = NULL); virtual ~EffectWindow(); virtual void enablePainting(int reason) = 0; @@ -1565,7 +1565,7 @@ public: class KWIN_EXPORT GlobalShortcutsEditor : public KShortcutsEditor { public: - GlobalShortcutsEditor(QWidget *parent); + explicit GlobalShortcutsEditor(QWidget *parent); }; /** @@ -1834,7 +1834,7 @@ private: class KWIN_EXPORT WindowPaintData : public PaintData { public: - WindowPaintData(EffectWindow* w); + explicit WindowPaintData(EffectWindow* w); WindowPaintData(const WindowPaintData &other); virtual ~WindowPaintData(); /** @@ -2047,7 +2047,7 @@ public: /** * Calls push(). */ - PaintClipper(const QRegion& allowed_area); + explicit PaintClipper(const QRegion& allowed_area); /** * Calls pop(). */ diff --git a/libkwineffects/kwingltexture.h b/libkwineffects/kwingltexture.h index a18dc9431..7a9df7277 100644 --- a/libkwineffects/kwingltexture.h +++ b/libkwineffects/kwingltexture.h @@ -47,7 +47,7 @@ public: GLTexture(const GLTexture& tex); explicit GLTexture(const QImage& image, GLenum target = GL_TEXTURE_2D); explicit GLTexture(const QPixmap& pixmap, GLenum target = GL_TEXTURE_2D); - GLTexture(const QString& fileName); + explicit GLTexture(const QString& fileName); GLTexture(int width, int height); virtual ~GLTexture(); diff --git a/libkwineffects/kwinglutils.h b/libkwineffects/kwinglutils.h index ab82068a3..f68094398 100644 --- a/libkwineffects/kwinglutils.h +++ b/libkwineffects/kwinglutils.h @@ -424,14 +424,14 @@ public: * @param reset Whether all uniforms should be reset to their default values. Defaults to false. * @see ShaderManager::pushShader **/ - ShaderBinder(ShaderManager::ShaderType type, bool reset = false); + explicit ShaderBinder(ShaderManager::ShaderType type, bool reset = false); /** * @brief Pushes the given @p shader to the ShaderManager's stack. * * @param shader The Shader to push on the stack * @see ShaderManager::pushShader **/ - ShaderBinder(GLShader *shader); + explicit ShaderBinder(GLShader *shader); ~ShaderBinder(); /** @@ -499,7 +499,7 @@ public: * Constructs a GLRenderTarget * @param color texture where the scene will be rendered onto **/ - GLRenderTarget(const GLTexture& color); + explicit GLRenderTarget(const GLTexture& color); ~GLRenderTarget(); /** @@ -596,7 +596,7 @@ public: Stream ///< Data only used once for rendering, updated very frequently }; - GLVertexBuffer(UsageHint hint); + explicit GLVertexBuffer(UsageHint hint); ~GLVertexBuffer(); /** diff --git a/libkwineffects/kwinxrenderutils.cpp b/libkwineffects/kwinxrenderutils.cpp index b6350454b..835240a23 100644 --- a/libkwineffects/kwinxrenderutils.cpp +++ b/libkwineffects/kwinxrenderutils.cpp @@ -84,7 +84,7 @@ XRenderPicture xRenderFill(const QColor &c) return xRenderFill(&xc); } -static XRenderPicture _blendPicture = X::None; +static XRenderPicture _blendPicture(X::None); static XRenderColor _blendColor; XRenderPicture xRenderBlendPicture(double opacity) { diff --git a/libkwineffects/kwinxrenderutils.h b/libkwineffects/kwinxrenderutils.h index f564002ae..5b7a95326 100644 --- a/libkwineffects/kwinxrenderutils.h +++ b/libkwineffects/kwinxrenderutils.h @@ -58,7 +58,7 @@ class KWIN_EXPORT XRenderPictureData : public QSharedData { public: - XRenderPictureData(Picture pic = None); + explicit XRenderPictureData(Picture pic = None); ~XRenderPictureData(); Picture value(); private: @@ -76,8 +76,8 @@ private: class KWIN_EXPORT XRenderPicture { public: - XRenderPicture(Picture pic = None); - XRenderPicture(QPixmap pix); + explicit XRenderPicture(Picture pic = None); + explicit XRenderPicture(QPixmap pix); XRenderPicture(Pixmap pix, int depth); operator Picture(); private: diff --git a/options.h b/options.h index f9f623f34..87917f917 100644 --- a/options.h +++ b/options.h @@ -206,7 +206,7 @@ class Options : public QObject, public KDecorationOptions Q_PROPERTY(bool glLegacy READ isGlLegacy WRITE setGlLegacy NOTIFY glLegacyChanged) public: - Options(QObject *parent = NULL); + explicit Options(QObject *parent = NULL); ~Options(); virtual unsigned long updateSettings(); diff --git a/rules.h b/rules.h index 418311efc..8be58f79e 100644 --- a/rules.h +++ b/rules.h @@ -46,7 +46,7 @@ class WindowRules : public KDecorationDefines { public: - WindowRules(const QVector< Rules* >& rules); + explicit WindowRules(const QVector< Rules* >& rules); WindowRules(); void update(Client*, int selection); void discardTemporary(); @@ -99,7 +99,7 @@ class Rules { public: Rules(); - Rules(const KConfigGroup&); + explicit Rules(const KConfigGroup&); Rules(const QString&, bool temporary); enum Type { Position = 1<<0, Size = 1<<1, Desktop = 1<<2, diff --git a/scene.h b/scene.h index 1b1706601..f06d150a6 100644 --- a/scene.h +++ b/scene.h @@ -40,7 +40,7 @@ class Scene : public QObject { Q_OBJECT public: - Scene(Workspace* ws); + explicit Scene(Workspace* ws); virtual ~Scene() = 0; class EffectFrame; class Window; diff --git a/scene_opengl.h b/scene_opengl.h index e6142c0c2..878c26f39 100644 --- a/scene_opengl.h +++ b/scene_opengl.h @@ -88,7 +88,7 @@ class SceneOpenGL2 : public SceneOpenGL { Q_OBJECT public: - SceneOpenGL2(OpenGLBackend *backend); + explicit SceneOpenGL2(OpenGLBackend *backend); virtual ~SceneOpenGL2(); virtual CompositingType compositingType() const { return OpenGL2Compositing; @@ -119,7 +119,7 @@ private: class SceneOpenGL1 : public SceneOpenGL { public: - SceneOpenGL1(OpenGLBackend *backend); + explicit SceneOpenGL1(OpenGLBackend *backend); virtual ~SceneOpenGL1(); virtual void screenGeometryChanged(const QSize &size); virtual int paint(QRegion damage, ToplevelList windows); @@ -280,7 +280,7 @@ private: class SceneOpenGL2Window : public SceneOpenGL::Window { public: - SceneOpenGL2Window(Toplevel *c); + explicit SceneOpenGL2Window(Toplevel *c); virtual ~SceneOpenGL2Window(); protected: @@ -300,7 +300,7 @@ private: class SceneOpenGL1Window : public SceneOpenGL::Window { public: - SceneOpenGL1Window(Toplevel *c); + explicit SceneOpenGL1Window(Toplevel *c); virtual ~SceneOpenGL1Window(); protected: @@ -359,7 +359,7 @@ class SceneOpenGLShadow : public Shadow { public: - SceneOpenGLShadow(Toplevel *toplevel); + explicit SceneOpenGLShadow(Toplevel *toplevel); virtual ~SceneOpenGLShadow(); GLTexture *shadowTexture() { diff --git a/scene_xrender.h b/scene_xrender.h index 645700f58..cfcb81416 100644 --- a/scene_xrender.h +++ b/scene_xrender.h @@ -38,7 +38,7 @@ class SceneXrender Q_OBJECT public: class EffectFrame; - SceneXrender(Workspace* ws); + explicit SceneXrender(Workspace* ws); virtual ~SceneXrender(); virtual bool initFailed() const; virtual CompositingType compositingType() const { @@ -153,7 +153,7 @@ class SceneXRenderShadow : public Shadow { public: - SceneXRenderShadow(Toplevel *toplevel); + explicit SceneXRenderShadow(Toplevel *toplevel); using Shadow::ShadowElements; using Shadow::ShadowElementTop; using Shadow::ShadowElementTopRight; diff --git a/scripting/scripting.h b/scripting/scripting.h index 12645658c..077fe667d 100644 --- a/scripting/scripting.h +++ b/scripting/scripting.h @@ -257,7 +257,7 @@ private: class ScriptUnloaderAgent : public QScriptEngineAgent { public: - ScriptUnloaderAgent(Script *script); + explicit ScriptUnloaderAgent(Script *script); virtual void scriptUnload(qint64 id); private: @@ -298,7 +298,7 @@ private: void runScripts(); public: - Scripting(QObject *parent = NULL); + explicit Scripting(QObject *parent = NULL); ~Scripting(); Q_SCRIPTABLE Q_INVOKABLE int loadScript(const QString &filePath, const QString &pluginName = QString()); Q_SCRIPTABLE Q_INVOKABLE int loadDeclarativeScript(const QString &filePath, const QString &pluginName = QString()); diff --git a/scripting/workspace_wrapper.h b/scripting/workspace_wrapper.h index 556994cb0..56648ef27 100644 --- a/scripting/workspace_wrapper.h +++ b/scripting/workspace_wrapper.h @@ -163,7 +163,7 @@ public: ElectricNone }; - WorkspaceWrapper(QObject* parent = 0); + explicit WorkspaceWrapper(QObject* parent = 0); #define GETTERSETTERDEF( rettype, getter, setter ) \ rettype getter() const; \ void setter( rettype val ); diff --git a/tabbox/clientmodel.h b/tabbox/clientmodel.h index bc737c9a1..21bf4f226 100644 --- a/tabbox/clientmodel.h +++ b/tabbox/clientmodel.h @@ -57,7 +57,7 @@ public: MinimizedRole = Qt::UserRole + 6, ///< TabBoxClient is minimized CloseableRole = Qt::UserRole + 7 ///< TabBoxClient can be closed }; - ClientModel(QObject* parent = 0); + explicit ClientModel(QObject* parent = 0); ~ClientModel(); virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; virtual int columnCount(const QModelIndex& parent = QModelIndex()) const; diff --git a/tabbox/declarative.h b/tabbox/declarative.h index 3b4d126e5..e36e67bf7 100644 --- a/tabbox/declarative.h +++ b/tabbox/declarative.h @@ -42,7 +42,7 @@ namespace TabBox class ImageProvider : public QDeclarativeImageProvider { public: - ImageProvider(QAbstractItemModel *model); + explicit ImageProvider(QAbstractItemModel *model); virtual QPixmap requestPixmap(const QString &id, QSize *size, const QSize &requestedSize); private: diff --git a/tabbox/desktopmodel.h b/tabbox/desktopmodel.h index 52d8bf4aa..f172c6e1d 100644 --- a/tabbox/desktopmodel.h +++ b/tabbox/desktopmodel.h @@ -51,7 +51,7 @@ public: DesktopNameRole = Qt::UserRole + 1, ///< Desktop name ClientModelRole = Qt::UserRole + 2 ///< Clients on this desktop }; - DesktopModel(QObject* parent = 0); + explicit DesktopModel(QObject* parent = 0); ~DesktopModel(); virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const; diff --git a/tabbox/tabbox.h b/tabbox/tabbox.h index bba0b39b7..73d83df40 100644 --- a/tabbox/tabbox.h +++ b/tabbox/tabbox.h @@ -42,7 +42,7 @@ class TabBox; class TabBoxHandlerImpl : public TabBoxHandler { public: - TabBoxHandlerImpl(TabBox* tabBox); + explicit TabBoxHandlerImpl(TabBox* tabBox); virtual ~TabBoxHandlerImpl(); virtual int activeScreen() const; @@ -79,7 +79,7 @@ private: class TabBoxClientImpl : public TabBoxClient { public: - TabBoxClientImpl(Client *client); + explicit TabBoxClientImpl(Client *client); virtual ~TabBoxClientImpl(); virtual QString caption() const; @@ -107,7 +107,7 @@ class TabBox : public QObject Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.kde.kwin") public: - TabBox(QObject *parent = NULL); + explicit TabBox(QObject *parent = NULL); ~TabBox(); Client* currentClient(); diff --git a/tabgroup.h b/tabgroup.h index 96329b1fa..5c4b6d124 100644 --- a/tabgroup.h +++ b/tabgroup.h @@ -53,7 +53,7 @@ public: /** * Creates a new group containing \p c. */ - TabGroup(Client* c); + explicit TabGroup(Client* c); ~TabGroup(); enum State { diff --git a/thumbnailitem.h b/thumbnailitem.h index a219a33d1..401cb3809 100644 --- a/thumbnailitem.h +++ b/thumbnailitem.h @@ -37,7 +37,7 @@ class ThumbnailItem : public QDeclarativeItem Q_PROPERTY(bool clip READ isClip WRITE setClip NOTIFY clipChanged SCRIPTABLE true) Q_PROPERTY(qulonglong parentWindow READ parentWindow WRITE setParentWindow) public: - ThumbnailItem(QDeclarativeItem *parent = 0); + explicit ThumbnailItem(QDeclarativeItem *parent = 0); virtual ~ThumbnailItem(); qulonglong wId() const { diff --git a/tools/decobenchmark/preview.h b/tools/decobenchmark/preview.h index 5ce3b22c8..358d99bb8 100644 --- a/tools/decobenchmark/preview.h +++ b/tools/decobenchmark/preview.h @@ -123,7 +123,7 @@ class KDecorationPreviewPlugins : public KDecorationPlugins { public: - KDecorationPreviewPlugins(KConfig* cfg); + explicit KDecorationPreviewPlugins(KConfig* cfg); virtual bool provides(Requirement); }; diff --git a/toplevel.h b/toplevel.h index a8c76977d..869da5636 100644 --- a/toplevel.h +++ b/toplevel.h @@ -165,7 +165,7 @@ class Toplevel **/ Q_PROPERTY(bool shaped READ shape NOTIFY shapedChanged) public: - Toplevel(Workspace *ws); + explicit Toplevel(Workspace *ws); Window frameId() const; Window window() const; Workspace* workspace() const; diff --git a/unmanaged.h b/unmanaged.h index 851d7712c..8362cf8eb 100644 --- a/unmanaged.h +++ b/unmanaged.h @@ -33,7 +33,7 @@ class Unmanaged { Q_OBJECT public: - Unmanaged(Workspace *ws); + explicit Unmanaged(Workspace *ws); bool windowEvent(XEvent* e); void release(bool on_shutdown = false); bool track(Window w); diff --git a/utils.h b/utils.h index 5b68d57a4..e0e565248 100644 --- a/utils.h +++ b/utils.h @@ -215,7 +215,7 @@ class KWinSelectionOwner { Q_OBJECT public: - KWinSelectionOwner(int screen); + explicit KWinSelectionOwner(int screen); protected: virtual bool genericReply(Atom target, Atom property, Window requestor); virtual void replyTargets(Atom property, Window requestor); @@ -383,7 +383,7 @@ class ShortcutDialog { Q_OBJECT public: - ShortcutDialog(const QKeySequence& cut); + explicit ShortcutDialog(const QKeySequence& cut); virtual void accept(); QKeySequence shortcut() const; public Q_SLOTS: diff --git a/workspace.h b/workspace.h index 84163347d..3efc24017 100644 --- a/workspace.h +++ b/workspace.h @@ -83,7 +83,7 @@ class Workspace : public QObject, public KDecorationDefines { Q_OBJECT public: - Workspace(bool restore = false); + explicit Workspace(bool restore = false); virtual ~Workspace(); static Workspace* self() { @@ -860,7 +860,7 @@ private: class StackingUpdatesBlocker { public: - StackingUpdatesBlocker(Workspace* w) + explicit StackingUpdatesBlocker(Workspace* w) : ws(w) { ws->blockStackingUpdates(true); }