author | zecke <zecke> | 2003-08-25 16:41:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-25 16:41:34 (UTC) |
commit | 93572d0abaae444a56051d21a6fdbb76d56726e3 (patch) (unidiff) | |
tree | 859d9d17e45d3acf2ecb9b4157ac96daba714ad6 /libopie/odevicebutton.cpp | |
parent | 44b9e62c1e5071fc6e5f8e80204b9974dbc704b6 (diff) | |
download | opie-93572d0abaae444a56051d21a6fdbb76d56726e3.zip opie-93572d0abaae444a56051d21a6fdbb76d56726e3.tar.gz opie-93572d0abaae444a56051d21a6fdbb76d56726e3.tar.bz2 |
add is null
and comment about constness
-rw-r--r-- | libopie/odevicebutton.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp index eccb57c..314eb51 100644 --- a/libopie/odevicebutton.cpp +++ b/libopie/odevicebutton.cpp | |||
@@ -51,96 +51,100 @@ OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) | |||
51 | { | 51 | { |
52 | init ( assign. channel ( ), assign. message ( ), assign. data ( )); | 52 | init ( assign. channel ( ), assign. message ( ), assign. data ( )); |
53 | return *this; | 53 | return *this; |
54 | } | 54 | } |
55 | 55 | ||
56 | OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) | 56 | OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) |
57 | : d ( 0 ) | 57 | : d ( 0 ) |
58 | { | 58 | { |
59 | init ( ch, m, arg ); | 59 | init ( ch, m, arg ); |
60 | } | 60 | } |
61 | 61 | ||
62 | void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg ) | 62 | void OQCopMessage::init ( const QCString &ch, const QCString &m, const QByteArray &arg ) |
63 | { | 63 | { |
64 | if ( !d ) | 64 | if ( !d ) |
65 | d = new OQCopMessageData ( ); | 65 | d = new OQCopMessageData ( ); |
66 | d-> m_channel = ch; | 66 | d-> m_channel = ch; |
67 | d-> m_message = m; | 67 | d-> m_message = m; |
68 | d-> m_data = arg; | 68 | d-> m_data = arg; |
69 | } | 69 | } |
70 | 70 | ||
71 | bool OQCopMessage::send ( ) | 71 | bool OQCopMessage::send ( ) |
72 | { | 72 | { |
73 | if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) ) | 73 | if ( d-> m_channel. isEmpty ( ) || d-> m_message. isEmpty ( ) ) |
74 | return false; | 74 | return false; |
75 | 75 | ||
76 | QCopEnvelope e ( d-> m_channel, d-> m_message ); | 76 | QCopEnvelope e ( d-> m_channel, d-> m_message ); |
77 | 77 | ||
78 | if ( d-> m_data. size ( )) | 78 | if ( d-> m_data. size ( )) |
79 | e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( )); | 79 | e. writeRawBytes ( d-> m_data. data ( ), d-> m_data. size ( )); |
80 | 80 | ||
81 | return true; | 81 | return true; |
82 | } | 82 | } |
83 | 83 | ||
84 | QCString OQCopMessage::channel ( ) const | 84 | QCString OQCopMessage::channel ( ) const |
85 | { | 85 | { |
86 | return d-> m_channel; | 86 | return d-> m_channel; |
87 | } | 87 | } |
88 | 88 | ||
89 | QCString OQCopMessage::message ( ) const | 89 | QCString OQCopMessage::message ( ) const |
90 | { | 90 | { |
91 | return d-> m_message; | 91 | return d-> m_message; |
92 | } | 92 | } |
93 | 93 | ||
94 | QByteArray OQCopMessage::data ( ) const | 94 | QByteArray OQCopMessage::data ( ) const |
95 | { | 95 | { |
96 | return d-> m_data; | 96 | return d-> m_data; |
97 | } | 97 | } |
98 | 98 | ||
99 | bool OQCopMessage::isNull() const | ||
100 | { | ||
101 | return d-> m_message.isNull() || d-> m_channel.isNull(); | ||
102 | } | ||
99 | void OQCopMessage::setChannel ( const QCString &ch ) | 103 | void OQCopMessage::setChannel ( const QCString &ch ) |
100 | { | 104 | { |
101 | d-> m_channel = ch; | 105 | d-> m_channel = ch; |
102 | } | 106 | } |
103 | 107 | ||
104 | void OQCopMessage::setMessage ( const QCString &m ) | 108 | void OQCopMessage::setMessage ( const QCString &m ) |
105 | { | 109 | { |
106 | d-> m_message = m; | 110 | d-> m_message = m; |
107 | } | 111 | } |
108 | 112 | ||
109 | void OQCopMessage::setData ( const QByteArray &data ) | 113 | void OQCopMessage::setData ( const QByteArray &data ) |
110 | { | 114 | { |
111 | d-> m_data = data; | 115 | d-> m_data = data; |
112 | } | 116 | } |
113 | 117 | ||
114 | /*! \class Opie::ODeviceButton | 118 | /*! \class Opie::ODeviceButton |
115 | \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. | 119 | \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. |
116 | 120 | ||
117 | This class represents a physical button on a Qtopia device. A | 121 | This class represents a physical button on a Qtopia device. A |
118 | device may have "user programmable" buttons. | 122 | device may have "user programmable" buttons. |
119 | The location and number of buttons will vary from device to | 123 | The location and number of buttons will vary from device to |
120 | device. userText() and pixmap() may be used to describe this button | 124 | device. userText() and pixmap() may be used to describe this button |
121 | to the user in help documentation. | 125 | to the user in help documentation. |
122 | 126 | ||
123 | \ingroup qtopiaemb | 127 | \ingroup qtopiaemb |
124 | \internal | 128 | \internal |
125 | */ | 129 | */ |
126 | 130 | ||
127 | ODeviceButton::ODeviceButton() | 131 | ODeviceButton::ODeviceButton() |
128 | { | 132 | { |
129 | } | 133 | } |
130 | 134 | ||
131 | ODeviceButton::~ODeviceButton() | 135 | ODeviceButton::~ODeviceButton() |
132 | { | 136 | { |
133 | } | 137 | } |
134 | 138 | ||
135 | /*! | 139 | /*! |
136 | Returns the button's keycode. | 140 | Returns the button's keycode. |
137 | */ | 141 | */ |
138 | ushort ODeviceButton::keycode() const | 142 | ushort ODeviceButton::keycode() const |
139 | { | 143 | { |
140 | return m_Keycode; | 144 | return m_Keycode; |
141 | } | 145 | } |
142 | 146 | ||
143 | 147 | ||
144 | /*! | 148 | /*! |
145 | This function returns a human readable, translated description of the button. | 149 | This function returns a human readable, translated description of the button. |
146 | */ | 150 | */ |