author | zecke <zecke> | 2003-08-25 16:41:34 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-25 16:41:34 (UTC) |
commit | 93572d0abaae444a56051d21a6fdbb76d56726e3 (patch) (side-by-side diff) | |
tree | 859d9d17e45d3acf2ecb9b4157ac96daba714ad6 | |
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/odevice.h | 3 | ||||
-rw-r--r-- | libopie/odevicebutton.cpp | 4 | ||||
-rw-r--r-- | libopie/odevicebutton.h | 2 |
3 files changed, 8 insertions, 1 deletions
diff --git a/libopie/odevice.h b/libopie/odevice.h index 650a2da..d8ad135 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h @@ -1,14 +1,15 @@ /* This file is part of the OPIE libraries Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) + Copyright (C) 2003 Holger 'zecke' Freyther (zecke@handhelds.org) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License @@ -204,25 +205,25 @@ public: virtual int readLightSensor ( ); virtual int lightSensorResolution ( ) const; const QStrList &allowedCpuFrequencies() const; bool setCurrentCpuFrequency(uint index); /** * Returns the available buttons on this device. The number and location * of buttons will vary depending on the device. Button numbers will be assigned * by the device manufacturer and will be from most preferred button to least preffered * button. Note that this list only contains "user mappable" buttons. */ - const QValueList<ODeviceButton> &buttons ( ); + const QValueList<ODeviceButton> &buttons ( ) /* ### make const */; /** * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it * returns 0L */ const ODeviceButton *buttonForKeycode ( ushort keyCode ); /** * Reassigns the pressed action for \a button. To return to the factory * default pass an empty string as \a qcopMessage. */ void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); diff --git a/libopie/odevicebutton.cpp b/libopie/odevicebutton.cpp index eccb57c..314eb51 100644 --- a/libopie/odevicebutton.cpp +++ b/libopie/odevicebutton.cpp @@ -87,24 +87,28 @@ QCString OQCopMessage::channel ( ) const } QCString OQCopMessage::message ( ) const { return d-> m_message; } QByteArray OQCopMessage::data ( ) const { return d-> m_data; } +bool OQCopMessage::isNull() const +{ + return d-> m_message.isNull() || d-> m_channel.isNull(); +} void OQCopMessage::setChannel ( const QCString &ch ) { d-> m_channel = ch; } void OQCopMessage::setMessage ( const QCString &m ) { d-> m_message = m; } void OQCopMessage::setData ( const QByteArray &data ) { diff --git a/libopie/odevicebutton.h b/libopie/odevicebutton.h index fcc2af1..1621526 100644 --- a/libopie/odevicebutton.h +++ b/libopie/odevicebutton.h @@ -35,24 +35,26 @@ public: OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( )); OQCopMessage &operator = ( const OQCopMessage &assign ); void setChannel ( const QCString &channel ); void setMessage ( const QCString &message ); void setData ( const QByteArray &ba ); QCString channel ( ) const; QCString message ( ) const; QByteArray data ( ) const; + bool isNull()const; + bool send ( ); private: void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); OQCopMessageData *d; class Private; Private* m_data; }; /** |