-rw-r--r-- | noncore/decorations/flat/flat.cpp | 4 | ||||
-rw-r--r-- | noncore/decorations/flat/flat.h | 1 | ||||
-rw-r--r-- | noncore/decorations/liquid/liquid.cpp | 4 | ||||
-rw-r--r-- | noncore/decorations/liquid/liquid.h | 2 | ||||
-rw-r--r-- | noncore/decorations/polished/polished.cpp | 4 | ||||
-rw-r--r-- | noncore/decorations/polished/polished.h | 2 |
6 files changed, 9 insertions, 8 deletions
diff --git a/noncore/decorations/flat/flat.cpp b/noncore/decorations/flat/flat.cpp index b6a81a3..a2f12be 100644 --- a/noncore/decorations/flat/flat.cpp +++ b/noncore/decorations/flat/flat.cpp @@ -191,25 +191,25 @@ static QImage scaleButton( const QImage &img, int height ) } } static void colorize( QImage &img, const QColor &c, bool rev ) { for ( int i = 0; i < img.numColors(); i++ ) { bool sc = (img.color(i) & 0xff000000); if ( rev ) sc = !sc; img.setColor(i, sc ? c.rgb() : 0x00000000 ); } } -FlatDecoration::FlatDecoration() : ref(0), buttonCache(16) +FlatDecoration::FlatDecoration() : buttonCache(16) { buttonCache.setAutoDelete(TRUE); } FlatDecoration::~FlatDecoration() { } int FlatDecoration::metric( Metric m, const WindowData *wd ) const { switch ( m ) { case TopBorder: @@ -338,23 +338,25 @@ QString FlatDecoration::name() const QPixmap FlatDecoration::icon() const { return QPixmap(); } QRESULT FlatDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( uuid == IID_QUnknown ) *iface = this; else if ( uuid == IID_WindowDecoration ) *iface = this; + else + return QS_FALSE; if ( *iface ) (*iface)->addRef(); return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( FlatDecoration ) } diff --git a/noncore/decorations/flat/flat.h b/noncore/decorations/flat/flat.h index 3d8a18b..96ceb1f 100644 --- a/noncore/decorations/flat/flat.h +++ b/noncore/decorations/flat/flat.h @@ -33,17 +33,16 @@ public: virtual int metric( Metric m, const WindowData * ) const; virtual void drawArea( Area a, QPainter *, const WindowData * ) const; virtual void drawButton( Button b, QPainter *, const WindowData *, int x, int y, int w, int h, QWSButton::State ) const; virtual QRegion mask( const WindowData * ) const; virtual QString name() const; virtual QPixmap icon() const; QRESULT queryInterface( const QUuid&, QUnknownInterface** ); Q_REFCOUNT private: - ulong ref; QCache<QImage> buttonCache; }; #endif diff --git a/noncore/decorations/liquid/liquid.cpp b/noncore/decorations/liquid/liquid.cpp index 75b1fc9..ef2ac3c 100644 --- a/noncore/decorations/liquid/liquid.cpp +++ b/noncore/decorations/liquid/liquid.cpp @@ -1,21 +1,21 @@ #include "liquid.h" #include <qapplication.h> #include <qpainter.h> #include <qpalette.h> #include <qdrawutil.h> -LiquidDecoInterface::LiquidDecoInterface ( ) : ref ( 0 ) +LiquidDecoInterface::LiquidDecoInterface ( ) { } LiquidDecoInterface::~LiquidDecoInterface ( ) { } QString LiquidDecoInterface::name ( ) const { return qApp-> translate ( "Decoration", "Liquid" ); @@ -113,24 +113,26 @@ void LiquidDecoInterface::drawArea( Area a, QPainter *p, const WindowData *wd ) } } } QRESULT LiquidDecoInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( uuid == IID_QUnknown ) *iface = this; else if ( uuid == IID_WindowDecoration ) *iface = this; + else + return QS_FALSE; if ( *iface ) (*iface)-> addRef ( ); return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( LiquidDecoInterface ) } diff --git a/noncore/decorations/liquid/liquid.h b/noncore/decorations/liquid/liquid.h index ec55132..bbe433e 100644 --- a/noncore/decorations/liquid/liquid.h +++ b/noncore/decorations/liquid/liquid.h @@ -9,17 +9,15 @@ class LiquidDecoInterface : public WindowDecorationInterface { public: LiquidDecoInterface ( ); virtual ~LiquidDecoInterface ( ); QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); Q_REFCOUNT virtual void drawArea( Area a, QPainter *, const WindowData * ) const; virtual QString name ( ) const; virtual QPixmap icon ( ) const; -private: - ulong ref; }; #endif diff --git a/noncore/decorations/polished/polished.cpp b/noncore/decorations/polished/polished.cpp index 30f1a84..43179be 100644 --- a/noncore/decorations/polished/polished.cpp +++ b/noncore/decorations/polished/polished.cpp @@ -13,25 +13,25 @@ ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "polished.h" #include <qpainter.h> #include <qapplication.h> -PolishedDecoration::PolishedDecoration() : ref(0) +PolishedDecoration::PolishedDecoration() { } PolishedDecoration::~PolishedDecoration() { } int PolishedDecoration::metric( Metric m, const WindowData *wd ) const { switch ( m ) { case TopBorder: return 1; @@ -149,23 +149,25 @@ void PolishedDecoration::drawBlend( QPainter *p, const QRect &r, const QColor &c v1 + ((v2-v1)*j)/(r.height()-split-1), QColor::Hsv ) ); p->drawLine( r.x(), r.bottom()-j, r.right(), r.bottom()-j ); } } QRESULT PolishedDecoration::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { *iface = 0; if ( uuid == IID_QUnknown ) *iface = this; else if ( uuid == IID_WindowDecoration ) *iface = this; + else + return QS_FALSE; if ( *iface ) (*iface)->addRef(); return QS_OK; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( PolishedDecoration ) } diff --git a/noncore/decorations/polished/polished.h b/noncore/decorations/polished/polished.h index e5c19c0..d661427 100644 --- a/noncore/decorations/polished/polished.h +++ b/noncore/decorations/polished/polished.h @@ -33,17 +33,15 @@ public: virtual void drawArea( Area a, QPainter *, const WindowData * ) const; virtual void drawButton( Button b, QPainter *, const WindowData *, int x, int y, int w, int h, QWSButton::State ) const; virtual QRegion mask( const WindowData * ) const; virtual QString name() const; virtual QPixmap icon() const; QRESULT queryInterface( const QUuid&, QUnknownInterface** ); Q_REFCOUNT protected: void PolishedDecoration::drawBlend( QPainter *, const QRect &r, const QColor &c1, const QColor&c2 ) const; -private: - ulong ref; }; #endif |