Diffstat (limited to 'noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelperApplet.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelperApplet.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelperApplet.cpp b/noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelperApplet.cpp new file mode 100644 index 0000000..28304d7 --- a/dev/null +++ b/noncore/applets/keyhelper/keyhelperapplet/applet/KeyHelperApplet.cpp | |||
@@ -0,0 +1,65 @@ | |||
1 | #include "KeyHelperApplet.h" | ||
2 | #include "KeyHelperWidget.h" | ||
3 | |||
4 | #if 0 | ||
5 | KeyHelperApplet::KeyHelperApplet() | ||
6 | : widget(0), ref(0) | ||
7 | { | ||
8 | qDebug("KeyHelperApplet::KeyHelperApplet()"); | ||
9 | } | ||
10 | |||
11 | KeyHelperApplet::~KeyHelperApplet() | ||
12 | { | ||
13 | qDebug("KeyHelperApplet::~KeyHelperApplet()"); | ||
14 | delete widget; | ||
15 | } | ||
16 | |||
17 | QWidget* KeyHelperApplet::applet(QWidget* parent) | ||
18 | { | ||
19 | if(!widget){ | ||
20 | widget = new KeyHelperWidget(parent); | ||
21 | } | ||
22 | return(widget); | ||
23 | } | ||
24 | |||
25 | int KeyHelperApplet::position() const | ||
26 | { | ||
27 | return(6); | ||
28 | } | ||
29 | |||
30 | QRESULT KeyHelperApplet::queryInterface(const QUuid& uuid, | ||
31 | QUnknownInterface** iface) | ||
32 | { | ||
33 | *iface = 0; | ||
34 | |||
35 | if(QFile::exists("/tmp/disable-keyhelper") | ||
36 | || QFile::exists("/mnt/card/disable-keyhelper") | ||
37 | || QFile::exists("/mnt/cf/disable-keyhelper")){ | ||
38 | return QS_FALSE; | ||
39 | } | ||
40 | |||
41 | if(uuid == IID_QUnknown){ | ||
42 | *iface = this; | ||
43 | } else if(uuid == IID_TaskbarApplet){ | ||
44 | *iface = this; | ||
45 | } | ||
46 | |||
47 | if(*iface){ | ||
48 | (*iface)->addRef(); | ||
49 | } | ||
50 | return QS_OK; | ||
51 | } | ||
52 | |||
53 | Q_EXPORT_INTERFACE() | ||
54 | { | ||
55 | Q_CREATE_INSTANCE(KeyHelperApplet) | ||
56 | } | ||
57 | |||
58 | #else | ||
59 | #include <opie2/otaskbarapplet.h> | ||
60 | |||
61 | using namespace Opie::Ui; | ||
62 | |||
63 | EXPORT_OPIE_APPLET_v1( KeyHelperWidget ) | ||
64 | |||
65 | #endif | ||