author | sandman <sandman> | 2002-10-04 01:42:57 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-04 01:42:57 (UTC) |
commit | 4a6ccb87f45065bc37f801adb61c3462f870cb92 (patch) (side-by-side diff) | |
tree | 86b6819ee7a13b8df82b14b2bdcf46741b5935a0 /noncore/styles/theme/plugin.cpp | |
parent | b7ec6d0674f0f7835da7f114683dcfa74e6bc546 (diff) | |
download | opie-4a6ccb87f45065bc37f801adb61c3462f870cb92.zip opie-4a6ccb87f45065bc37f801adb61c3462f870cb92.tar.gz opie-4a6ccb87f45065bc37f801adb61c3462f870cb92.tar.bz2 |
- ported all OPIE styles to the new Qtopia compatible style interface
- some cleanup in liquid (unused code)
Diffstat (limited to 'noncore/styles/theme/plugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/theme/plugin.cpp | 80 |
1 files changed, 25 insertions, 55 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 +1,3 @@ +#include <qapplication.h> + #include "othemestyle.h" @@ -8,2 +10,3 @@ ThemeInterface::ThemeInterface ( ) : ref ( 0 ) { + m_widget = 0; } @@ -14,3 +17,3 @@ ThemeInterface::~ThemeInterface ( ) -QStyle *ThemeInterface::create ( ) +QStyle *ThemeInterface::style ( ) { @@ -19,60 +22,18 @@ QStyle *ThemeInterface::create ( ) -QString ThemeInterface::name ( ) -{ - return QObject::tr( "Themed style", "name" ); -} - -QString ThemeInterface::description ( ) -{ - return QObject::tr( "KDE2 theme compatible style engine", "description" ); -} - -QCString ThemeInterface::key ( ) -{ - return QCString ( "theme" ); -} - -unsigned int ThemeInterface::version ( ) +QString ThemeInterface::name ( ) const { - return 100; // 1.0.0 (\d+.\d.\d) + return qApp-> translate ( "Styles", "Themed style" ); } -QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +QString ThemeInterface::description ( ) 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 qApp-> translate ( "Styles", "KDE2 theme compatible style engine" ); } -Q_EXPORT_INTERFACE() +bool ThemeInterface::hasSettings ( ) const { - Q_CREATE_INSTANCE( ThemeInterface ) + return true; } - -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 ) { @@ -83,3 +44,3 @@ QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name ) -bool ThemeSettingsInterface::accept ( ) +bool ThemeInterface::accept ( ) { @@ -91,3 +52,3 @@ bool ThemeSettingsInterface::accept ( ) -void ThemeSettingsInterface::reject ( ) +void ThemeInterface::reject ( ) { @@ -95,3 +56,4 @@ void ThemeSettingsInterface::reject ( ) -QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) + +QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) { @@ -99,6 +61,7 @@ QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInte - 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; @@ -111 +74,8 @@ QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInte +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( ThemeInterface ) +} + + + |