summaryrefslogtreecommitdiff
path: root/libopie/odevicebutton.cpp
Unidiff
Diffstat (limited to 'libopie/odevicebutton.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevicebutton.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp
index 314eb51..647ac4b 100644
--- a/libopie/odevicebutton.cpp
+++ b/libopie/odevicebutton.cpp
@@ -1,86 +1,84 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qpixmap.h>
22#include <qstring.h>
23 21
24#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
25#include <opie/odevicebutton.h> 23#include <opie/odevicebutton.h>
26 24
27using namespace Opie; 25using namespace Opie;
28 26
29 27
30class OQCopMessageData { 28class OQCopMessageData {
31public: 29public:
32 QCString m_channel; 30 QCString m_channel;
33 QCString m_message; 31 QCString m_message;
34 QByteArray m_data; 32 QByteArray m_data;
35}; 33};
36 34
37 35
38OQCopMessage::OQCopMessage ( ) 36OQCopMessage::OQCopMessage ( )
39 : d ( 0 ) 37 : d ( 0 )
40{ 38{
41 init ( QCString ( ), QCString ( ), QByteArray ( )); 39 init ( QCString ( ), QCString ( ), QByteArray ( ));
42} 40}
43 41
44OQCopMessage::OQCopMessage ( const OQCopMessage &copy ) 42OQCopMessage::OQCopMessage ( const OQCopMessage &copy )
45 : d ( 0 ) 43 : d ( 0 )
46{ 44{
47 init ( copy. channel ( ), copy. message ( ), copy. data ( )); 45 init ( copy. channel ( ), copy. message ( ), copy. data ( ));
48} 46}
49 47
50OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) 48OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign )
51{ 49{
52 init ( assign. channel ( ), assign. message ( ), assign. data ( )); 50 init ( assign. channel ( ), assign. message ( ), assign. data ( ));
53 return *this; 51 return *this;
54} 52}
55 53
56OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) 54OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg )
57 : d ( 0 ) 55 : d ( 0 )
58{ 56{
59 init ( ch, m, arg ); 57 init ( ch, m, arg );
60} 58}
61 59
62void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg ) 60void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg )
63{ 61{
64 if ( !d ) 62 if ( !d )
65 d = new OQCopMessageData ( ); 63 d = new OQCopMessageData ( );
66 d-> m_channel = ch; 64 d-> m_channel = ch;
67 d-> m_message = m; 65 d-> m_message = m;
68 d-> m_data = arg; 66 d-> m_data = arg;
69} 67}
70 68
71bool OQCopMessage::send ( ) 69bool OQCopMessage::send ( )
72{ 70{
73 if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) ) 71 if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) )
74 return false; 72 return false;
75 73
76 QCopEnvelope e ( d-> m_channel, d-> m_message ); 74 QCopEnvelope e ( d-> m_channel, d-> m_message );
77 75
78 if ( d-> m_data. size ( )) 76 if ( d-> m_data. size ( ))
79 e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( )); 77 e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( ));
80 78
81 return true; 79 return true;
82} 80}
83 81
84QCString OQCopMessage::channel ( ) const 82QCString OQCopMessage::channel ( ) const
85{ 83{
86 return d-> m_channel; 84 return d-> m_channel;