summaryrefslogtreecommitdiff
path: root/noncore/styles/theme
Side-by-side diff
Diffstat (limited to 'noncore/styles/theme') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/theme/plugin.cpp80
-rw-r--r--noncore/styles/theme/plugin.h23
2 files changed, 30 insertions, 73 deletions
diff --git a/noncore/styles/theme/plugin.cpp b/noncore/styles/theme/plugin.cpp
index 4383693..2560720 100644
--- a/noncore/styles/theme/plugin.cpp
+++ b/noncore/styles/theme/plugin.cpp
@@ -1,3 +1,5 @@
+#include <qapplication.h>
+
#include "othemestyle.h"
#include "themeset.h"
#include "plugin.h"
@@ -6,82 +8,41 @@
ThemeInterface::ThemeInterface ( ) : ref ( 0 )
{
+ m_widget = 0;
}
ThemeInterface::~ThemeInterface ( )
{
}
-QStyle *ThemeInterface::create ( )
+QStyle *ThemeInterface::style ( )
{
return new OThemeStyle ( "" );
}
-QString ThemeInterface::name ( )
-{
- return QObject::tr( "Themed style", "name" );
-}
-
-QString ThemeInterface::description ( )
-{
- return QObject::tr( "KDE2 theme compatible style engine", "description" );
-}
-
-QCString ThemeInterface::key ( )
+QString ThemeInterface::name ( ) const
{
- return QCString ( "theme" );
+ return qApp-> translate ( "Styles", "Themed style" );
}
-unsigned int ThemeInterface::version ( )
+QString ThemeInterface::description ( ) const
{
- return 100; // 1.0.0 (\d+.\d.\d)
+ return qApp-> translate ( "Styles", "KDE2 theme compatible style engine" );
}
-QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+bool ThemeInterface::hasSettings ( ) const
{
- static ThemeSettingsInterface *setiface = 0;
-
- *iface = 0;
-
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_Style )
- *iface = this;
- else if ( uuid == IID_StyleSettings ) {
- if ( !setiface )
- setiface = new ThemeSettingsInterface ( );
- *iface = setiface;
- }
-
- if ( *iface )
- (*iface)-> addRef ( );
-
- return QS_OK;
+ return true;
}
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( ThemeInterface )
-}
-
-
-ThemeSettingsInterface::ThemeSettingsInterface ( ) : ref ( 0 )
-{
- m_widget = 0;
-}
-
-ThemeSettingsInterface::~ThemeSettingsInterface ( )
-{
-}
-
-QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name )
+QWidget *ThemeInterface::create ( QWidget *parent, const char *name )
{
m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" );
return m_widget;
}
-bool ThemeSettingsInterface::accept ( )
+bool ThemeInterface::accept ( )
{
if ( !m_widget )
return false;
@@ -89,18 +50,20 @@ bool ThemeSettingsInterface::accept ( )
return m_widget-> writeConfig ( );
}
-void ThemeSettingsInterface::reject ( )
+void ThemeInterface::reject ( )
{
}
-QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+
+QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
-
if ( uuid == IID_QUnknown )
*iface = this;
- else if ( uuid == IID_StyleSettings )
+ else if ( uuid == IID_Style )
+ *iface = this;
+ else if ( uuid == IID_StyleExtended )
*iface = this;
if ( *iface )
@@ -109,3 +72,10 @@ QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInte
return QS_OK;
}
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( ThemeInterface )
+}
+
+
+
diff --git a/noncore/styles/theme/plugin.h b/noncore/styles/theme/plugin.h
index d13fc5d..60cae97 100644
--- a/noncore/styles/theme/plugin.h
+++ b/noncore/styles/theme/plugin.h
@@ -5,7 +5,7 @@
class ThemeSettings;
-class ThemeInterface : public StyleInterface {
+class ThemeInterface : public StyleExtendedInterface {
public:
ThemeInterface ( );
virtual ~ThemeInterface ( );
@@ -13,25 +13,12 @@ public:
QRESULT queryInterface ( const QUuid &, QUnknownInterface ** );
Q_REFCOUNT
- virtual QStyle *create ( );
+ virtual QStyle *style ( );
+ virtual QString name ( ) const;
- virtual QString description ( );
- virtual QString name ( );
- virtual QCString key ( );
+ virtual QString description ( ) const;
- virtual unsigned int version ( );
-
-private:
- ulong ref;
-};
-
-class ThemeSettingsInterface : public StyleSettingsInterface {
-public:
- ThemeSettingsInterface ( );
- virtual ~ThemeSettingsInterface ( );
-
- QRESULT queryInterface ( const QUuid &, QUnknownInterface ** );
- Q_REFCOUNT
+ virtual bool hasSettings ( ) const;
virtual QWidget *create ( QWidget *parent, const char *name = 0 );