author | zecke <zecke> | 2004-02-05 17:15:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-05 17:15:20 (UTC) |
commit | f6487edaaad38c6454fc50697d7884f0bc627489 (patch) (unidiff) | |
tree | 26b2ea805710488c84a731fef576467047fb80fd /inputmethods/dasher | |
parent | 416c72588577bca18ba1c9180701143e7e572eed (diff) | |
download | opie-f6487edaaad38c6454fc50697d7884f0bc627489.zip opie-f6487edaaad38c6454fc50697d7884f0bc627489.tar.gz opie-f6487edaaad38c6454fc50697d7884f0bc627489.tar.bz2 |
More janitor....
remove ulong ref because we use Q_REFCOUNT which also takes
care of initializing the refcount to 0
"And if you save yourself
You will make him happy
He'll keep you in a jar
And you'll think you're happy
He'll give you breathing holes"
-rw-r--r-- | inputmethods/dasher/QtDasherImpl.cc | 2 | ||||
-rw-r--r-- | inputmethods/dasher/QtDasherImpl.h | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/inputmethods/dasher/QtDasherImpl.cc b/inputmethods/dasher/QtDasherImpl.cc index 9513802..d72f6d9 100644 --- a/inputmethods/dasher/QtDasherImpl.cc +++ b/inputmethods/dasher/QtDasherImpl.cc | |||
@@ -1,72 +1,72 @@ | |||
1 | #include <iostream> | 1 | #include <iostream> |
2 | #include <qapplication.h> | 2 | #include <qapplication.h> |
3 | #include <qobject.h> | 3 | #include <qobject.h> |
4 | #include <qpixmap.h> | 4 | #include <qpixmap.h> |
5 | #include "DasherInterface.h" | 5 | #include "DasherInterface.h" |
6 | #include "QtDasherScreen.h" | 6 | #include "QtDasherScreen.h" |
7 | #include "QtDasherImpl.h" | 7 | #include "QtDasherImpl.h" |
8 | 8 | ||
9 | /* XPM */ | 9 | /* XPM */ |
10 | static const char * qtdasher_xpm[]={ | 10 | static const char * qtdasher_xpm[]={ |
11 | "28 7 2 1", | 11 | "28 7 2 1", |
12 | "# c #303030", | 12 | "# c #303030", |
13 | " c None", | 13 | " c None", |
14 | " ########################## ", | 14 | " ########################## ", |
15 | " ", | 15 | " ", |
16 | " # # ", | 16 | " # # ", |
17 | " # # # # ", | 17 | " # # # # ", |
18 | " # # # # ", | 18 | " # # # # ", |
19 | " # # # ", | 19 | " # # # ", |
20 | " ########################## "}; | 20 | " ########################## "}; |
21 | 21 | ||
22 | 22 | ||
23 | QtDasherImpl::QtDasherImpl() | 23 | QtDasherImpl::QtDasherImpl() |
24 | : qtdasherwidget(0), icn(0), ref(0), qtdasherinterface(0) | 24 | : qtdasherwidget(0), icn(0), qtdasherinterface(0) |
25 | { | 25 | { |
26 | } | 26 | } |
27 | 27 | ||
28 | QtDasherImpl::~QtDasherImpl() | 28 | QtDasherImpl::~QtDasherImpl() |
29 | { | 29 | { |
30 | delete qtdasherwidget; | 30 | delete qtdasherwidget; |
31 | delete icn; | 31 | delete icn; |
32 | } | 32 | } |
33 | 33 | ||
34 | QWidget *QtDasherImpl::inputMethod( QWidget *parent, Qt::WFlags f ) | 34 | QWidget *QtDasherImpl::inputMethod( QWidget *parent, Qt::WFlags f ) |
35 | { | 35 | { |
36 | if ( !qtdasherwidget ) { | 36 | if ( !qtdasherwidget ) { |
37 | qtdasherwidget = new QtDasherPlugin( parent, "Dasher", f ); | 37 | qtdasherwidget = new QtDasherPlugin( parent, "Dasher", f ); |
38 | } | 38 | } |
39 | return qtdasherwidget; | 39 | return qtdasherwidget; |
40 | } | 40 | } |
41 | 41 | ||
42 | void QtDasherImpl::resetState() | 42 | void QtDasherImpl::resetState() |
43 | { | 43 | { |
44 | if ( qtdasherwidget ) | 44 | if ( qtdasherwidget ) |
45 | qtdasherwidget->resetState(); | 45 | qtdasherwidget->resetState(); |
46 | } | 46 | } |
47 | 47 | ||
48 | QPixmap *QtDasherImpl::icon() | 48 | QPixmap *QtDasherImpl::icon() |
49 | { | 49 | { |
50 | if ( !icn ) | 50 | if ( !icn ) |
51 | icn = new QPixmap( (const char **)qtdasher_xpm ); | 51 | icn = new QPixmap( (const char **)qtdasher_xpm ); |
52 | return icn; | 52 | return icn; |
53 | } | 53 | } |
54 | 54 | ||
55 | QString QtDasherImpl::name() | 55 | QString QtDasherImpl::name() |
56 | { | 56 | { |
57 | return qApp->translate( "InputMethods", "Dasher" ); | 57 | return qApp->translate( "InputMethods", "Dasher" ); |
58 | } | 58 | } |
59 | 59 | ||
60 | void QtDasherImpl::onKeyPress( QObject *receiver, const char *slot ) | 60 | void QtDasherImpl::onKeyPress( QObject *receiver, const char *slot ) |
61 | { | 61 | { |
62 | if ( qtdasherwidget ) | 62 | if ( qtdasherwidget ) |
63 | QObject::connect( qtdasherwidget, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); | 63 | QObject::connect( qtdasherwidget, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); |
64 | } | 64 | } |
65 | 65 | ||
66 | #ifndef QT_NO_COMPONENT | 66 | #ifndef QT_NO_COMPONENT |
67 | QRESULT QtDasherImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 67 | QRESULT QtDasherImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
68 | { | 68 | { |
69 | *iface = 0; | 69 | *iface = 0; |
70 | if ( uuid == IID_QUnknown ) | 70 | if ( uuid == IID_QUnknown ) |
71 | *iface = this; | 71 | *iface = this; |
72 | else if ( uuid == IID_InputMethod ) | 72 | else if ( uuid == IID_InputMethod ) |
diff --git a/inputmethods/dasher/QtDasherImpl.h b/inputmethods/dasher/QtDasherImpl.h index c143dc3..69e278c 100644 --- a/inputmethods/dasher/QtDasherImpl.h +++ b/inputmethods/dasher/QtDasherImpl.h | |||
@@ -1,38 +1,37 @@ | |||
1 | #ifndef QTDASHERIMPL_H | 1 | #ifndef QTDASHERIMPL_H |
2 | #define QTDASHERIMPL_H | 2 | #define QTDASHERIMPL_H |
3 | 3 | ||
4 | #include <qpe/inputmethodinterface.h> | 4 | #include <qpe/inputmethodinterface.h> |
5 | #include "QtDasherPlugin.h" | 5 | #include "QtDasherPlugin.h" |
6 | 6 | ||
7 | class QtDasher; | 7 | class QtDasher; |
8 | class QPixmap; | 8 | class QPixmap; |
9 | 9 | ||
10 | class QtDasherImpl : public InputMethodInterface | 10 | class QtDasherImpl : public InputMethodInterface |
11 | { | 11 | { |
12 | public: | 12 | public: |
13 | QtDasherImpl(); | 13 | QtDasherImpl(); |
14 | virtual ~QtDasherImpl(); | 14 | virtual ~QtDasherImpl(); |
15 | 15 | ||
16 | #ifndef QT_NO_COMPONENT | 16 | #ifndef QT_NO_COMPONENT |
17 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 17 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
18 | Q_REFCOUNT | 18 | Q_REFCOUNT |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); | 21 | virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); |
22 | virtual void resetState(); | 22 | virtual void resetState(); |
23 | virtual QPixmap *icon(); | 23 | virtual QPixmap *icon(); |
24 | virtual QString name(); | 24 | virtual QString name(); |
25 | virtual void onKeyPress( QObject *receiver, const char *slot ); | 25 | virtual void onKeyPress( QObject *receiver, const char *slot ); |
26 | 26 | ||
27 | private: | 27 | private: |
28 | CDasherInterface *qtdasherinterface; | 28 | CDasherInterface *qtdasherinterface; |
29 | QtDasherPlugin *qtdasherwidget; | 29 | QtDasherPlugin *qtdasherwidget; |
30 | QPixmap *icn; | 30 | QPixmap *icn; |
31 | ulong ref; | ||
32 | }; | 31 | }; |
33 | 32 | ||
34 | #endif | 33 | #endif |
35 | 34 | ||
36 | 35 | ||
37 | 36 | ||
38 | 37 | ||