author | ar <ar> | 2004-05-31 15:26:50 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-31 15:26:50 (UTC) |
commit | 27dfc34d411dee76f09f5e516c60b0a64eb35948 (patch) (side-by-side diff) | |
tree | b7f7259497630390e352a1257cac5dc59f5399a6 | |
parent | 27b09fe4f930b96e82cea9fb0eb1a9b87f7ec062 (diff) | |
download | opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.zip opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.gz opie-27dfc34d411dee76f09f5e516c60b0a64eb35948.tar.bz2 |
- convert qWarning to owarn
20 files changed, 1037 insertions, 998 deletions
diff --git a/noncore/apps/opie-write/qrichtext_p.h b/noncore/apps/opie-write/qrichtext_p.h index e368edb..3778feb 100644 --- a/noncore/apps/opie-write/qrichtext_p.h +++ b/noncore/apps/opie-write/qrichtext_p.h @@ -52,2 +52,5 @@ +#include <opie2/odebug.h> +using namespace Opie::Core; + #ifndef QT_H @@ -126,6 +129,6 @@ public: { - QTextFormat *format; - QTextCustomItem *custom; - QString anchorName; - QString anchorHref; + QTextFormat *format; + QTextCustomItem *custom; + QString anchorName; + QString anchorHref; }; @@ -135,4 +138,4 @@ public: union { - QTextFormat* format; - CustomData* custom; + QTextFormat* format; + CustomData* custom; } d; @@ -146,4 +149,4 @@ private: QTextStringChar &operator=( const QTextStringChar & ) { - //abort(); - return *this; + //abort(); + return *this; } @@ -210,3 +213,3 @@ inline bool QTextString::isBidi() const if ( bidiDirty ) - checkBidi(); + checkBidi(); return bidi; @@ -217,3 +220,3 @@ inline bool QTextString::isRightToLeft() const if ( bidiDirty ) - checkBidi(); + checkBidi(); return rightToLeft; @@ -386,3 +389,3 @@ public: QTextCustomItem( QTextDocument *p ) - : xpos(0), ypos(-1), width(-1), height(0), parent( p ) + : xpos(0), ypos(-1), width(-1), height(0), parent( p ) {} @@ -440,3 +443,3 @@ public: QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, - QMimeSourceFactory &factory ); + QMimeSourceFactory &factory ); virtual ~QTextImage(); @@ -465,3 +468,3 @@ public: QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, - QMimeSourceFactory &factory ); + QMimeSourceFactory &factory ); virtual ~QTextHorizontalLine(); @@ -534,7 +537,7 @@ public: QTextTableCell( QTextTable* table, - int row, int column, - const QMap<QString, QString> &attr, - const QStyleSheetItem* style, - const QTextFormat& fmt, const QString& context, - QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc ); + int row, int column, + const QMap<QString, QString> &attr, + const QStyleSheetItem* style, + const QTextFormat& fmt, const QString& context, + QMimeSourceFactory &factory, QStyleSheet *sheet, const QString& doc ); virtual ~QTextTableCell(); @@ -608,3 +611,3 @@ public: void draw( QPainter* p, int x, int y, int cx, int cy, int cw, int ch, - const QColorGroup& cg, bool selected ); + const QColorGroup& cg, bool selected ); @@ -686,5 +689,5 @@ public: enum SelectionIds { - Standard = 0, - Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to - // remove multiple lines with removeSelectedText() + Standard = 0, + Temp = 32000 // This selection must not be drawn, it's used e.g. by undo/redo to + // remove multiple lines with removeSelectedText() }; @@ -793,7 +796,7 @@ public: void drawParagraph( QPainter *p, QTextParagraph *parag, int cx, int cy, int cw, int ch, - QPixmap *&doubleBuffer, const QColorGroup &cg, - bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE ); + QPixmap *&doubleBuffer, const QColorGroup &cg, + bool drawCursor, QTextCursor *cursor, bool resetChanged = TRUE ); QTextParagraph *draw( QPainter *p, int cx, int cy, int cw, int ch, const QColorGroup &cg, - bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0, - bool resetChanged = TRUE ); + bool onlyChanged = FALSE, bool drawCursor = FALSE, QTextCursor *cursor = 0, + bool resetChanged = TRUE ); @@ -860,3 +863,3 @@ private: QTextCustomItem* parseTable( const QMap<QString, QString> &attr, const QTextFormat &fmt, - const QChar* doc, int length, int& pos, QTextParagraph *curpar ); + const QChar* doc, int length, int& pos, QTextParagraph *curpar ); bool eatSpace(const QChar* doc, int length, int& pos, bool includeNbsp = FALSE ); @@ -873,5 +876,5 @@ private: struct Q_EXPORT Focus { - QTextParagraph *parag; - int start, len; - QString href; + QTextParagraph *parag; + int start, len; + QString href; }; @@ -933,3 +936,3 @@ public: QTextDeleteCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, - const QByteArray& oldStyle ); + const QByteArray& oldStyle ); QTextDeleteCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ); @@ -953,6 +956,6 @@ public: QTextInsertCommand( QTextDocument *d, int i, int idx, const QMemArray<QTextStringChar> &str, - const QByteArray& oldStyleInfo ) - : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {} + const QByteArray& oldStyleInfo ) + : QTextDeleteCommand( d, i, idx, str, oldStyleInfo ) {} QTextInsertCommand( QTextParagraph *p, int idx, const QMemArray<QTextStringChar> &str ) - : QTextDeleteCommand( p, idx, str ) {} + : QTextDeleteCommand( p, idx, str ) {} virtual ~QTextInsertCommand() {} @@ -1013,3 +1016,3 @@ struct Q_EXPORT QTextLineStart #ifndef QT_NO_COMPLEXTEXT - , bidicontext( 0 ) + , bidicontext( 0 ) #endif @@ -1017,5 +1020,5 @@ struct Q_EXPORT QTextLineStart QTextLineStart( ushort y_, ushort bl, ushort h_ ) : y( y_ ), baseLine( bl ), h( h_ ), - w( 0 ) + w( 0 ) #ifndef QT_NO_COMPLEXTEXT - , bidicontext( 0 ) + , bidicontext( 0 ) #endif @@ -1024,3 +1027,3 @@ struct Q_EXPORT QTextLineStart QTextLineStart( QBidiContext *c, QBidiStatus s ) : y(0), baseLine(0), h(0), - status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); } + status( s ), bidicontext( c ) { if ( bidicontext ) bidicontext->ref(); } #endif @@ -1030,4 +1033,4 @@ struct Q_EXPORT QTextLineStart #ifndef QT_NO_COMPLEXTEXT - if ( bidicontext && bidicontext->deref() ) - delete bidicontext; + if ( bidicontext && bidicontext->deref() ) + delete bidicontext; #endif @@ -1037,9 +1040,9 @@ struct Q_EXPORT QTextLineStart void setContext( QBidiContext *c ) { - if ( c == bidicontext ) - return; - if ( bidicontext && bidicontext->deref() ) - delete bidicontext; - bidicontext = c; - if ( bidicontext ) - bidicontext->ref(); + if ( c == bidicontext ) + return; + if ( bidicontext && bidicontext->deref() ) + delete bidicontext; + bidicontext = c; + if ( bidicontext ) + bidicontext->ref(); } @@ -1185,3 +1188,3 @@ public: virtual void paint( QPainter &painter, const QColorGroup &cg, QTextCursor *cursor = 0, bool drawSelections = FALSE, - int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 ); + int clipx = -1, int clipy = -1, int clipw = -1, int cliph = -1 ); @@ -1248,5 +1251,5 @@ protected: virtual void drawString( QPainter &painter, const QString &str, int start, int len, int xstart, - int y, int baseLine, int w, int h, int selection, - QTextStringChar *formatChar, const QColorGroup& cg, - bool rightToLeft ); + int y, int baseLine, int w, int h, int selection, + QTextStringChar *formatChar, const QColorGroup& cg, + bool rightToLeft ); @@ -1317,6 +1320,6 @@ protected: virtual QTextLineStart *formatLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, - QTextStringChar *last, int align = Qt3::AlignAuto, int space = 0 ); + QTextStringChar *last, int align = Qt3::AlignAuto, int space = 0 ); #ifndef QT_NO_COMPLEXTEXT virtual QTextLineStart *bidiReorderLine( QTextParagraph *parag, QTextString *string, QTextLineStart *line, QTextStringChar *start, - QTextStringChar *last, int align, int space ); + QTextStringChar *last, int align, int space ); #endif @@ -1381,3 +1384,3 @@ public: enum Ids { - Standard = 0 + Standard = 0 }; @@ -1401,14 +1404,14 @@ public: enum Flags { - NoFlags, - Bold = 1, - Italic = 2, - Underline = 4, - Family = 8, - Size = 16, - Color = 32, - Misspelled = 64, - VAlign = 128, - StrikeOut= 256, - Font = Bold | Italic | Underline | Family | Size | StrikeOut, - Format = Font | Color | Misspelled | VAlign + NoFlags, + Bold = 1, + Italic = 2, + Underline = 4, + Family = 8, + Size = 16, + Color = 32, + Misspelled = 64, + VAlign = 128, + StrikeOut= 256, + Font = Bold | Italic | Underline | Family | Size | StrikeOut, + Format = Font | Color | Misspelled | VAlign }; @@ -1731,3 +1734,3 @@ inline QString QTextDocument::originalText() const if ( oTextValid ) - return oText; + return oText; return text(); @@ -1738,3 +1741,3 @@ inline void QTextDocument::setFlow( QTextFlow *f ) if ( flow_ ) - delete flow_; + delete flow_; flow_ = f; @@ -1788,7 +1791,7 @@ inline void QTextFormat::removeRef() if ( !collection ) - return; + return; if ( this == collection->defFormat ) - return; + return; if ( ref == 0 ) - collection->remove( this ); + collection->remove( this ); } @@ -1845,5 +1848,5 @@ inline void QTextParagraph::append( const QString &s, bool reallyAtEnd ) if ( reallyAtEnd ) - insert( str->length(), s ); + insert( str->length(), s ); else - insert( QMAX( str->length() - 1, 0 ), s ); + insert( QMAX( str->length() - 1, 0 ), s ); } @@ -1868,3 +1871,3 @@ inline void QTextParagraph::setEndState( int s ) if ( s == state ) - return; + return; state = s; @@ -1885,3 +1888,3 @@ inline int QTextParagraph::paragId() const if ( id == -1 ) - qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this ); + owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl; return id; @@ -1912,3 +1915,3 @@ inline QTextDocument *QTextParagraph::document() const if ( hasdoc ) - return (QTextDocument*) docOrPseudo; + return (QTextDocument*) docOrPseudo; return 0; @@ -1919,3 +1922,3 @@ inline QTextParagraphPseudoDocument *QTextParagraph::pseudoDocument() const if ( hasdoc ) - return 0; + return 0; return (QTextParagraphPseudoDocument*) docOrPseudo; diff --git a/noncore/apps/tableviewer/browsekeyentry.cpp b/noncore/apps/tableviewer/browsekeyentry.cpp index 04e7902..bab9af6 100644 --- a/noncore/apps/tableviewer/browsekeyentry.cpp +++ b/noncore/apps/tableviewer/browsekeyentry.cpp @@ -18,5 +18,10 @@ ** -**********************************************************************/ +**********************************************************************/ #include "browsekeyentry.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qtoolbutton.h> @@ -30,5 +35,2 @@ -//#include <iostream.h> -#include <qheader.h> -// For qWarning(const char *) @@ -44,3 +46,3 @@ /*! - Constructs the widget + Constructs the widget */ @@ -82,26 +84,26 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) ws->raiseWidget(0); - + // TODO connect slots and signals.... - connect(changeKeyButton, SIGNAL(clicked()), + connect(changeKeyButton, SIGNAL(clicked()), this, SLOT(changeKeyMenuSlot())); - connect(resetButton, SIGNAL(clicked()), + connect(resetButton, SIGNAL(clicked()), this, SLOT(resetKeySlot())); - connect(textKey, SIGNAL(textChanged(const QString&)), + connect(textKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - connect(dayKey, SIGNAL(textChanged(const QString&)), + connect(dayKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - connect(monthKey, SIGNAL(textChanged(const QString&)), + connect(monthKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - connect(yearKey, SIGNAL(textChanged(const QString&)), + connect(yearKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - connect(secondKey, SIGNAL(textChanged(const QString&)), + connect(secondKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - connect(minuteKey, SIGNAL(textChanged(const QString&)), + connect(minuteKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - connect(hourKey, SIGNAL(textChanged(const QString&)), + connect(hourKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - + h_layout->addWidget(ws); @@ -112,3 +114,3 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) /*! - Destructs the widget + Destructs the widget */ @@ -138,4 +140,4 @@ void TVBrowseKeyEntry::changeKeySlot(int id_param) break; - default: - return; + default: + return; } @@ -148,3 +150,3 @@ void TVBrowseKeyEntry::changeKeyMenuSlot() { - if(ts) + if(ts) keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0))); @@ -167,3 +169,3 @@ void TVBrowseKeyEntry::setTableState(TableState *t) { for (i = 0; i < t->kRep->getNumFields(); i++) { - keyMenu->insertItem(ts->kRep->getKeyName(i), this, + keyMenu->insertItem(ts->kRep->getKeyName(i), this, SLOT(changeKeySlot(int)), 0, i); @@ -174,4 +176,4 @@ void TVBrowseKeyEntry::setTableState(TableState *t) { /*! - Searches on the current value of the key entry provided that the - current key is of type text WARNING, TODO fix memory leaks + Searches on the current value of the key entry provided that the + current key is of type text WARNING, TODO fix memory leaks */ @@ -230,4 +232,3 @@ void TVBrowseKeyEntry::searchOnText() default: - qWarning("TVBrowseKeyEntry::searchOnText() " - "cannot work out data type"); + owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl; return; @@ -241,2 +242,2 @@ void TVBrowseKeyEntry::searchOnText() done searching for the value v. -*/ +*/ diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp index b58af85..c35dbea 100644 --- a/noncore/apps/tableviewer/db/common.cpp +++ b/noncore/apps/tableviewer/db/common.cpp @@ -18,4 +18,4 @@ ** -**********************************************************************/ -#include "common.h" +**********************************************************************/ +#include "common.h" #include "datacache.h" @@ -90,3 +90,3 @@ int QStringVector::compareItems(Item a, Item b) QString *qb = (QString *)b; - + return QString::compare(*qa, *qb); @@ -96,3 +96,3 @@ int QStringVector::compareItems(Item a, Item b) \class TVVariant - A way of abstracting void * and keeping information on + A way of abstracting void * and keeping information on the keytypes and behaviours in one place @@ -322,3 +322,3 @@ void TVVariant::load(QDataStream &s ) default: - ofatal << "Unrecognized data type" << oendl; + ofatal << "Unrecognized data type" << oendl; } @@ -384,3 +384,3 @@ const QString TVVariant::toString() const return ((QTime*)d->value.ptr)->toString(); - case Int: + case Int: return QString::number(d->value.i); @@ -426,3 +426,3 @@ const QDate TVVariant::toDate() const } - + @@ -435,3 +435,3 @@ const QTime TVVariant::toTime() const return *((QTime *)d->value.ptr); - + if(d->typ == String) { @@ -456,3 +456,3 @@ const QTime TVVariant::toTime() const return *((Q##f*)d->value.ptr); } - + TV_VARIANT_AS(String) @@ -562,3 +562,3 @@ bool TVVariant::closer(TVVariant n, TVVariant o) if(d->typ == Invalid) - return FALSE; + return FALSE; @@ -574,3 +574,3 @@ bool TVVariant::closer(TVVariant n, TVVariant o) case String: { - /* case for strings is close is a substring.. closer is + /* case for strings is close is a substring.. closer is * earlier alphabetically */ @@ -584,3 +584,3 @@ bool TVVariant::closer(TVVariant n, TVVariant o) /* contains sub-str, if later than is not closer */ - if(QString::compare(qs1, qs2) > 0) + if(QString::compare(qs1, qs2) > 0) return FALSE; @@ -595,9 +595,9 @@ bool TVVariant::closer(TVVariant n, TVVariant o) int diff1 = (i1 - iv); - if (diff1 < 0) + if (diff1 < 0) diff1 = -diff1; int diff2 = (i2 - iv); - if (diff2 < 0) + if (diff2 < 0) diff2 = -diff2; - if (diff1 < diff2) + if (diff1 < diff2) return TRUE; @@ -612,6 +612,6 @@ bool TVVariant::closer(TVVariant n, TVVariant o) int diff1 = i1.daysTo(iv); - if (diff1 < 0) + if (diff1 < 0) diff1 = -diff1; int diff2 = i2.daysTo(iv); - if (diff2 < 0) + if (diff2 < 0) diff2 = -diff2; @@ -629,6 +629,6 @@ bool TVVariant::closer(TVVariant n, TVVariant o) int diff1 = i1.msecsTo(iv); - if (diff1 < 0) + if (diff1 < 0) diff1 = -diff1; int diff2 = i2.msecsTo(iv); - if (diff2 < 0) + if (diff2 < 0) diff2 = -diff2; @@ -651,3 +651,3 @@ bool TVVariant::close(TVVariant n) if(type() == Invalid) - return FALSE; + return FALSE; @@ -659,3 +659,3 @@ bool TVVariant::close(TVVariant n) case String: { - /* case for strings is close is a substring.. closer is + /* case for strings is close is a substring.. closer is * earlier alphabetically */ @@ -668,3 +668,3 @@ bool TVVariant::close(TVVariant n) } - case Int: + case Int: case Date: @@ -683,3 +683,3 @@ bool TVVariant::close(TVVariant n) \brief document me! - + document me! @@ -690,3 +690,3 @@ Key::Key() : kname(), kexample(), kflags(0) { } Key::Key(QString name, TVVariant example, int flags) : - kname(name), kexample(example), kflags(flags) { } + kname(name), kexample(example), kflags(flags) { } @@ -699,3 +699,3 @@ Key::Key(const Key &other) -Key& Key::operator=(const Key& key) +Key& Key::operator=(const Key& key) { @@ -779,3 +779,3 @@ void Key::setNewFlag(bool v) */ -KeyList::KeyList() : QIntDict<Key>(20) +KeyList::KeyList() : QIntDict<Key>(20) { @@ -785,3 +785,3 @@ KeyList::KeyList() : QIntDict<Key>(20) /* Should be deep copy, but isn't */ -KeyList::KeyList(const KeyList &k) : QIntDict<Key>(k) +KeyList::KeyList(const KeyList &k) : QIntDict<Key>(k) { @@ -824,3 +824,3 @@ bool KeyList::operator!=(const KeyList &other) */ -int KeyList::getNumFields() const +int KeyList::getNumFields() const { @@ -849,12 +849,12 @@ int KeyList::addKey(QString name, TVVariant::KeyType type) switch(type) { - case TVVariant::String: + case TVVariant::String: return addKey(name, TVVariant("<undefined>").asString()); break; - case TVVariant::Date: + case TVVariant::Date: return addKey(name, TVVariant(QDate::currentDate()).asDate()); break; - case TVVariant::Time: + case TVVariant::Time: return addKey(name, TVVariant(QTime(0,0,0)).toTime()); break; - case TVVariant::Int: + case TVVariant::Int: return addKey(name, TVVariant(0).toInt()); @@ -862,4 +862,3 @@ int KeyList::addKey(QString name, TVVariant::KeyType type) default: - qWarning(QObject::tr("KeyList::addKey() Cannot make default " - "value for type %1, Key not added.").arg(type)); + owarn << "KeyList::addKey() Cannot make default value for type " << type << ", Key not added." << oendl; break; @@ -869,3 +868,3 @@ int KeyList::addKey(QString name, TVVariant::KeyType type) -void KeyList::setKeyFlags(int i, int flag) +void KeyList::setKeyFlags(int i, int flag) { @@ -882,3 +881,3 @@ int KeyList::getKeyFlags(int i) const -bool KeyList::checkNewFlag(int i) const +bool KeyList::checkNewFlag(int i) const { @@ -889,3 +888,3 @@ bool KeyList::checkNewFlag(int i) const -void KeyList::setNewFlag(int i, bool f) +void KeyList::setNewFlag(int i, bool f) { @@ -896,3 +895,3 @@ void KeyList::setNewFlag(int i, bool f) -bool KeyList::checkDeleteFlag(int i) const +bool KeyList::checkDeleteFlag(int i) const { @@ -903,3 +902,3 @@ bool KeyList::checkDeleteFlag(int i) const -void KeyList::setDeleteFlag(int i, bool f) +void KeyList::setDeleteFlag(int i, bool f) { @@ -920,3 +919,3 @@ QString KeyList::getKeyName(int i) const -void KeyList::setKeyName(int i, const QString &n) +void KeyList::setKeyName(int i, const QString &n) { @@ -936,3 +935,3 @@ TVVariant::KeyType KeyList::getKeyType(int i) const -void KeyList::setKeyType(int i, TVVariant::KeyType t) +void KeyList::setKeyType(int i, TVVariant::KeyType t) { @@ -1042,5 +1041,5 @@ QDataStream &operator>>( QDataStream &s, KeyList &k) /*! - Constructs a DataElem. This function needs a container because the - size, types of keys and primary key are all defined by the containing - database + Constructs a DataElem. This function needs a container because the + size, types of keys and primary key are all defined by the containing + database */ @@ -1088,3 +1087,3 @@ QDataStream &operator>>( QDataStream &s, DataElem &d) if (size != d.getNumFields()) { - owarn << "DataSize mis-match" << oendl; + owarn << "DataSize mis-match" << oendl; return s; /* sanity check failed.. don't load */ @@ -1111,3 +1110,3 @@ KeyList DataElem::getKeys() const -/*! +/*! This function determines whether field index i of the element has been @@ -1115,4 +1114,4 @@ KeyList DataElem::getKeys() const - \return A boolean value that is TRUE if the specfied field of this - element has been set and FALSE if the field has not yet been set + \return A boolean value that is TRUE if the specfied field of this + element has been set and FALSE if the field has not yet been set */ @@ -1122,3 +1121,3 @@ bool DataElem::hasValidValue(int i) const return FALSE; - if(!contained->getKeys()->validIndex(i)) + if(!contained->getKeys()->validIndex(i)) return FALSE; @@ -1127,3 +1126,3 @@ bool DataElem::hasValidValue(int i) const -/*! +/*! This function determines whether field name qs of the element has been @@ -1131,6 +1130,6 @@ bool DataElem::hasValidValue(int i) const - \return A boolean value that is TRUE if the specfied field of this - element has been set and FALSE if the field has not yet been set + \return A boolean value that is TRUE if the specfied field of this + element has been set and FALSE if the field has not yet been set */ -bool DataElem::hasValidValue(QString qs) const +bool DataElem::hasValidValue(QString qs) const { @@ -1141,3 +1140,3 @@ bool DataElem::hasValidValue(QString qs) const /*! returns the type of the field specified by index i */ -TVVariant::KeyType DataElem::getFieldType(int i) const +TVVariant::KeyType DataElem::getFieldType(int i) const { @@ -1153,5 +1152,5 @@ TVVariant::KeyType DataElem::getFieldType(QString qs) const -/*! - returns a pointer to the data stored in field index i for this - data element, (value may not be valid) +/*! + returns a pointer to the data stored in field index i for this + data element, (value may not be valid) */ @@ -1164,5 +1163,5 @@ TVVariant DataElem::getField(int i) const -/*! - returns a pointer to the data stored in field name qs for this - data element, (value may not be valid) +/*! + returns a pointer to the data stored in field name qs for this + data element, (value may not be valid) */ @@ -1181,3 +1180,3 @@ TVVariant DataElem::getField(QString qs) const */ -void DataElem::setField(int i, QString q) +void DataElem::setField(int i, QString q) { @@ -1210,5 +1209,3 @@ void DataElem::setField(int i, QString q) default: - qWarning( - QObject::tr("DataElem::setField(%1, %2) No valid type found").arg(i).arg(q) - ); + owarn << "DataElem::setField(" << i << ", " << q << ") No valid type found" << oendl; } @@ -1221,5 +1218,5 @@ void DataElem::setField(int i, QString q) \param i index of the field to set - \param value a pointer to the (already allocated) value to set + \param value a pointer to the (already allocated) value to set */ -void DataElem::setField(int i, TVVariant value) +void DataElem::setField(int i, TVVariant value) { @@ -1238,3 +1235,3 @@ void DataElem::setField(int i, TVVariant value) */ -void DataElem::setField(QString qs, QString q) +void DataElem::setField(QString qs, QString q) { @@ -1250,3 +1247,3 @@ void DataElem::setField(QString qs, QString q) \param qs name of the field to set - \param value a pointer to the (already allocated) value to set + \param value a pointer to the (already allocated) value to set */ @@ -1269,3 +1266,3 @@ void DataElem::unsetField(QString qs) /*! - Converts the data element to a Rich Text QString + Converts the data element to a Rich Text QString */ @@ -1292,3 +1289,3 @@ QString DataElem::toQString() const /*! formats individual fields to strings so can be displayed */ -QString DataElem::toQString(int i) const +QString DataElem::toQString(int i) const { @@ -1300,3 +1297,3 @@ QString DataElem::toQString(int i) const /*! formats individual fields to strings so can be sorted by QListView */ -QString DataElem::toSortableQString(int i) const +QString DataElem::toSortableQString(int i) const { @@ -1315,3 +1312,3 @@ QString DataElem::toSortableQString(int i) const static QDate epochD(1800, 1, 1); - scratch.sprintf("%08d", + scratch.sprintf("%08d", epochD.daysTo(getField(i).toDate())); @@ -1321,3 +1318,3 @@ QString DataElem::toSortableQString(int i) const static QTime epochT(0, 0, 0); - scratch.sprintf("%08d", + scratch.sprintf("%08d", epochT.msecsTo(getField(i).toTime())); @@ -1382,3 +1379,3 @@ bool DataElem::contains(int i, TVVariant v) const /* meaningless for dates */ - case TVVariant::Int: + case TVVariant::Int: case TVVariant::Time: @@ -1387,3 +1384,3 @@ bool DataElem::contains(int i, TVVariant v) const default: - owarn << "Tried to compare unknown data type" << oendl; + owarn << "Tried to compare unknown data type" << oendl; } @@ -1408,3 +1405,3 @@ bool DataElem::startsWith(int i, TVVariant v) const /* meaningless for dates */ - case TVVariant::Int: + case TVVariant::Int: case TVVariant::Time: @@ -1413,3 +1410,3 @@ bool DataElem::startsWith(int i, TVVariant v) const default: - owarn << "Tried to compare unknown data type" << oendl; + owarn << "Tried to compare unknown data type" << oendl; } @@ -1434,3 +1431,3 @@ bool DataElem::endsWith(int i, TVVariant v) const /* meaningless for dates */ - case TVVariant::Int: + case TVVariant::Int: case TVVariant::Time: @@ -1439,3 +1436,3 @@ bool DataElem::endsWith(int i, TVVariant v) const default: - owarn << "Tried to compare unknown data type" << oendl; + owarn << "Tried to compare unknown data type" << oendl; } @@ -1448,5 +1445,5 @@ bool DataElem::endsWith(int i, TVVariant v) const - \return + \return <UL> - <LI>TRUE if the first element is a closer match to the target than the + <LI>TRUE if the first element is a closer match to the target than the second element</LI> @@ -1458,3 +1455,3 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column) { - int type; + int type; @@ -1471,3 +1468,3 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column) /* can't do compare */ - owarn << "Tried to compare two incompatable types" << oendl; + owarn << "Tried to compare two incompatable types" << oendl; return FALSE; @@ -1475,3 +1472,3 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column) return target.closer(d1->getField(column), d2->getField(column)); - } + } return target.close(d1->getField(column)); diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp index 6380e1b..de57961 100644 --- a/noncore/apps/tableviewer/db/datacache.cpp +++ b/noncore/apps/tableviewer/db/datacache.cpp @@ -18,3 +18,3 @@ ** -**********************************************************************/ +**********************************************************************/ /* @@ -65,6 +65,6 @@ DBStore::DBStore() -//TODO +//TODO /*! - Reinitializes the table to empty (include a resize of the master table, - which should free some memory) + Reinitializes the table to empty (include a resize of the master table, + which should free some memory) */ @@ -95,3 +95,3 @@ DBStore::~DBStore() /*! - This function opens the given xml file, loads it and sets up the + This function opens the given xml file, loads it and sets up the appropriate data structures. @@ -103,3 +103,3 @@ bool DBStore::openSource(QIODevice *inDev, const QString &source) { - /* first check if db is already open, if contains data.. then clear */ + /* first check if db is already open, if contains data.. then clear */ if(number_elems > 0) { @@ -111,5 +111,5 @@ bool DBStore::openSource(QIODevice *inDev, const QString &source) { } else if (source == "text/csv") { - archive = new DBCsv(this); + archive = new DBCsv(this); } else - return false; + return false; @@ -118,3 +118,3 @@ bool DBStore::openSource(QIODevice *inDev, const QString &source) { -bool DBStore::saveSource(QIODevice *outDev, const QString &source) +bool DBStore::saveSource(QIODevice *outDev, const QString &source) { @@ -124,6 +124,6 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) archive = new DBXml(this); - } else if (source == "text/x-xml-tableviewer") { + } else if (source == "text/x-xml-tableviewer") { archive = new DBCsv(this); } else - return false; + return false; } @@ -135,6 +135,6 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) archive = new DBXml(this); - } else if (source == "text/x-xml-tableviewer") { + } else if (source == "text/x-xml-tableviewer") { archive = new DBCsv(this); - } else - return false; + } else + return false; } @@ -144,3 +144,3 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) -/*! +/*! This function is used to add new elements to the database. If the database @@ -158,5 +158,5 @@ void DBStore::addItemInternal(DataElem *delem) { - /* if already full, don't over fill, do a qWarning though */ + /* if already full, don't over fill, do a owarn though */ if (full) { - owarn << "Attempted to add items to already full table" << oendl; + owarn << "Attempted to add items to already full table" << oendl; return; @@ -187,9 +187,9 @@ void DBStore::removeItem(DataElem *r) int position = master_table.findRef(r); - if(position != -1) { - /* there is at least one item, this is it */ - /* replace this with the last element, decrease the element count */ - master_table.insert(position, master_table.at(--number_elems)); - master_table.remove(number_elems); - delete r; - } + if(position != -1) { + /* there is at least one item, this is it */ + /* replace this with the last element, decrease the element count */ + master_table.insert(position, master_table.at(--number_elems)); + master_table.remove(number_elems); + delete r; + } } @@ -203,3 +203,3 @@ void DBStore::setName(const QString &n) { - name = n; + name = n; } @@ -213,3 +213,3 @@ QString DBStore::getName() { - return name; + return name; } @@ -217,3 +217,3 @@ QString DBStore::getName() /*! - Retrieves a pointer to the key representation of the database for + Retrieves a pointer to the key representation of the database for other classes to use as reference. @@ -237,3 +237,3 @@ void DBStore::setKeys(KeyList *k) /*! - Sets the current element to the first element of the database + Sets the current element to the first element of the database */ @@ -245,3 +245,3 @@ void DBStore::first() /*! - Sets the current element to the last element of the database + Sets the current element to the last element of the database */ @@ -259,3 +259,3 @@ bool DBStore::next() unsigned int new_current_elem = current_elem + 1; - if (current_elem < number_elems) + if (current_elem < number_elems) /* was valid before inc (it is possible but unlikely that inc current @@ -280,3 +280,3 @@ bool DBStore::previous() if (new_current_elem < number_elems) { - /* still is (if was 0, then now -1, but as is unsigned will wrap + /* still is (if was 0, then now -1, but as is unsigned will wrap and hence be invalid */ @@ -290,3 +290,3 @@ bool DBStore::previous() Returns the current data element in the database. Which element is current - is affected by newly added items, findItem, next, previous, first and + is affected by newly added items, findItem, next, previous, first and last functions @@ -295,5 +295,5 @@ bool DBStore::previous() */ -DataElem *DBStore::getCurrentData() +DataElem *DBStore::getCurrentData() { - if (current_elem >= number_elems) + if (current_elem >= number_elems) return NULL; diff --git a/noncore/apps/tableviewer/db/datacache.h b/noncore/apps/tableviewer/db/datacache.h index c5dc637..e38050c 100644 --- a/noncore/apps/tableviewer/db/datacache.h +++ b/noncore/apps/tableviewer/db/datacache.h @@ -29,5 +29,11 @@ +#include "common.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qstring.h> #include <qvector.h> -#include "common.h" @@ -47,3 +53,3 @@ public: virtual bool openSource(QIODevice *) { - qWarning("DBAccess::openSource not yet implemented"); + owarn << "DBAccess::openSource not yet implemented" << oendl; return false; @@ -52,3 +58,3 @@ public: virtual bool saveSource(QIODevice *) { - qWarning("DBAccess::saveSource(QString) not yet implemented"); + owarn << "DBAccess::saveSource(QString) not yet implemented" << oendl; return false; @@ -72,3 +78,3 @@ public: void addItemInternal(DataElem *); - void removeItem(DataElem *); + void removeItem(DataElem *); @@ -108,6 +114,6 @@ public: - bool next(); - bool previous(); + bool next(); + bool previous(); - DataElem* getCurrentData(); + DataElem* getCurrentData(); @@ -116,3 +122,3 @@ private: void freeTable(); - QString name; + QString name; @@ -125,3 +131,3 @@ private: unsigned int table_size; /* should always be a power of 2 */ - bool full; /* since because we are using an int for indexing there is + bool full; /* since because we are using an int for indexing there is an upper limit on the number of items we can store. */ diff --git a/noncore/apps/tableviewer/ui/browsekeyentry.cpp b/noncore/apps/tableviewer/ui/browsekeyentry.cpp index 42e24dd..6b78437 100644 --- a/noncore/apps/tableviewer/ui/browsekeyentry.cpp +++ b/noncore/apps/tableviewer/ui/browsekeyentry.cpp @@ -18,3 +18,3 @@ ** -**********************************************************************/ +**********************************************************************/ #include "browsekeyentry.h" @@ -22,2 +22,5 @@ +#include <opie2/odebug.h> +using namespace Opie::Core; + #include <qtoolbutton.h> @@ -31,5 +34,2 @@ -#include <qheader.h> -// For qWarning(const char *) - /*! @@ -44,3 +44,3 @@ /*! - Constructs the widget + Constructs the widget */ @@ -75,14 +75,14 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) ws->raiseWidget(TVVariant::String); - + // TODO connect slots and signals.... - connect(changeKeyButton, SIGNAL(clicked()), + connect(changeKeyButton, SIGNAL(clicked()), this, SLOT(changeKeyMenuSlot())); - connect(resetButton, SIGNAL(clicked()), + connect(resetButton, SIGNAL(clicked()), textKey, SLOT(clear())); - connect(resetButton, SIGNAL(clicked()), + connect(resetButton, SIGNAL(clicked()), intKey, SLOT(clear())); - connect(resetButton, SIGNAL(clicked()), + connect(resetButton, SIGNAL(clicked()), dateKey, SLOT(clear())); - connect(resetButton, SIGNAL(clicked()), + connect(resetButton, SIGNAL(clicked()), timeKey, SLOT(clear())); @@ -93,9 +93,9 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) - connect(textKey, SIGNAL(textChanged(const QString&)), + connect(textKey, SIGNAL(textChanged(const QString&)), this, SLOT(searchOnText())); - connect(intKey, SIGNAL(valueChanged(int)), + connect(intKey, SIGNAL(valueChanged(int)), this, SLOT(searchOnText())); - connect(dateKey, SIGNAL(valueChanged(const QDate&)), + connect(dateKey, SIGNAL(valueChanged(const QDate&)), this, SLOT(searchOnText())); - connect(timeKey, SIGNAL(valueChanged(const QTime&)), + connect(timeKey, SIGNAL(valueChanged(const QTime&)), this, SLOT(searchOnText())); @@ -104,3 +104,3 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) /*! - Destructs the widget + Destructs the widget */ @@ -128,3 +128,3 @@ void TVBrowseKeyEntry::changeKeyMenuSlot() { - if(ts) + if(ts) keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0))); @@ -148,3 +148,3 @@ void TVBrowseKeyEntry::rebuildKeys() { for (i = 0; i < ts->kRep->getNumFields(); i++) { - keyMenu->insertItem(it.current()->name(), this, + keyMenu->insertItem(it.current()->name(), this, SLOT(changeKeySlot(int)), 0, i); @@ -165,4 +165,4 @@ void TVBrowseKeyEntry::reset() /*! - Searches on the current value of the key entry provided that the - current key is of type text WARNING, TODO fix memory leaks + Searches on the current value of the key entry provided that the + current key is of type text WARNING, TODO fix memory leaks */ @@ -191,7 +191,6 @@ void TVBrowseKeyEntry::searchOnText() } - case TVVariant::Invalid: - break; + case TVVariant::Invalid: + break; default: - qWarning("TVBrowseKeyEntry::searchOnText() " - "cannot work out data type"); + owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl; return; @@ -205,2 +204,2 @@ void TVBrowseKeyEntry::searchOnText() done searching for the value v. -*/ +*/ diff --git a/noncore/apps/tableviewer/ui/filterkeyentry.cpp b/noncore/apps/tableviewer/ui/filterkeyentry.cpp index d108fbd..4d74d6b 100644 --- a/noncore/apps/tableviewer/ui/filterkeyentry.cpp +++ b/noncore/apps/tableviewer/ui/filterkeyentry.cpp @@ -18,3 +18,3 @@ ** -**********************************************************************/ +**********************************************************************/ #include "filterkeyentry.h" @@ -22,2 +22,7 @@ +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qwidgetstack.h> @@ -100,9 +105,9 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f) /* connect the signals down */ - connect(textKey, SIGNAL(textChanged(const QString&)), + connect(textKey, SIGNAL(textChanged(const QString&)), this, SIGNAL(valueChanged())); - connect(intKey, SIGNAL(valueChanged(int)), + connect(intKey, SIGNAL(valueChanged(int)), this, SIGNAL(valueChanged())); - connect(dateKey, SIGNAL(valueChanged(const QDate&)), + connect(dateKey, SIGNAL(valueChanged(const QDate&)), this, SIGNAL(valueChanged())); - connect(timeKey, SIGNAL(valueChanged(const QTime&)), + connect(timeKey, SIGNAL(valueChanged(const QTime&)), this, SIGNAL(valueChanged())); @@ -121,3 +126,3 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f) /*! - Destructs the widget + Destructs the widget */ @@ -127,3 +132,3 @@ TVFilterKeyEntry::~TVFilterKeyEntry() -void TVFilterKeyEntry::setKey(int i) +void TVFilterKeyEntry::setKey(int i) { @@ -185,16 +190,16 @@ TVVariant TVFilterKeyEntry::getCompareValue() switch(current_type) { - case TVVariant::String: - sendkey = TVVariant(QString(textKey->text())); - break; - case TVVariant::Int: { + case TVVariant::String: + sendkey = TVVariant(QString(textKey->text())); + break; + case TVVariant::Int: { sendkey = TVVariant(intKey->value()); - break; - } + break; + } case TVVariant::Time: { - sendkey = TVVariant(QTime(timeKey->time())); - break; + sendkey = TVVariant(QTime(timeKey->time())); + break; } case TVVariant::Date: { - sendkey = TVVariant(QDate(dateKey->date())); - break; + sendkey = TVVariant(QDate(dateKey->date())); + break; } @@ -202,4 +207,3 @@ TVVariant TVFilterKeyEntry::getCompareValue() sendkey = TVVariant(0); - qWarning("TVFilterKeyEntry::getCompareValue() " - "cannot work out data type"); + owarn << "TVFilterKeyEntry::getCompareValue() cannot work out data type" << oendl; } diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp index 22f1fb7..198c8b5 100644 --- a/noncore/apps/tableviewer/ui/tvfilterview.cpp +++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp @@ -20,2 +20,9 @@ #include "tvfilterview.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/qpeapplication.h> +using namespace Opie::Core; + +/* QT */ #include <qtoolbutton.h> @@ -28,3 +35,2 @@ -#include <qpe/qpeapplication.h> @@ -33,4 +39,4 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, { - if ( !name ) - setName( "Filter View" ); + if ( !name ) + setName( "Filter View" ); @@ -90,4 +96,4 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, - connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, - SLOT(setTerm(QListViewItem*))); + connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, + SLOT(setTerm(QListViewItem*))); @@ -104,3 +110,3 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, /*! - Destroys the TVFilterView widget + Destroys the TVFilterView widget */ @@ -120,3 +126,3 @@ void TVFilterView::reset() -void TVFilterView::rebuildKeys() +void TVFilterView::rebuildKeys() { @@ -127,3 +133,3 @@ void TVFilterView::rebuildKeys() keyEntry->setTableState(ts); - + /* set up the list of keys that can be compared on */ @@ -134,8 +140,8 @@ void TVFilterView::rebuildKeys() while(it.current()) { - if(ts->kRep->validIndex(it.currentKey())) { - keyNameCombo->insertItem(it.current()->name()); - keyIds.insert(i, it.currentKey()); - ++i; - } - ++it; + if(ts->kRep->validIndex(it.currentKey())) { + keyNameCombo->insertItem(it.current()->name()); + keyIds.insert(i, it.currentKey()); + ++i; + } + ++it; } @@ -148,3 +154,3 @@ bool TVFilterView::passesFilter(DataElem *d) { FilterTerm *t; - + for (t = terms.first(); t != 0; t = terms.next() ) { @@ -177,4 +183,3 @@ bool TVFilterView::passesFilter(DataElem *d) { default: - qWarning("TVFilterView::passesFilter() " - "unrecognized filter type"); + owarn << "TVFilterView::passesFilter() unrecognized filter type" << oendl; return false; @@ -196,3 +201,3 @@ bool TVFilterView::filterActive() const /* SLOTS */ -void TVFilterView::newTerm() +void TVFilterView::newTerm() { @@ -214,3 +219,3 @@ void TVFilterView::newTerm() -void TVFilterView::updateTerm() +void TVFilterView::updateTerm() { @@ -233,3 +238,3 @@ void TVFilterView::updateTerm() term->value = keyEntry->getCompareValue(); - + keyString = keyNameCombo->currentText(); @@ -262,3 +267,3 @@ void TVFilterView::updateTerm() /* remove old view */ - if (term->view) + if (term->view) delete(term->view); @@ -269,3 +274,3 @@ void TVFilterView::updateTerm() /* deletes current term */ -void TVFilterView::deleteTerm() +void TVFilterView::deleteTerm() { @@ -286,3 +291,3 @@ void TVFilterView::deleteTerm() /* clears all terminations */ -void TVFilterView::clearTerms() +void TVFilterView::clearTerms() { @@ -294,3 +299,3 @@ void TVFilterView::setTerm(QListViewItem *target) { - /* Iterate through the list to find item with view=target.. + /* Iterate through the list to find item with view=target.. * set as current, delete */ @@ -303,3 +308,3 @@ void TVFilterView::setTerm(QListViewItem *target) if (!current) { - current = term; + current = term; } diff --git a/noncore/apps/tinykate/libkate/kateconfig.cpp b/noncore/apps/tinykate/libkate/kateconfig.cpp index 782b629..4b8ce78 100644 --- a/noncore/apps/tinykate/libkate/kateconfig.cpp +++ b/noncore/apps/tinykate/libkate/kateconfig.cpp @@ -26,2 +26,3 @@ #include <qpe/global.h> +using namespace Opie::Core; @@ -558,4 +559,3 @@ void KateConfig::write( const QString &fn ) if ( rename( strNewFile, filename ) < 0 ) { - qWarning( "problem renaming the file %s to %s", strNewFile.latin1(), - filename.latin1() ); + owarn << "problem renaming the file " << strNewFile.latin1() << " to " << filename.latin1() << oendl; QFile::remove( strNewFile ); diff --git a/noncore/apps/zsafe/main.cpp b/noncore/apps/zsafe/main.cpp index 4fe319b..5f48f77 100644 --- a/noncore/apps/zsafe/main.cpp +++ b/noncore/apps/zsafe/main.cpp @@ -10,2 +10,8 @@ #include "zsafe.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #ifdef DESKTOP @@ -15,2 +21,4 @@ #endif + +/* STD */ #include <stdio.h> @@ -60,6 +68,6 @@ int main( int argc, char ** argv ) #else - int w, h; - sscanf (argv[1], "%d", &w); - sscanf (argv[2], "%d", &h); - DeskW = w; + int w, h; + sscanf (argv[1], "%d", &w); + sscanf (argv[2], "%d", &h); + DeskW = w; DeskH = h; @@ -76,5 +84,3 @@ int main( int argc, char ** argv ) - char buf[128]; - sprintf (buf, "Width: %d Height: %d\n", DeskW, DeskH); - qWarning (buf); + owarn << "Width: " << DeskW << " Height: " << DeskH << oendl; @@ -83,3 +89,3 @@ int main( int argc, char ** argv ) #else - if (DeskW > 240) + if (DeskW > 240) { @@ -87,4 +93,3 @@ int main( int argc, char ** argv ) DeskH += 25; - sprintf (buf, "Changed width: %d Height: %d\n", DeskW, DeskH); - qWarning (buf); + owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl; } diff --git a/noncore/apps/zsafe/zlistview.cpp b/noncore/apps/zsafe/zlistview.cpp index ba02a15..7d0b8c2 100644 --- a/noncore/apps/zsafe/zlistview.cpp +++ b/noncore/apps/zsafe/zlistview.cpp @@ -5,5 +5,10 @@ #include "zlistview.h" -#include <stdio.h> #include "zsafe.h" +/* OPIE */ +//#include <opie2/odebug.h> + +/* STD */ +#include <stdio.h> + ZListView::ZListView (ZSafe *zsafe, const char *id) : QListView(zsafe, id) @@ -20,5 +25,3 @@ void ZListView::keyPressEvent ( QKeyEvent *e ) /* - char buf[64]; - sprintf (buf, "key: %d\n", e->key()); - qWarning (buf); + owarn << "key: " << e->key() << oendl; */ diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 6ff05ac..ca3ff52 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -883,3 +883,3 @@ void ZSafe::findPwd() comment = dialog->CommentField->text(); - qWarning (name); + owarn << name << oendl; } @@ -929,3 +929,3 @@ void ZSafe::findPwd() { - qWarning (i->text(0)); + owarn << i->text(0) << oendl; i->setSelected(FALSE); @@ -943,3 +943,3 @@ void ZSafe::findPwd() { - qWarning (si->text(0)); + owarn << si->text(0) << oendl; if (si->isSelected()) @@ -960,3 +960,3 @@ void ZSafe::findPwd() { - qWarning ("Found"); + owarn << "Found" << oendl; selectedItem = si; @@ -1230,4 +1230,3 @@ void ZSafe::removeAsciiFile() { - qWarning( QString("Could not remove file %1").arg(fn), - 2000 ); + owarn << "Could not remove file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), @@ -1280,4 +1279,3 @@ void ZSafe::writeAllEntries() if ( !f.open( IO_WriteOnly ) ) { - qWarning( QString("Could not write to file %1").arg(fn), - 2000 ); + owarn << "Could not write to file " << fn << oendl; QMessageBox::critical( 0, "ZSafe", @@ -1324,6 +1322,6 @@ void ZSafe::writeAllEntries() oneEntry += "\""; - // qWarning (oneEntry); + // owarn << oneEntry << oendl; t << oneEntry << endl; - // qWarning (si->text(0)); + // owarn << si->text(0) << oendl; } @@ -1375,4 +1373,3 @@ void ZSafe::readAllEntries() { - qWarning( QString("Could not read file %1").arg(fn), - 2000 ); + owarn << "Could not read file " << fn << oendl; QMessageBox::critical( 0, "ZSafe", @@ -1405,3 +1402,3 @@ void ZSafe::readAllEntries() - qWarning ("ReadAllEntries(): "); + owarn << "ReadAllEntries(): " << oendl; @@ -1556,4 +1553,3 @@ void ZSafe::writeAllEntries() if ( !f.open( IO_WriteOnly ) ) { - qWarning( QString("Could not write to file %1").arg(fn), - 2000 ); + owarn << "Could not write to file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), @@ -1595,6 +1591,6 @@ void ZSafe::writeAllEntries() oneEntry += "\""; - // qWarning (oneEntry); + // owarn << oneEntry << oendl; t << oneEntry << endl; - // qWarning (si->text(0)); + // owarn << si->text(0) << oendl; } @@ -1610,4 +1606,3 @@ void ZSafe::readAllEntries() { - qWarning( QString("Could not read file %1").arg(fn), - 2000 ); + owarn << "Could not read file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), @@ -1640,3 +1635,3 @@ void ZSafe::readAllEntries() - qWarning ("ReadAllEntries(): "); + owarn << "ReadAllEntries(): " << oendl; @@ -1764,3 +1759,3 @@ void ZSafe::resume(int) { - qWarning ("Resume"); + owarn << "Resume" << oendl; // hide the main window @@ -1820,3 +1815,3 @@ bool ZSafe::openDocument(const char* _filename, const char* ) { - qWarning ("Wrong password"); + owarn << "Wrong password" << oendl; QMessageBox::critical( 0, tr("ZSafe"), @@ -1829,3 +1824,3 @@ bool ZSafe::openDocument(const char* _filename, const char* ) { - qWarning ("Error loading Document"); + owarn << "Error loading Document" << oendl; return false; @@ -2303,3 +2298,3 @@ void ZSafe::getDocPassword(QString title) { -qWarning ("getDocPassword"); + owarn << "getDocPassword" << oendl; // open the 'Password' dialog @@ -2482,3 +2477,3 @@ void ZSafe::quitMe () { - qWarning ("QUIT..."); + owarn << "QUIT..." << oendl; @@ -2686,3 +2681,3 @@ void ZSafe::addCategory() - qWarning (category); + owarn << category << oendl; @@ -3194,3 +3189,3 @@ void ZSafe::editCategory() { - qWarning (category); + owarn << category << oendl; catItem->setText( 0, tr( category ) ); @@ -3595,3 +3590,3 @@ void ZSafe::resizeEvent ( QResizeEvent * ) { - // qWarning ("resizeEvent"); + // owarn << "resizeEvent" << oendl; #ifndef DESKTOP diff --git a/noncore/comm/keypebble/krfbdecoder.cpp b/noncore/comm/keypebble/krfbdecoder.cpp index d61433f..837fcc5 100644 --- a/noncore/comm/keypebble/krfbdecoder.cpp +++ b/noncore/comm/keypebble/krfbdecoder.cpp @@ -27,5 +27,5 @@ const int endianTest = 1; (*(char *)&endianTest ? ((((l) & 0xff000000) >> 24) | \ - (((l) & 0x00ff0000) >> 8) | \ - (((l) & 0x0000ff00) << 8) | \ - (((l) & 0x000000ff) << 24)) : (l)) + (((l) & 0x00ff0000) >> 8) | \ + (((l) & 0x0000ff00) << 8) | \ + (((l) & 0x000000ff) << 24)) : (l)) @@ -142,3 +142,3 @@ void KRFBDecoder::sendClientInit() // Wait for server init - owarn << "Waiting for server init" << oendl; + owarn << "Waiting for server init" << oendl; @@ -154,3 +154,3 @@ void KRFBDecoder::gotServerInit() { - owarn << "Got server init" << oendl; + owarn << "Got server init" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), this, SLOT( gotServerInit() ) ); @@ -188,9 +188,8 @@ void KRFBDecoder::gotServerInit() - owarn << "Width = " << info->width << ", Height = " << info->height << "" << oendl; - qWarning( "Bpp = %d, Depth = %d, Big = %d, True = %d", - info->bpp, info->depth, info->bigEndian, info->trueColor ); - qWarning( "RedMax = %d, GreenMax = %d, BlueMax = %d", - info->redMax, info->greenMax, info->blueMax ); - qWarning( "RedShift = %d, GreenShift = %d, BlueShift = %d", - info->redShift, info->greenShift,info-> blueShift ); + owarn << "Width = " << info->width << ", Height = " << info->height << "" << oendl; + owarn << "Bpp = " << info->bpp << ", Depth = " << info->depth << ", Big = " << info->bigEndian + << ", True = " << info->trueColor << oendl; + owarn << "RedMax = " << info->redMax << ", GreenMax = " << info->greenMax << ", BlueMax = " << info->blueMax << oendl; + owarn << "RedShift = " << info->redShift << ", GreenShift = " << info->greenShift + << ", BlueShift = " << info-> blueShift << oendl; @@ -199,3 +198,3 @@ void KRFBDecoder::gotServerInit() // Wait for desktop name - owarn << "Waiting for desktop name" << oendl; + owarn << "Waiting for desktop name" << oendl; @@ -214,6 +213,6 @@ void KRFBDecoder::gotDesktopName() - owarn << "Got desktop name" << oendl; + owarn << "Got desktop name" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), - this, SLOT( gotDesktopName() ) ); + this, SLOT( gotDesktopName() ) ); @@ -226,3 +225,3 @@ void KRFBDecoder::gotDesktopName() - owarn << "Desktop: " << info->name.latin1() << "" << oendl; + owarn << "Desktop: " << info->name.latin1() << "" << oendl; @@ -266,8 +265,5 @@ void KRFBDecoder::decidePixelFormat() - qWarning( "Screen depth=%d, server depth=%d, best depth=%d, " \ - "eight bit %d, chosenDepth=%d", - screenDepth, - info->depth, - bestDepth, - con->options()->colors256, chosenDepth ); + owarn << "Screen depth=" << screenDepth << ", server depth=" << info->depth + << ", best depth=" << bestDepth << "eight bit " << con->options()->colors256 + << ", chosenDepth=" << chosenDepth << oendl; @@ -378,6 +374,6 @@ void KRFBDecoder::gotUpdateHeader() - // owarn << "Got update header" << oendl; + // owarn << "Got update header" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), - this, SLOT( gotUpdateHeader() ) ); + this, SLOT( gotUpdateHeader() ) ); @@ -413,3 +409,3 @@ void KRFBDecoder::gotUpdateHeader() - // owarn << "Expecting " << noRects << " rects" << oendl; + // owarn << "Expecting " << noRects << " rects" << oendl; @@ -425,6 +421,6 @@ void KRFBDecoder::gotRectHeader() - // owarn << "Got rect header" << oendl; + // owarn << "Got rect header" << oendl; disconnect( con, SIGNAL( gotEnoughData() ), - this, SLOT( gotRectHeader() ) ); + this, SLOT( gotRectHeader() ) ); @@ -443,4 +439,4 @@ void KRFBDecoder::gotRectHeader() // CARD32 encodingLocal = Swap32IfLE( encoding ); - // qWarning( "Rect: x=%d, y= %d, w=%d, h=%d, encoding=%ld", - // x, y, w, h, encodingLocal ); + // owarn << "Rect: x=" << x << ", y= " << y << ", w=" << w << ", h=" << h + // << ", encoding= " << encodingLocal << oendl; @@ -453,3 +449,3 @@ void KRFBDecoder::gotRectHeader() if ( encoding == RawEncoding ) { - // owarn << "Raw encoding" << oendl; + // owarn << "Raw encoding" << oendl; handleRawRect(); @@ -457,3 +453,3 @@ void KRFBDecoder::gotRectHeader() else if ( encoding == CopyRectEncoding ) { -// owarn << "CopyRect encoding" << oendl; +// owarn << "CopyRect encoding" << oendl; handleCopyRect(); @@ -461,3 +457,3 @@ void KRFBDecoder::gotRectHeader() else if ( encoding == RreEncoding ) { - owarn << "RRE encoding" << oendl; + owarn << "RRE encoding" << oendl; handleRRERect(); @@ -465,3 +461,3 @@ void KRFBDecoder::gotRectHeader() else if ( encoding == CorreEncoding ) { - owarn << "CoRRE encoding" << oendl; + owarn << "CoRRE encoding" << oendl; handleCoRRERect(); @@ -469,3 +465,3 @@ void KRFBDecoder::gotRectHeader() else if ( encoding == HexTileEncoding ) { - owarn << "HexTile encoding" << oendl; + owarn << "HexTile encoding" << oendl; handleHexTileRect(); @@ -475,5 +471,5 @@ void KRFBDecoder::gotRectHeader() QString protocolError = tr( "Protocol Error: An unknown encoding was " - "used by the server %1" ).arg( msg ); + "used by the server %1" ).arg( msg ); currentState = Error; - owarn << "Unknown encoding, " << msg << "" << oendl; + owarn << "Unknown encoding, " << msg << "" << oendl; emit error( protocolError ); @@ -493,3 +489,3 @@ void KRFBDecoder::handleRawRect() - // owarn << "Handling a raw rect chunk" << oendl; + // owarn << "Handling a raw rect chunk" << oendl; @@ -516,3 +512,3 @@ void KRFBDecoder::getRawRectChunk( int lines ) // Wait for server init - // owarn << "Waiting for raw rect chunk, " << count << "" << oendl; + // owarn << "Waiting for raw rect chunk, " << count << "" << oendl; @@ -530,3 +526,3 @@ void KRFBDecoder::gotRawRectChunk() - // owarn << "Got raw rect chunk" << oendl; + // owarn << "Got raw rect chunk" << oendl; @@ -553,3 +549,3 @@ void KRFBDecoder::gotRawRectChunk() - // owarn << "There are " << noRects << " rects left" << oendl; + // owarn << "There are " << noRects << " rects left" << oendl; @@ -597,3 +593,3 @@ void KRFBDecoder::gotCopyRectPos() - // owarn << "There are " << noRects << " rects left" << oendl; + // owarn << "There are " << noRects << " rects left" << oendl; @@ -610,3 +606,3 @@ void KRFBDecoder::handleRRERect() { - owarn << "RRE not implemented" << oendl; + owarn << "RRE not implemented" << oendl; } @@ -615,3 +611,3 @@ void KRFBDecoder::handleCoRRERect() { - owarn << "CoRRE not implemented" << oendl; + owarn << "CoRRE not implemented" << oendl; } @@ -620,3 +616,3 @@ void KRFBDecoder::handleHexTileRect() { - owarn << "HexTile not implemented" << oendl; + owarn << "HexTile not implemented" << oendl; } @@ -646,5 +642,5 @@ void KRFBDecoder::sendMouseEvent( QMouseEvent *e ) - // HACK: Scaling + // HACK: Scaling CARD16 x = Swap16IfLE( e->x() * con->options()->scaleFactor ); - CARD16 y = Swap16IfLE( e->y() * con->options()->scaleFactor ); + CARD16 y = Swap16IfLE( e->y() * con->options()->scaleFactor ); @@ -680,3 +676,3 @@ void KRFBDecoder::gotServerCut() { - owarn << "Got server cut" << oendl; + owarn << "Got server cut" << oendl; @@ -728,3 +724,3 @@ void KRFBDecoder::gotServerCutText() * from within keypebble's mass of signals and slots - owarn << "Server cut: " << cutbuf << "" << oendl; + owarn << "Server cut: " << cutbuf << "" << oendl; @@ -745,3 +741,3 @@ void KRFBDecoder::gotServerCutText() else { - owarn << "Async handled in weird state" << oendl; + owarn << "Async handled in weird state" << oendl; currentState = oldState; @@ -752,3 +748,3 @@ void KRFBDecoder::gotBell() { - owarn << "Got server bell" << oendl; + owarn << "Got server bell" << oendl; buf->soundBell(); @@ -765,3 +761,3 @@ void KRFBDecoder::gotBell() else { - owarn << "Async handled in weird state" << oendl; + owarn << "Async handled in weird state" << oendl; currentState = oldState; @@ -821,7 +817,7 @@ int KRFBDecoder::toKeySym( QKeyEvent *k ) if ((k->key() >= Qt::Key_Escape) && (k->key() <= Qt::Key_F12)) { - for(int i = 0; keyMap[i].keycode != 0; i++) { - if (k->key() == keyMap[i].keycode) { - return keyMap[i].keysym; - } - } + for(int i = 0; keyMap[i].keycode != 0; i++) { + if (k->key() == keyMap[i].keycode) { + return keyMap[i].keysym; + } + } } diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 6c5f5ea..211314b 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -112,5 +112,5 @@ namespace { inline QPixmap* IconViewItem::pixmap()const { -// qWarning( "Name is " + m_path.right( 15 ) + " rect is %d %d %d %d | %d %d", -// rect().x(),rect().y(),rect().width(),rect().height(), -// iconView()->contentsX(), iconView()->contentsY()); +// owarn << "Name is " << m_path.right( 15 ) << " rect is " << rect().x() << " " << rect().y() +// << " " << rect().width() << " " << rect().height() << " | " << iconView()->contentsX() +// << " " << iconView()->contentsY() << oendl; diff --git a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp index 36e5dcf..aa15d31 100644 --- a/noncore/graphics/opie-eye/gui/viewmodebutton.cpp +++ b/noncore/graphics/opie-eye/gui/viewmodebutton.cpp @@ -2,4 +2,7 @@ +/* OPIE */ #include <opie2/odebug.h> +using namespace Opie::Core; +/* QT */ #include <qtoolbar.h> @@ -42,3 +45,3 @@ void ViewModeButton::slotChange( int i ) { - qWarning("foo %d" +name, i ); + owarn << "foo " << name << oendl; setIconSet( Resource::loadIconSet( name ) ); diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc index 04c50d9..f81066e 100644 --- a/noncore/net/opietooth/lib/device.cc +++ b/noncore/net/opietooth/lib/device.cc @@ -1,7 +1,12 @@ -#include <signal.h> +#include "device.h" +/* OPIE */ #include <opie2/oprocess.h> +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* STD */ +#include <signal.h> -#include "device.h" @@ -16,6 +21,6 @@ namespace { for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ - qWarning("parsePID: %s", (*it).latin1() ); + owarn << "parsePID: " << (*it).latin1() << oendl; if( !(*it).startsWith("CSR") ){ - id = (*it).toInt(); - break; + id = (*it).toInt(); + break; } @@ -29,3 +34,3 @@ Device::Device(const QString &device, const QString &mode, const QString &speed - qWarning("OpieTooth::Device create" ); + owarn << "OpieTooth::Device create" << oendl; m_hci = 0; @@ -42,6 +47,6 @@ Device::~Device(){ void Device::attach(){ - qWarning("attaching %s %s %s", m_device.latin1(), m_mode.latin1(), m_speed.latin1() ); + owarn << "attaching " << m_device.latin1() << " " << m_mode.latin1() << " " << m_speed.latin1() << oendl; if(m_process == 0 ){ m_output.resize(0); - qWarning("new process to create" ); + owarn << "new process to create" << oendl; m_process = new OProcess(); @@ -57,3 +62,3 @@ void Device::attach(){ if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){ - qWarning("Could not start" ); + owarn << "Could not start" << oendl; delete m_process; @@ -69,6 +74,6 @@ void Device::detach(){ //kill the pid - qWarning( "killing" ); + warn << "killing" << oendl; kill(pid, 9); } - qWarning("detached" ); + owarn << "detached" << oendl; } @@ -82,30 +87,30 @@ void Device::slotExited( OProcess* proc) { - qWarning("prcess exited" ); + owarn << "prcess exited" << oendl; if(proc== m_process ){ - qWarning("proc == m_process" ); + owarn << "proc == m_process" << oendl; if( m_process->normalExit() ){ // normal exit - qWarning("normalExit" ); + owarn << "normalExit" << oendl; int ret = m_process->exitStatus(); if( ret == 0 ){ // attached - qWarning("attached" ); - qWarning("Output: %s", m_output.data() ); - pid = parsePid( m_output ); - qWarning("Pid = %d", pid ); - // now hciconfig hci0 up ( determine hciX FIXME) - // and call hciconfig hci0 up - // FIXME hardcoded to hci0 now :( - m_hci = new OProcess( ); - *m_hci << "hciconfig"; - *m_hci << "hci0 up"; - connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ), + owarn << "attached" << oendl; + owarn << "Output: " << m_output.data() << oendl; + pid = parsePid( m_output ); + owarn << "Pid = " << pid << oendl; + // now hciconfig hci0 up ( determine hciX FIXME) + // and call hciconfig hci0 up + // FIXME hardcoded to hci0 now :( + m_hci = new OProcess( ); + *m_hci << "hciconfig"; + *m_hci << "hci0 up"; + connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ), this, SLOT( slotExited(Opie::Core::OProcess* ) ) ); - if(!m_hci->start() ){ - qWarning("could not start" ); - m_attached = false; - emit device("hci0", false ); - } + if(!m_hci->start() ){ + owarn << "could not start" << oendl; + m_attached = false; + emit device("hci0", false ); + } }else{ - qWarning("crass" ); - m_attached = false; - emit device("hci0", false ); + owarn << "crass" << oendl; + m_attached = false; + emit device("hci0", false ); @@ -116,14 +121,14 @@ void Device::slotExited( OProcess* proc) }else if(proc== m_hci ){ - qWarning("M HCI exited" ); + owarn << "M HCI exited" << oendl; if( m_hci->normalExit() ){ - qWarning("normal exit" ); + owarn << "normal exit" << oendl; int ret = m_hci->exitStatus(); if( ret == 0 ){ - qWarning("attached really really attached" ); - m_attached = true; - emit device("hci0", true ); + owarn << "attached really really attached" << oendl; + m_attached = true; + emit device("hci0", true ); }else{ - qWarning( "failed" ); - emit device("hci0", false ); - m_attached = false; + owarn << "failed" << oendl; + emit device("hci0", false ); + m_attached = false; } @@ -136,5 +141,5 @@ void Device::slotStdOut(OProcess* proc, char* chars, int len) { - qWarning("std out" ); + owarn << "std out" << oendl; if( len <1 ){ - qWarning( "len < 1 " ); + owarn << "len < 1 " << oendl; return; @@ -143,3 +148,3 @@ void Device::slotStdOut(OProcess* proc, char* chars, int len) QCString string( chars, len+1 ); // \0 == +1 - qWarning("output: %s", string.data() ); + owarn << "output: " << string.data() << oendl; m_output.append( string.data() ); @@ -149,3 +154,3 @@ void Device::slotStdErr(OProcess* proc, char* chars, int len) { - qWarning("std err" ); + owarn << "std err" << oendl; slotStdOut( proc, chars, len ); diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc index 18e1df9..76d9127 100644 --- a/noncore/net/opietooth/lib/manager.cc +++ b/noncore/net/opietooth/lib/manager.cc @@ -1,5 +1,2 @@ - -#include <opie2/oprocess.h> - #include "parser.h" @@ -7,2 +4,6 @@ +#include <opie2/oprocess.h> +#include <opie2/odebug.h> +using namespace Opie::Core; + @@ -14,3 +15,3 @@ Manager::Manager( const QString& dev ) { - qWarning("created"); + owarn << "created" << oendl; m_device = dev; @@ -59,3 +60,3 @@ void Manager::isAvailable( Device* /*dev*/ ){ void Manager::searchDevices( const QString& device ){ - qWarning("search devices"); + owarn << "search devices" << oendl; OProcess* hcitool = new OProcess(); @@ -68,3 +69,3 @@ void Manager::searchDevices( const QString& device ){ if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { - qWarning("could not start"); + owarn << "could not start" << oendl; RemoteDevice::ValueList list; @@ -109,3 +110,3 @@ void Manager::searchServices( const QString& remDevice ){ m_sdp->setName( remDevice.latin1() ); - qWarning("search Services for %s", remDevice.latin1() ); + owarn << "search Services for " << remDevice.latin1() << oendl; connect(m_sdp, SIGNAL(processExited(Opie::Core::OProcess*) ), @@ -115,3 +116,3 @@ void Manager::searchServices( const QString& remDevice ){ if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { - qWarning("could not start sdptool" ); + owarn << "could not start sdptool" << oendl; delete m_sdp; @@ -142,3 +143,3 @@ void Manager::slotSDPOut(OProcess* proc, char* ch, int len) QCString str(ch, len+1 ); - qWarning("SDP:%s", str.data() ); + owarn << "SDP:" << str.data() << oendl; QMap<QString, QString>::Iterator it; @@ -155,3 +156,3 @@ void Manager::slotSDPExited( OProcess* proc) { - qWarning("proc name %s", proc->name() ); + owarn << "proc name " << proc->name() << oendl; Services::ValueList list; @@ -160,3 +161,3 @@ void Manager::slotSDPExited( OProcess* proc) if ( it != m_out.end() ) { - qWarning("found process" ); + owarn << "found process" << oendl; list = parseSDPOutput( it.data() ); @@ -170,3 +171,3 @@ Services::ValueList Manager::parseSDPOutput( const QString& out ) { Services::ValueList list; - qWarning("parsing output" ); + owarn << "parsing output" << oendl; Parser parser( out ); @@ -177,9 +178,9 @@ Services::ValueList Manager::parseSDPOutput( const QString& out ) { void Manager::slotHCIExited(OProcess* proc ) { - qWarning("process exited"); + owarn << "process exited" << oendl; RemoteDevice::ValueList list; if (proc->normalExit() ) { - qWarning("normalExit %s", proc->name() ); + owarn << "normalExit " << proc->name() << oendl; QMap<QString, QString>::Iterator it = m_devices.find(proc->name() ); if (it != m_devices.end() ) { - qWarning("!= end ;)"); + owarn << "!= end ;)" << oendl; list = parseHCIOutput( it.data() ); @@ -193,9 +194,9 @@ void Manager::slotHCIOut(OProcess* proc, char* ch, int len) { QCString str( ch, len+1 ); - qWarning("hci: %s", str.data() ); + owarn << "hci: " << str.data() oendl; QMap<QString, QString>::Iterator it; it = m_devices.find( proc->name() ); - qWarning("proc->name %s", proc->name() ); + owarn << "proc->name " << proc->name() << oendl; QString string; if (it != m_devices.end() ) { - qWarning("slotHCIOut "); + owarn << "slotHCIOut " << oendl; string = it.data(); @@ -207,3 +208,3 @@ void Manager::slotHCIOut(OProcess* proc, char* ch, int len) { RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { - qWarning("parseHCI %s", output.latin1() ); + owarn << "parseHCI " << output.latin1() << oendl; RemoteDevice::ValueList list; @@ -214,3 +215,3 @@ RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { str = (*it).stripWhiteSpace(); - qWarning("OpieTooth %s", str.latin1() ); + owarn << "OpieTooth " << str.latin1() << oendl; int pos = str.findRev(':' ); @@ -219,4 +220,4 @@ RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { str.remove( 0, 17 ); - qWarning("mac %s", mac.latin1() ); - qWarning("rest:%s", str.latin1() ); + owarn << "mac " << mac.latin1() << oendl; + owarn << "rest: " << str.latin1() << oendl; RemoteDevice rem( mac , str.stripWhiteSpace() ); @@ -245,3 +246,3 @@ void Manager::connectTo( const QString& mac) { void Manager::searchConnections() { - qWarning("searching connections?"); + owarn << "searching connections?" << oendl; OProcess* proc = new OProcess(); @@ -283,11 +284,11 @@ ConnectionState::ValueList Manager::parseConnections( const QString& out ) { QStringList value = QStringList::split(' ', row ); - qWarning("0: %s", value[0].latin1() ); - qWarning("1: %s", value[1].latin1() ); - qWarning("2: %s", value[2].latin1() ); - qWarning("3: %s", value[3].latin1() ); - qWarning("4: %s", value[4].latin1() ); - qWarning("5: %s", value[5].latin1() ); - qWarning("6: %s", value[6].latin1() ); - qWarning("7: %s", value[7].latin1() ); - qWarning("8: %s", value[8].latin1() ); + owan << "0: %s" << value[0].latin1() << oendl; + owan << "1: %s" << value[1].latin1() << oendl; + owan << "2: %s" << value[2].latin1() << oendl; + owan << "3: %s" << value[3].latin1() << oendl; + owan << "4: %s" << value[4].latin1() << oendl; + owan << "5: %s" << value[5].latin1() << oendl; + owan << "6: %s" << value[6].latin1() << oendl; + owan << "7: %s" << value[7].latin1() << oendl; + owan << "8: %s" << value[8].latin1() << oendl; ConnectionState con; diff --git a/noncore/net/opietooth/lib/parser.cc b/noncore/net/opietooth/lib/parser.cc index 8baf284..7e95907 100644 --- a/noncore/net/opietooth/lib/parser.cc +++ b/noncore/net/opietooth/lib/parser.cc @@ -1,5 +1,11 @@ +#include "parser.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qstringlist.h> -#include "parser.h" @@ -15,3 +21,3 @@ namespace { int convert( const QString& line, QString& ret ) { -// qWarning("called"); +// owarn << "called" << oendl; ret = QString::null; @@ -21,9 +27,9 @@ int convert( const QString& line, QString& ret ) { ret = line.left(pos ).stripWhiteSpace(); - // qWarning("ret: %s", ret.latin1() ); + // owarn << "ret: " << ret.latin1() << oendl; ret = ret.replace(QRegExp("[\"]"), ""); - //qWarning("ret: %s", ret.latin1() ); + //owarn << "ret: " << ret.latin1() << oendl; QString dummy = line.mid(pos + 5 ); - //qWarning("dummy: %s", dummy.latin1() ); + //owarn << "dummy: " << dummy.latin1() << oendl; dummy = dummy.replace(QRegExp("[)]"), ""); - //qWarning("dummy: %s", dummy.latin1() ); + //owarn << "dummy: " << dummy.latin1() << oendl; // dummy = dummy.remove( dummy.length() -2, 1 ); // remove the ) @@ -32,8 +38,8 @@ int convert( const QString& line, QString& ret ) { //if (ok ) { - // qWarning("converted %d", i); - //}else qWarning("failed" ); - //qWarning("exiting"); + // owarn << "converted " << i << oendl; + //}else owarn << "failed" << oendl; + //owarn << "exiting" << oendl; return i; } - //qWarning("output %d", i ); + //owarn << "output " << i << oendl; return i; @@ -59,3 +65,3 @@ void Parser::parse( const QString& string) { for (it = list.begin(); it != list.end(); ++it ) { - //qWarning("line:%s:line", (*it).latin1() ); + //owarn << "line:" << (*it).latin1() << oendl; if ( (*it).startsWith("Browsing") ) continue; @@ -63,3 +69,3 @@ void Parser::parse( const QString& string) { if ( (*it).stripWhiteSpace().isEmpty() ) { // line is empty because a new Service begins - qWarning("could add"); + owarn << "could add" << oendl; // now see if complete and add @@ -82,3 +88,3 @@ void Parser::parse( const QString& string) { if (m_complete) { -// qWarning("adding"); +// owarn << "adding" << oendl; if (!m_item.serviceName().isEmpty() ) @@ -89,5 +95,5 @@ void Parser::parse( const QString& string) { if (m_list.isEmpty() ) - qWarning("m_list is empty"); + owarn << "m_list is empty" << oendl; for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) { - qWarning("name %s", (*it2).serviceName().latin1() ); + owarn << "name " << (*it2).serviceName().latin1() << oendl; } @@ -97,3 +103,3 @@ bool Parser::parseName( const QString& str) { m_item.setServiceName( str.mid(13).stripWhiteSpace() ); - qWarning(m_item.serviceName() ); + owarn << m_item.serviceName() << oendl; return true; @@ -105,3 +111,3 @@ bool Parser::parseRecHandle( const QString& str) { QString out = str.mid(18 ).stripWhiteSpace(); - qWarning("out %s", out.latin1() ); + owarn << "out " << out.latin1() << oendl; int value = out.mid(2).toInt(&m_ok, 16 ); @@ -111,3 +117,3 @@ bool Parser::parseRecHandle( const QString& str) { m_complete = false; - qWarning("rec handle %d", value); + owarn << "rec handle " << value << oendl; m_item.setRecHandle( value ); @@ -120,4 +126,4 @@ bool Parser::parseClassId( const QString& str) { if (str.startsWith("Service Class ID List:") ) { - qWarning("found class id" ); - qWarning("line:%s", str.latin1() ); + owarn << "found class id" << oendl; + owarn << "line: " << str.latin1() << oendl; m_classOver = true; @@ -125,4 +131,4 @@ bool Parser::parseClassId( const QString& str) { }else if ( m_classOver && str.startsWith(" " ) ){ // ok now are the informations in place - qWarning("line with class id" ); - qWarning("%s",str.latin1() ); + owarn << "line with class id" << oendl; + owarn << str.latin1() << oendl; @@ -135,3 +141,3 @@ bool Parser::parseClassId( const QString& str) { ids = convert( str, classes ); - qWarning("ids %d", ids ); + owarn << "ids " << ids << oendl; m_item.insertClassId( ids, classes ); @@ -140,3 +146,3 @@ bool Parser::parseClassId( const QString& str) { }else{ - qWarning("Else %d", m_classOver ); + owarn << "Else " << m_classOver << oendl; m_classOver = false; @@ -152,3 +158,3 @@ bool Parser::parseProtocol( const QString& str) { }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100) - qWarning("double protocol filter"); + owarn << "double protocol filter" << oendl; @@ -164,3 +170,3 @@ bool Parser::parseProtocol( const QString& str) { }else if (m_protocolOver && str.startsWith(" ") ) { - qWarning("tripple protocol filter"); + owarn << "tripple protocol filter" << oendl; m_protocolAdded = true; @@ -189,3 +195,3 @@ bool Parser::parseProfile( const QString& str) { int dummy = str.mid(pos+1 ).stripWhiteSpace().toInt(); - qWarning("dummyInt:%d", dummy ); + owarn << "dummyInt: " << dummy << oendl; Services::ProfileDescriptor desc( m_profName, m_profId, dummy ); diff --git a/noncore/settings/mediummount/mediumglobal.cc b/noncore/settings/mediummount/mediumglobal.cc index ab0b3af..0c6cf12 100644 --- a/noncore/settings/mediummount/mediumglobal.cc +++ b/noncore/settings/mediummount/mediumglobal.cc @@ -1,3 +1,10 @@ +#include "mediumglobal.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; +#include <qpe/config.h> +/* QT */ #include <qlineedit.h> @@ -11,5 +18,3 @@ -#include <qpe/config.h> -#include "mediumglobal.h" @@ -154,3 +159,3 @@ void MediumGlobalWidget::slotGlobalChanged() mode = GLOBAL_DISABLED; - qWarning("enabled = %d", enabled ); + owarn << "enabled = " << enabled << oendl; m_all->setEnabled ( enabled ); diff --git a/noncore/styles/theme/othemebase.h b/noncore/styles/theme/othemebase.h index e691692..5519798 100644 --- a/noncore/styles/theme/othemebase.h +++ b/noncore/styles/theme/othemebase.h @@ -20,2 +20,7 @@ +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qdatetime.h> @@ -41,19 +46,19 @@ class OThemePixmap : public QPixmap public: - enum BorderType{Top = 0, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, - BottomRight}; - - OThemePixmap( bool timer = true ); - OThemePixmap( const OThemePixmap &p ); - ~OThemePixmap(); - QPixmap* border( BorderType type ); - void setBorder( BorderType type, const QPixmap &p ); - void updateAccessed(); - bool isOld(); + enum BorderType{Top = 0, Bottom, Left, Right, TopLeft, TopRight, BottomLeft, + BottomRight}; + + OThemePixmap( bool timer = true ); + OThemePixmap( const OThemePixmap &p ); + ~OThemePixmap(); + QPixmap* border( BorderType type ); + void setBorder( BorderType type, const QPixmap &p ); + void updateAccessed(); + bool isOld(); protected: - QTime *t; - QPixmap *b[ 8 ]; + QTime *t; + QPixmap *b[ 8 ]; private: - class OThemePixmapPrivate; - OThemePixmapPrivate *d; + class OThemePixmapPrivate; + OThemePixmapPrivate *d; }; @@ -62,3 +67,3 @@ inline QPixmap* OThemePixmap::border( BorderType type ) { - return ( b[ type ] ); + return ( b[ type ] ); } @@ -67,7 +72,7 @@ inline void OThemePixmap::setBorder( BorderType type, const QPixmap &p ) { - if ( b[ type ] ) { - qWarning( "OThemePixmap: Overwriting existing border!" ); - delete( b[ type ] ); - } - b[ type ] = new QPixmap( p ); + if ( b[ type ] ) { + owarn << "OThemePixmap: Overwriting existing border!" << oendl; + delete( b[ type ] ); + } + b[ type ] = new QPixmap( p ); } @@ -76,4 +81,4 @@ inline void OThemePixmap::updateAccessed() { - if (t) - t->start(); + if (t) + t->start(); } @@ -82,3 +87,3 @@ inline bool OThemePixmap::isOld() { - return ( t ? t->elapsed() >= 300000 : false ); + return ( t ? t->elapsed() >= 300000 : false ); } @@ -108,68 +113,68 @@ class OThemeCache : public QObject { - Q_OBJECT + Q_OBJECT public: - /** - * The scale hints supported by the cache. Note that Tiled is not here - * since tiled pixmaps are kept only once in OThemeBase. - */ - enum ScaleHint{FullScale, HorizontalScale, VerticalScale}; - /** - * The constructor. - * - * @param maxSize The maximum size of the cache in kilobytes. - */ - OThemeCache( int maxSize, QObject *parent = 0, const char *name = 0 ); - /** - * Inserts a new pixmap into the cache. - * - * @param pixmap The pixmap to insert. - * @param scale The scaling type of the pixmap. - * @param widgetID The widget ID of the pixmap, usually from OThemeBase's - * WidgetType enum. - * - * @return True if the insert was successful, false otherwise. - */ - bool insert( OThemePixmap *pixmap, ScaleHint scale, int widgetID, - bool border = false, bool mask = false ); - /** - * Returns a fully scaled pixmap. - * - * @param w The pixmap width to search for. - * @param h The pixmap height to search for. - * @param widgetID The widget ID to search for. - * - * @return True if a pixmap matching the width, height, and widget ID of - * the pixmap exists, NULL otherwise. - */ - OThemePixmap* pixmap( int w, int h, int widgetID, bool border = false, - bool mask = false ); - /** - * Returns a horizontally scaled pixmap. - * - * @param w The pixmap width to search for. - * @param widgetID The widget ID to search for. - * - * @return True if a pixmap matching the width and widget ID of - * the pixmap exists, NULL otherwise. - */ - OThemePixmap* horizontalPixmap( int w, int widgetID ); - /** - * Returns a vertically scaled pixmap. - * - * @param h The pixmap height to search for. - * @param widgetID The widget ID to search for. - * - * @return True if a pixmap matching the height and widget ID of - * the pixmap exists, NULL otherwise. - */ - OThemePixmap* verticalPixmap( int h, int widgetID ); + /** + * The scale hints supported by the cache. Note that Tiled is not here + * since tiled pixmaps are kept only once in OThemeBase. + */ + enum ScaleHint{FullScale, HorizontalScale, VerticalScale}; + /** + * The constructor. + * + * @param maxSize The maximum size of the cache in kilobytes. + */ + OThemeCache( int maxSize, QObject *parent = 0, const char *name = 0 ); + /** + * Inserts a new pixmap into the cache. + * + * @param pixmap The pixmap to insert. + * @param scale The scaling type of the pixmap. + * @param widgetID The widget ID of the pixmap, usually from OThemeBase's + * WidgetType enum. + * + * @return True if the insert was successful, false otherwise. + */ + bool insert( OThemePixmap *pixmap, ScaleHint scale, int widgetID, + bool border = false, bool mask = false ); + /** + * Returns a fully scaled pixmap. + * + * @param w The pixmap width to search for. + * @param h The pixmap height to search for. + * @param widgetID The widget ID to search for. + * + * @return True if a pixmap matching the width, height, and widget ID of + * the pixmap exists, NULL otherwise. + */ + OThemePixmap* pixmap( int w, int h, int widgetID, bool border = false, + bool mask = false ); + /** + * Returns a horizontally scaled pixmap. + * + * @param w The pixmap width to search for. + * @param widgetID The widget ID to search for. + * + * @return True if a pixmap matching the width and widget ID of + * the pixmap exists, NULL otherwise. + */ + OThemePixmap* horizontalPixmap( int w, int widgetID ); + /** + * Returns a vertically scaled pixmap. + * + * @param h The pixmap height to search for. + * @param widgetID The widget ID to search for. + * + * @return True if a pixmap matching the height and widget ID of + * the pixmap exists, NULL otherwise. + */ + OThemePixmap* verticalPixmap( int h, int widgetID ); protected slots: - void flushTimeout(); + void flushTimeout(); protected: - QIntCache<OThemePixmap> cache; - QTimer flushTimer; + QIntCache<OThemePixmap> cache; + QTimer flushTimer; private: - class OThemeCachePrivate; - OThemeCachePrivate *d; + class OThemeCachePrivate; + OThemeCachePrivate *d; }; @@ -191,377 +196,377 @@ class OThemeBase: public QWindowsStyle { - Q_OBJECT + Q_OBJECT public: - /** - * Constructs a new OThemeBase object. - */ - OThemeBase( const QString &configFile ); - ~OThemeBase(); - /** - * Describes if a pixmap should be scaled fully, horizontally, vertically, - * or not at all and tiled. - */ - enum ScaleHint{FullScale, HorizontalScale, VerticalScale, TileScale}; - /** - * The default arrow types. - */ - enum ArrowStyle{MotifArrow, LargeArrow, SmallArrow}; - /** - * The default frame shading styles. - */ - enum ShadeStyle{Motif, Windows, Next, KDE}; - /** - * The default scrollbar button layout. BottomLeft is like what Next - * uses, BottomRight is like Platinum, and Opposite it like Windows and - * Motif. - */ - enum SButton{SBBottomLeft, SBBottomRight, SBOpposite}; - /** - * The gradient types. Horizontal is left to right, Vertical is top to - * bottom, and diagonal is upper-left to bottom-right. - */ - enum Gradient{GrNone, GrHorizontal, GrVertical, GrDiagonal, GrPyramid, - GrRectangle, GrElliptic, GrReverseBevel}; - /** - * This provides a list of widget types that OThemeBase recognizes. - */ - /* Internal note: The order here is important. Some widgets inherit - * properties. This is usually for when you have two settings for the - * same widget, ie: on(sunken), and off. The on settings will inherit - * the properties of the off one when nothing is specified in the config. - * - * In order to be able to handle this while still having everything in - * one group that is easy to loop from we have the following order: - * unsunked(off) items, sunken(on)items, and then the ones that don't - * matter. INHERIT_ITEMS define the number of widgets that have inheritence - * so if 0 == PushButtonOff then INHERIT_ITEMS should == PushButtonOn - * and so on. WIDGETS define the total number of widgets. - */ - enum WidgetType{ - // Off (unsunken widgets) - PushButton = 0, ComboBox, HScrollBarSlider, VScrollBarSlider, Bevel, - ToolButton, ScrollButton, HScrollDeco, VScrollDeco, - ComboDeco, MenuItem, InactiveTab, ArrowUp, ArrowDown, ArrowLeft, - ArrowRight, - // On (sunken widgets) - PushButtonDown, ComboBoxDown, HScrollBarSliderDown, - VScrollBarSliderDown, BevelDown, ToolButtonDown, ScrollButtonDown, - HScrollDecoDown, VScrollDecoDown, ComboDecoDown, MenuItemDown, - ActiveTab, SunkenArrowUp, SunkenArrowDown, SunkenArrowLeft, - SunkenArrowRight, - // Everything else (indicators must have separate settings) - HScrollGroove, VScrollGroove, Slider, SliderGroove, IndicatorOn, - IndicatorOff, ExIndicatorOn, ExIndicatorOff, HBarHandle, VBarHandle, - ToolBar, Splitter, CheckMark, MenuBar, DisArrowUp, DisArrowDown, - DisArrowLeft, DisArrowRight, ProgressBar, ProgressBg, MenuBarItem, - Background}; - - /** - * The scaling type specified by the Config file. - * - * @param widget A Widgets enum value. - * - * @return A ScaleHint enum value. - */ - ScaleHint scaleHint( WidgetType widget ) const; - /** - * The gradient type specified by the KConfig file. - * - * @param widget A Widgets enum value. - * - * @return A Gradient enum value. - */ - Gradient gradientHint( WidgetType widget ) const; - /** - * The color group specified for a given widget. - * If a color group is set in the theme configuration - * that is used, otherwise defaultColor is returned. - * - * @param defaultColor The colorGroup to set if one is available. - * - * @param widget The widget whose color group to retrieve. - * - */ - const QColorGroup* colorGroup( const QColorGroup &defaultGroup, - WidgetType widget ) const; - - QBrush pixmapBrush( const QColorGroup &group, QColorGroup::ColorRole role, - int w, int h, WidgetType widget ); - /** - * True if the widget has a pixmap or gradient specified. - */ - bool isPixmap( WidgetType widget ) const; - /** - * True if the widget has a color group specified. - */ - bool isColor( WidgetType widget ) const; - /** - * True if the user specified a 3D focus rectangle - */ - bool is3DFocus() const; - /** - * If the user specified a 3D focus rectangle, they may also specify an - * offset from the default rectangle to use when drawing it. This returns - * the specified offset. - */ - int focusOffset() const; - /** - * The border width of the specified widget. - */ - int borderWidth( WidgetType widget ) const; - /** - * Pixmap border width of the specified widget. - */ - int pixBorderWidth( WidgetType widget ) const; - /** - * Returns the border pixmap if enabled for the specified widget. This - * will contain the originial pixmap, plus the edges separated in - * OThemePixmap::border() if valid. If invalid it will return NULL. - */ - OThemePixmap* borderPixmap( WidgetType widget ); - /** - * The highlight width of the specified widget. - */ - int highlightWidth( WidgetType widget ) const; - /** - * The border plus highlight width of the widget. - */ - int decoWidth( WidgetType widget ) const; - /** - * The extent (width for vertical, height for horizontal) requested - * for the scrollbars. - */ - int getSBExtent() const; - /** - * The scrollbar button layout. - */ - SButton scrollBarLayout() const; - /** - * The arrow type. - */ - ArrowStyle arrowType() const; - /** - * The shading type. - */ - ShadeStyle shade() const; - /** - * The frame width. - */ - int frameWidth() const; - /** - * The splitter width. - */ - int splitWidth() const; - /** - * The contrast for some bevel effects such as reverse gradient. - */ - int bevelContrast( WidgetType widget ) const; - /** - * The button text X shift. - */ - int buttonXShift() const; - /** - * The button text Y shift. - */ - int buttonYShift() const; - /** - * Returns either the slider length of the slider pixmap if available, - * otherwise the length specified in the config file. - */ - int sliderButtonLength() const; - /** - * True if rounded buttons are requested. - */ - bool roundButton() const; - /** - * True if rounded comboboxes are requested. - */ - bool roundComboBox() const; - /** - * True if rounded slider grooves are requested. - */ - bool roundSlider() const; - /** - * True if a line should be drawn on the bottom of active tabs. - */ - bool activeTabLine() const; - /** - * True if a line should be drawn on the bottom of inactive tabs. - */ - bool inactiveTabLine() const; - /** - * Returns the current uncached pixmap for the given widget. This will - * usually be either the last scaled or gradient pixmap if those have - * been specified in the config file, the original pixmap if not, or NULL - * if no pixmap has been specified. - */ - OThemePixmap* uncached( WidgetType widget ) const; - /** - * Returns the pixmap for the given widget at the specified width and - * height. This will return NULL if no pixmap or gradient is specified. - * It may also return a different sized pixmap if the scaling - * is set to Tiled. When using this method, you should call it using - * the needed width and height then use QPainter::drawTiledPixmap to - * paint it. Doing this, if the pixmap is scaled it will be the proper - * size, otherwise it will be tiled. - * - * @param w Requested width. - * @param h Requested height. - * @param widget Widget type. - * @return The pixmap or NULL if one is not specified. - */ - virtual OThemePixmap *scalePixmap( int w, int h, WidgetType widget ); - /** - * This method reads a configuration file and applies it to the user's - * kstylerc file. It does not signal applications to reload via the - * KDEChangeGeneral atom, if you want to do this you must do so yourself. - * See kcmdisplay's general.cpp for an example. - * - * @param file The configuration file to apply. - */ - static void applyConfigFile( const QString &file ); + /** + * Constructs a new OThemeBase object. + */ + OThemeBase( const QString &configFile ); + ~OThemeBase(); + /** + * Describes if a pixmap should be scaled fully, horizontally, vertically, + * or not at all and tiled. + */ + enum ScaleHint{FullScale, HorizontalScale, VerticalScale, TileScale}; + /** + * The default arrow types. + */ + enum ArrowStyle{MotifArrow, LargeArrow, SmallArrow}; + /** + * The default frame shading styles. + */ + enum ShadeStyle{Motif, Windows, Next, KDE}; + /** + * The default scrollbar button layout. BottomLeft is like what Next + * uses, BottomRight is like Platinum, and Opposite it like Windows and + * Motif. + */ + enum SButton{SBBottomLeft, SBBottomRight, SBOpposite}; + /** + * The gradient types. Horizontal is left to right, Vertical is top to + * bottom, and diagonal is upper-left to bottom-right. + */ + enum Gradient{GrNone, GrHorizontal, GrVertical, GrDiagonal, GrPyramid, + GrRectangle, GrElliptic, GrReverseBevel}; + /** + * This provides a list of widget types that OThemeBase recognizes. + */ + /* Internal note: The order here is important. Some widgets inherit + * properties. This is usually for when you have two settings for the + * same widget, ie: on(sunken), and off. The on settings will inherit + * the properties of the off one when nothing is specified in the config. + * + * In order to be able to handle this while still having everything in + * one group that is easy to loop from we have the following order: + * unsunked(off) items, sunken(on)items, and then the ones that don't + * matter. INHERIT_ITEMS define the number of widgets that have inheritence + * so if 0 == PushButtonOff then INHERIT_ITEMS should == PushButtonOn + * and so on. WIDGETS define the total number of widgets. + */ + enum WidgetType{ + // Off (unsunken widgets) + PushButton = 0, ComboBox, HScrollBarSlider, VScrollBarSlider, Bevel, + ToolButton, ScrollButton, HScrollDeco, VScrollDeco, + ComboDeco, MenuItem, InactiveTab, ArrowUp, ArrowDown, ArrowLeft, + ArrowRight, + // On (sunken widgets) + PushButtonDown, ComboBoxDown, HScrollBarSliderDown, + VScrollBarSliderDown, BevelDown, ToolButtonDown, ScrollButtonDown, + HScrollDecoDown, VScrollDecoDown, ComboDecoDown, MenuItemDown, + ActiveTab, SunkenArrowUp, SunkenArrowDown, SunkenArrowLeft, + SunkenArrowRight, + // Everything else (indicators must have separate settings) + HScrollGroove, VScrollGroove, Slider, SliderGroove, IndicatorOn, + IndicatorOff, ExIndicatorOn, ExIndicatorOff, HBarHandle, VBarHandle, + ToolBar, Splitter, CheckMark, MenuBar, DisArrowUp, DisArrowDown, + DisArrowLeft, DisArrowRight, ProgressBar, ProgressBg, MenuBarItem, + Background}; + + /** + * The scaling type specified by the Config file. + * + * @param widget A Widgets enum value. + * + * @return A ScaleHint enum value. + */ + ScaleHint scaleHint( WidgetType widget ) const; + /** + * The gradient type specified by the KConfig file. + * + * @param widget A Widgets enum value. + * + * @return A Gradient enum value. + */ + Gradient gradientHint( WidgetType widget ) const; + /** + * The color group specified for a given widget. + * If a color group is set in the theme configuration + * that is used, otherwise defaultColor is returned. + * + * @param defaultColor The colorGroup to set if one is available. + * + * @param widget The widget whose color group to retrieve. + * + */ + const QColorGroup* colorGroup( const QColorGroup &defaultGroup, + WidgetType widget ) const; + + QBrush pixmapBrush( const QColorGroup &group, QColorGroup::ColorRole role, + int w, int h, WidgetType widget ); + /** + * True if the widget has a pixmap or gradient specified. + */ + bool isPixmap( WidgetType widget ) const; + /** + * True if the widget has a color group specified. + */ + bool isColor( WidgetType widget ) const; + /** + * True if the user specified a 3D focus rectangle + */ + bool is3DFocus() const; + /** + * If the user specified a 3D focus rectangle, they may also specify an + * offset from the default rectangle to use when drawing it. This returns + * the specified offset. + */ + int focusOffset() const; + /** + * The border width of the specified widget. + */ + int borderWidth( WidgetType widget ) const; + /** + * Pixmap border width of the specified widget. + */ + int pixBorderWidth( WidgetType widget ) const; + /** + * Returns the border pixmap if enabled for the specified widget. This + * will contain the originial pixmap, plus the edges separated in + * OThemePixmap::border() if valid. If invalid it will return NULL. + */ + OThemePixmap* borderPixmap( WidgetType widget ); + /** + * The highlight width of the specified widget. + */ + int highlightWidth( WidgetType widget ) const; + /** + * The border plus highlight width of the widget. + */ + int decoWidth( WidgetType widget ) const; + /** + * The extent (width for vertical, height for horizontal) requested + * for the scrollbars. + */ + int getSBExtent() const; + /** + * The scrollbar button layout. + */ + SButton scrollBarLayout() const; + /** + * The arrow type. + */ + ArrowStyle arrowType() const; + /** + * The shading type. + */ + ShadeStyle shade() const; + /** + * The frame width. + */ + int frameWidth() const; + /** + * The splitter width. + */ + int splitWidth() const; + /** + * The contrast for some bevel effects such as reverse gradient. + */ + int bevelContrast( WidgetType widget ) const; + /** + * The button text X shift. + */ + int buttonXShift() const; + /** + * The button text Y shift. + */ + int buttonYShift() const; + /** + * Returns either the slider length of the slider pixmap if available, + * otherwise the length specified in the config file. + */ + int sliderButtonLength() const; + /** + * True if rounded buttons are requested. + */ + bool roundButton() const; + /** + * True if rounded comboboxes are requested. + */ + bool roundComboBox() const; + /** + * True if rounded slider grooves are requested. + */ + bool roundSlider() const; + /** + * True if a line should be drawn on the bottom of active tabs. + */ + bool activeTabLine() const; + /** + * True if a line should be drawn on the bottom of inactive tabs. + */ + bool inactiveTabLine() const; + /** + * Returns the current uncached pixmap for the given widget. This will + * usually be either the last scaled or gradient pixmap if those have + * been specified in the config file, the original pixmap if not, or NULL + * if no pixmap has been specified. + */ + OThemePixmap* uncached( WidgetType widget ) const; + /** + * Returns the pixmap for the given widget at the specified width and + * height. This will return NULL if no pixmap or gradient is specified. + * It may also return a different sized pixmap if the scaling + * is set to Tiled. When using this method, you should call it using + * the needed width and height then use QPainter::drawTiledPixmap to + * paint it. Doing this, if the pixmap is scaled it will be the proper + * size, otherwise it will be tiled. + * + * @param w Requested width. + * @param h Requested height. + * @param widget Widget type. + * @return The pixmap or NULL if one is not specified. + */ + virtual OThemePixmap *scalePixmap( int w, int h, WidgetType widget ); + /** + * This method reads a configuration file and applies it to the user's + * kstylerc file. It does not signal applications to reload via the + * KDEChangeGeneral atom, if you want to do this you must do so yourself. + * See kcmdisplay's general.cpp for an example. + * + * @param file The configuration file to apply. + */ + static void applyConfigFile( const QString &file ); protected: - /** - * Returns a QImage for the given widget if the widget is scaled, NULL - * otherwise. QImages of the original pixmap are stored for scaled - * widgets in order to facilitate fast and accurate smooth-scaling. This - * also saves us a conversion from a pixmap to an image then back again. - */ - QImage* image( WidgetType widget ) const; - /** - * Returns the gradient high color if one is specified, NULL otherwise. - */ - QColor* gradientHigh( WidgetType widget ) const; - /** - * Returns the gradient low color if one is specified, NULL otherwise. - */ - QColor* gradientLow( WidgetType widget ) const; - /** - * Reads in all the configuration file entries supported. - * - * @param colorStyle The style for the color groups. In KDE, colors were - * calculated a little differently for Motif vs Windows styles. This - * is obsolete. - */ - void readConfig( Qt::GUIStyle colorStyle = Qt::WindowsStyle ); - void readWidgetConfig( int i, Config *config, QString *pixnames, - QString *brdnames, bool *loadArray ); - void copyWidgetConfig( int sourceID, int destID, QString *pixnames, - QString *brdnames ); - /** - * Makes a full color group based on the given foreground and background - * colors. This is the same code used by KDE (kapp.cpp) in previous - * versions. - */ - QColorGroup* makeColorGroup( QColor &fg, QColor &bg, - Qt::GUIStyle style = Qt::WindowsStyle ); - OThemePixmap* scale( int w, int h, WidgetType widget ); - OThemePixmap* scaleBorder( int w, int h, WidgetType type ); - OThemePixmap* gradient( int w, int h, WidgetType widget ); - OThemePixmap* blend( WidgetType widget ); - void generateBorderPix( int i ); - void applyResourceGroup( Config *config, int i, QString *copyfrom, QString *pixnames, QString *brdnames ); - void applyMiscResourceGroup( Config *config ); - void readResourceGroup( int i, QString *copyfrom, QString *pixnames, QString *brdnames, - bool *loadArray ); - void readMiscResourceGroup(); - /** - * Attempts to load a pixmap from the default OThemeBase locations. - */ - OThemePixmap* loadPixmap( QString &name ); - /** - * Attempts to load a image from the default OThemeBase locations. - */ - QImage* loadImage( QString &name ); + /** + * Returns a QImage for the given widget if the widget is scaled, NULL + * otherwise. QImages of the original pixmap are stored for scaled + * widgets in order to facilitate fast and accurate smooth-scaling. This + * also saves us a conversion from a pixmap to an image then back again. + */ + QImage* image( WidgetType widget ) const; + /** + * Returns the gradient high color if one is specified, NULL otherwise. + */ + QColor* gradientHigh( WidgetType widget ) const; + /** + * Returns the gradient low color if one is specified, NULL otherwise. + */ + QColor* gradientLow( WidgetType widget ) const; + /** + * Reads in all the configuration file entries supported. + * + * @param colorStyle The style for the color groups. In KDE, colors were + * calculated a little differently for Motif vs Windows styles. This + * is obsolete. + */ + void readConfig( Qt::GUIStyle colorStyle = Qt::WindowsStyle ); + void readWidgetConfig( int i, Config *config, QString *pixnames, + QString *brdnames, bool *loadArray ); + void copyWidgetConfig( int sourceID, int destID, QString *pixnames, + QString *brdnames ); + /** + * Makes a full color group based on the given foreground and background + * colors. This is the same code used by KDE (kapp.cpp) in previous + * versions. + */ + QColorGroup* makeColorGroup( QColor &fg, QColor &bg, + Qt::GUIStyle style = Qt::WindowsStyle ); + OThemePixmap* scale( int w, int h, WidgetType widget ); + OThemePixmap* scaleBorder( int w, int h, WidgetType type ); + OThemePixmap* gradient( int w, int h, WidgetType widget ); + OThemePixmap* blend( WidgetType widget ); + void generateBorderPix( int i ); + void applyResourceGroup( Config *config, int i, QString *copyfrom, QString *pixnames, QString *brdnames ); + void applyMiscResourceGroup( Config *config ); + void readResourceGroup( int i, QString *copyfrom, QString *pixnames, QString *brdnames, + bool *loadArray ); + void readMiscResourceGroup(); + /** + * Attempts to load a pixmap from the default OThemeBase locations. + */ + OThemePixmap* loadPixmap( QString &name ); + /** + * Attempts to load a image from the default OThemeBase locations. + */ + QImage* loadImage( QString &name ); private: - SButton sbPlacement; - ArrowStyle arrowStyle; - ShadeStyle shading; - int defaultFrame; - int btnXShift, btnYShift; - int sliderLen; - int splitterWidth; - int focus3DOffset; - int sbExtent; - bool smallGroove; - bool roundedButton, roundedCombo, roundedSlider; - bool aTabLine, iTabLine; - bool focus3D; - OThemeCache *cache; - int cacheSize; - QString configFileName; - QString configFilePath; + SButton sbPlacement; + ArrowStyle arrowStyle; + ShadeStyle shading; + int defaultFrame; + int btnXShift, btnYShift; + int sliderLen; + int splitterWidth; + int focus3DOffset; + int sbExtent; + bool smallGroove; + bool roundedButton, roundedCombo, roundedSlider; + bool aTabLine, iTabLine; + bool focus3D; + OThemeCache *cache; + int cacheSize; + QString configFileName; + QString configFilePath; protected: - QColor fgcolor, bgcolor, selfgcolor, selbgcolor, winfgcolor, winbgcolor; + QColor fgcolor, bgcolor, selfgcolor, selbgcolor, winfgcolor, winbgcolor; private: - /** - * The theme pixmaps. Many of these may be NULL if no pixmap is specified. - * There may also be duplicate pixmap pointers if more than one widget - * uses the same tiled pixmap. If a pixmap is tiled, it is kept here and - * this acts as a cache. Otherwise this will hold whatever the last scaled - * pixmap was. - */ - OThemePixmap *pixmaps[ WIDGETS ]; - /** - * The theme images. These are for scaled images and are kept in order - * to maintain fast smoothscaling. - */ - QImage *images[ WIDGETS ]; - /** - * The border widths - */ - unsigned char borders[ WIDGETS ]; - /** - * The highlight widths - */ - unsigned char highlights[ WIDGETS ]; - /** - * The scale hints for pixmaps and gradients. - */ - ScaleHint scaleHints[ WIDGETS ]; - /** - * All the color groups. - */ - QColorGroup *colors[ WIDGETS ]; - /** - * Gradient low colors (or blend background). - */ - QColor *grLowColors[ WIDGETS ]; - /** - * Gradient high colors. - */ - QColor *grHighColors[ WIDGETS ]; - /** - * Gradient types. - */ - Gradient gradients[ WIDGETS ]; - /** - * Blend intensity factors - */ - float blends[ WIDGETS ]; - /** - * Bevel contrasts - */ - unsigned char bContrasts[ WIDGETS ]; - /** - * Duplicate pixmap entries (used during destruction). - */ - bool duplicate[ WIDGETS ]; - /** - * Pixmapped border widths - */ - int pbWidth[ WIDGETS ]; - /** - * Pixmapped borders - */ - OThemePixmap *pbPixmaps[ WIDGETS ]; - /** - * Duplicate border pixmapped border entries - */ - bool pbDuplicate[ WIDGETS ]; + /** + * The theme pixmaps. Many of these may be NULL if no pixmap is specified. + * There may also be duplicate pixmap pointers if more than one widget + * uses the same tiled pixmap. If a pixmap is tiled, it is kept here and + * this acts as a cache. Otherwise this will hold whatever the last scaled + * pixmap was. + */ + OThemePixmap *pixmaps[ WIDGETS ]; + /** + * The theme images. These are for scaled images and are kept in order + * to maintain fast smoothscaling. + */ + QImage *images[ WIDGETS ]; + /** + * The border widths + */ + unsigned char borders[ WIDGETS ]; + /** + * The highlight widths + */ + unsigned char highlights[ WIDGETS ]; + /** + * The scale hints for pixmaps and gradients. + */ + ScaleHint scaleHints[ WIDGETS ]; + /** + * All the color groups. + */ + QColorGroup *colors[ WIDGETS ]; + /** + * Gradient low colors (or blend background). + */ + QColor *grLowColors[ WIDGETS ]; + /** + * Gradient high colors. + */ + QColor *grHighColors[ WIDGETS ]; + /** + * Gradient types. + */ + Gradient gradients[ WIDGETS ]; + /** + * Blend intensity factors + */ + float blends[ WIDGETS ]; + /** + * Bevel contrasts + */ + unsigned char bContrasts[ WIDGETS ]; + /** + * Duplicate pixmap entries (used during destruction). + */ + bool duplicate[ WIDGETS ]; + /** + * Pixmapped border widths + */ + int pbWidth[ WIDGETS ]; + /** + * Pixmapped borders + */ + OThemePixmap *pbPixmaps[ WIDGETS ]; + /** + * Duplicate border pixmapped border entries + */ + bool pbDuplicate[ WIDGETS ]; private: - class OThemeBasePrivate; - OThemeBasePrivate *d; + class OThemeBasePrivate; + OThemeBasePrivate *d; @@ -571,3 +576,3 @@ inline bool OThemeBase::isPixmap( WidgetType widget ) const { - return ( pixmaps[ widget ] != NULL || gradients[ widget ] != GrNone ); + return ( pixmaps[ widget ] != NULL || gradients[ widget ] != GrNone ); } @@ -576,3 +581,3 @@ inline bool OThemeBase::isColor( WidgetType widget ) const { - return ( colors[ widget ] != NULL ); + return ( colors[ widget ] != NULL ); } @@ -581,3 +586,3 @@ inline bool OThemeBase::is3DFocus() const { - return ( focus3D ); + return ( focus3D ); } @@ -586,3 +591,3 @@ inline int OThemeBase::focusOffset() const { - return ( focus3DOffset ); + return ( focus3DOffset ); } @@ -591,3 +596,3 @@ inline int OThemeBase::bevelContrast( WidgetType widget ) const { - return ( bContrasts[ widget ] ); + return ( bContrasts[ widget ] ); } @@ -596,3 +601,3 @@ inline OThemeBase::ScaleHint OThemeBase::scaleHint( WidgetType widget ) const { - return ( ( widget < WIDGETS ) ? scaleHints[ widget ] : TileScale ); + return ( ( widget < WIDGETS ) ? scaleHints[ widget ] : TileScale ); } @@ -601,3 +606,3 @@ inline OThemeBase::Gradient OThemeBase::gradientHint( WidgetType widget ) const { - return ( ( widget < WIDGETS ) ? gradients[ widget ] : GrNone ); + return ( ( widget < WIDGETS ) ? gradients[ widget ] : GrNone ); } @@ -606,3 +611,3 @@ inline OThemePixmap* OThemeBase::uncached( WidgetType widget ) const { - return ( pixmaps[ widget ] ); + return ( pixmaps[ widget ] ); } @@ -613,6 +618,6 @@ inline QBrush OThemeBase::pixmapBrush( const QColorGroup &group, { - if ( pixmaps[ widget ] || images[ widget ] ) - return ( QBrush( group.color( role ), *scalePixmap( w, h, widget ) ) ); - else - return ( group.color( role ) ); + if ( pixmaps[ widget ] || images[ widget ] ) + return ( QBrush( group.color( role ), *scalePixmap( w, h, widget ) ) ); + else + return ( group.color( role ) ); } @@ -622,3 +627,3 @@ inline const QColorGroup* OThemeBase::colorGroup( const QColorGroup &defaultGrou { - return ( ( colors[ widget ] ) ? colors[ widget ] : &defaultGroup ); + return ( ( colors[ widget ] ) ? colors[ widget ] : &defaultGroup ); } @@ -627,3 +632,3 @@ inline int OThemeBase::borderWidth( WidgetType widget ) const { - return ( pbWidth[ widget ] ? pbWidth[ widget ] : borders[ widget ] ); + return ( pbWidth[ widget ] ? pbWidth[ widget ] : borders[ widget ] ); } @@ -632,3 +637,3 @@ inline int OThemeBase::pixBorderWidth( WidgetType widget ) const { - return ( pbWidth[ widget ] ); + return ( pbWidth[ widget ] ); } @@ -637,3 +642,3 @@ inline int OThemeBase::highlightWidth( WidgetType widget ) const { - return ( pbWidth[ widget ] ? 0 : highlights[ widget ] ); + return ( pbWidth[ widget ] ? 0 : highlights[ widget ] ); } @@ -642,3 +647,3 @@ inline int OThemeBase::decoWidth( WidgetType widget ) const { - return ( pbWidth[ widget ] ? pbWidth[ widget ] : borders[ widget ] + highlights[ widget ] ); + return ( pbWidth[ widget ] ? pbWidth[ widget ] : borders[ widget ] + highlights[ widget ] ); } @@ -647,3 +652,3 @@ inline QColor* OThemeBase::gradientHigh( WidgetType widget ) const { - return ( grHighColors[ widget ] ); + return ( grHighColors[ widget ] ); } @@ -652,3 +657,3 @@ inline QColor* OThemeBase::gradientLow( WidgetType widget ) const { - return ( grLowColors[ widget ] ); + return ( grLowColors[ widget ] ); } @@ -657,3 +662,3 @@ inline QImage* OThemeBase::image( WidgetType widget ) const { - return ( images[ widget ] ); + return ( images[ widget ] ); } @@ -662,3 +667,3 @@ inline OThemeBase::SButton OThemeBase::scrollBarLayout() const { - return ( sbPlacement ); + return ( sbPlacement ); } @@ -667,3 +672,3 @@ inline OThemeBase::ArrowStyle OThemeBase::arrowType() const { - return ( arrowStyle ); + return ( arrowStyle ); } @@ -672,3 +677,3 @@ inline OThemeBase::ShadeStyle OThemeBase::shade() const { - return ( shading ); + return ( shading ); } @@ -677,3 +682,3 @@ inline int OThemeBase::frameWidth() const { - return ( defaultFrame ); + return ( defaultFrame ); } @@ -682,3 +687,3 @@ inline int OThemeBase::buttonXShift() const { - return ( btnXShift ); + return ( btnXShift ); } @@ -687,3 +692,3 @@ inline int OThemeBase::splitWidth() const { - return ( splitterWidth ); + return ( splitterWidth ); } @@ -692,3 +697,3 @@ inline int OThemeBase::buttonYShift() const { - return ( btnYShift ); + return ( btnYShift ); } @@ -697,6 +702,6 @@ inline int OThemeBase::sliderButtonLength() const { - if ( isPixmap( Slider ) ) - return ( uncached( Slider ) ->width() ); - else - return ( sliderLen ); + if ( isPixmap( Slider ) ) + return ( uncached( Slider ) ->width() ); + else + return ( sliderLen ); } @@ -705,3 +710,3 @@ inline bool OThemeBase::roundButton() const { - return ( roundedButton ); + return ( roundedButton ); } @@ -710,3 +715,3 @@ inline bool OThemeBase::roundComboBox() const { - return ( roundedCombo ); + return ( roundedCombo ); } @@ -715,3 +720,3 @@ inline bool OThemeBase::roundSlider() const { - return ( roundedSlider ); + return ( roundedSlider ); } @@ -720,3 +725,3 @@ inline bool OThemeBase::activeTabLine() const { - return ( aTabLine ); + return ( aTabLine ); } @@ -725,3 +730,3 @@ inline bool OThemeBase::inactiveTabLine() const { - return ( iTabLine ); + return ( iTabLine ); } @@ -730,3 +735,3 @@ inline int OThemeBase::getSBExtent() const { - return ( sbExtent ); + return ( sbExtent ); } @@ -735,3 +740,3 @@ inline OThemePixmap* OThemeBase::borderPixmap( WidgetType widget ) { - return ( pbPixmaps[ widget ] ); + return ( pbPixmaps[ widget ] ); } |