-rw-r--r-- | noncore/apps/opie-write/qrichtext_p.h | 157 | ||||
-rw-r--r-- | noncore/apps/tableviewer/browsekeyentry.cpp | 53 | ||||
-rw-r--r-- | noncore/apps/tableviewer/db/common.cpp | 165 | ||||
-rw-r--r-- | noncore/apps/tableviewer/db/datacache.cpp | 68 | ||||
-rw-r--r-- | noncore/apps/tableviewer/db/datacache.h | 24 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/browsekeyentry.cpp | 49 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/filterkeyentry.cpp | 42 | ||||
-rw-r--r-- | noncore/apps/tableviewer/ui/tvfilterview.cpp | 55 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/kateconfig.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/zsafe/main.cpp | 25 | ||||
-rw-r--r-- | noncore/apps/zsafe/zlistview.cpp | 11 | ||||
-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 51 |
12 files changed, 361 insertions, 343 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 @@ -51,4 +51,7 @@ // +#include <opie2/odebug.h> +using namespace Opie::Core; + #ifndef QT_H #include "qstring.h" @@ -125,8 +128,8 @@ public: struct CustomData { - QTextFormat *format; - QTextCustomItem *custom; - QString anchorName; - QString anchorHref; + QTextFormat *format; + QTextCustomItem *custom; + QString anchorName; + QString anchorHref; }; @@ -134,6 +137,6 @@ public: union { - QTextFormat* format; - CustomData* custom; + QTextFormat* format; + CustomData* custom; } d; @@ -145,6 +148,6 @@ public: private: QTextStringChar &operator=( const QTextStringChar & ) { - //abort(); - return *this; + //abort(); + return *this; } friend class QComplexText; @@ -209,5 +212,5 @@ inline bool QTextString::isBidi() const { if ( bidiDirty ) - checkBidi(); + checkBidi(); return bidi; } @@ -216,5 +219,5 @@ inline bool QTextString::isRightToLeft() const { if ( bidiDirty ) - checkBidi(); + checkBidi(); return rightToLeft; } @@ -385,5 +388,5 @@ class Q_EXPORT QTextCustomItem public: QTextCustomItem( QTextDocument *p ) - : xpos(0), ypos(-1), width(-1), height(0), parent( p ) + : xpos(0), ypos(-1), width(-1), height(0), parent( p ) {} virtual ~QTextCustomItem(); @@ -439,5 +442,5 @@ class Q_EXPORT QTextImage : public QTextCustomItem public: QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, - QMimeSourceFactory &factory ); + QMimeSourceFactory &factory ); virtual ~QTextImage(); @@ -464,5 +467,5 @@ class Q_EXPORT QTextHorizontalLine : public QTextCustomItem public: QTextHorizontalLine( QTextDocument *p, const QMap<QString, QString> &attr, const QString& context, - QMimeSourceFactory &factory ); + QMimeSourceFactory &factory ); virtual ~QTextHorizontalLine(); @@ -533,9 +536,9 @@ class Q_EXPORT QTextTableCell : public QLayoutItem 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(); @@ -607,5 +610,5 @@ public: void pageBreak( int y, QTextFlow* flow ); 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 ); bool noErase() const { return TRUE; } @@ -685,7 +688,7 @@ class Q_EXPORT QTextDocument : public QObject 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() }; @@ -792,9 +795,9 @@ public: void draw( QPainter *p, const QRect& rect, const QColorGroup &cg, const QBrush *paper = 0 ); 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 ); void registerCustomItem( QTextCustomItem *i, QTextParagraph *p ); @@ -859,5 +862,5 @@ private: bool hasPrefix(const QChar* doc, int length, int pos, const QString& s); 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 ); bool eat(const QChar* doc, int length, int& pos, QChar c); @@ -872,7 +875,7 @@ private: private: struct Q_EXPORT Focus { - QTextParagraph *parag; - int start, len; - QString href; + QTextParagraph *parag; + int start, len; + QString href; }; @@ -932,5 +935,5 @@ class Q_EXPORT QTextDeleteCommand : public QTextCommand 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 ); virtual ~QTextDeleteCommand(); @@ -952,8 +955,8 @@ class Q_EXPORT QTextInsertCommand : public QTextDeleteCommand 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() {} @@ -1012,16 +1015,16 @@ struct Q_EXPORT QTextLineStart QTextLineStart() : y( 0 ), baseLine( 0 ), h( 0 ) #ifndef QT_NO_COMPLEXTEXT - , bidicontext( 0 ) + , bidicontext( 0 ) #endif { } 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 { } #ifndef QT_NO_COMPLEXTEXT 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 @@ -1029,6 +1032,6 @@ struct Q_EXPORT QTextLineStart { #ifndef QT_NO_COMPLEXTEXT - if ( bidicontext && bidicontext->deref() ) - delete bidicontext; + if ( bidicontext && bidicontext->deref() ) + delete bidicontext; #endif } @@ -1036,11 +1039,11 @@ struct Q_EXPORT QTextLineStart #ifndef QT_NO_COMPLEXTEXT 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(); } QBidiContext *context() const { return bidicontext; } @@ -1184,5 +1187,5 @@ 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 ); virtual int topMargin() const; @@ -1247,7 +1250,7 @@ protected: virtual void drawLabel( QPainter* p, int x, int y, int w, int h, int base, const QColorGroup& cg ); 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 ); private: @@ -1316,8 +1319,8 @@ public: 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 void insertLineStart( QTextParagraph *parag, int index, QTextLineStart *ls ); @@ -1380,5 +1383,5 @@ class Q_EXPORT QTextPreProcessor public: enum Ids { - Standard = 0 + Standard = 0 }; @@ -1400,16 +1403,16 @@ class Q_EXPORT QTextFormat 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 }; @@ -1730,5 +1733,5 @@ inline QString QTextDocument::originalText() const { if ( oTextValid ) - return oText; + return oText; return text(); } @@ -1737,5 +1740,5 @@ inline void QTextDocument::setFlow( QTextFlow *f ) { if ( flow_ ) - delete flow_; + delete flow_; flow_ = f; } @@ -1787,9 +1790,9 @@ inline void QTextFormat::removeRef() ref--; if ( !collection ) - return; + return; if ( this == collection->defFormat ) - return; + return; if ( ref == 0 ) - collection->remove( this ); + collection->remove( this ); } @@ -1844,7 +1847,7 @@ 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 ); } @@ -1867,5 +1870,5 @@ inline void QTextParagraph::setEndState( int s ) { if ( s == state ) - return; + return; state = s; } @@ -1884,5 +1887,5 @@ inline int QTextParagraph::paragId() const { if ( id == -1 ) - qWarning( "invalid parag id!!!!!!!! (%p)", (void*)this ); + owarn << "invalid parag id!!!!!!!! (" << (void*)this << ")" << oendl; return id; } @@ -1911,5 +1914,5 @@ inline QTextDocument *QTextParagraph::document() const { if ( hasdoc ) - return (QTextDocument*) docOrPseudo; + return (QTextDocument*) docOrPseudo; return 0; } @@ -1918,5 +1921,5 @@ 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 @@ -17,7 +17,12 @@ ** not clear to you. ** -**********************************************************************/ +**********************************************************************/ #include "browsekeyentry.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qtoolbutton.h> #include <qwidgetstack.h> @@ -29,7 +34,4 @@ #include <qdatetime.h> -//#include <iostream.h> -#include <qheader.h> -// For qWarning(const char *) /*! @@ -43,5 +45,5 @@ /*! - Constructs the widget + Constructs the widget */ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) @@ -81,28 +83,28 @@ 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); h_layout->addWidget(resetButton); @@ -111,5 +113,5 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) /*! - Destructs the widget + Destructs the widget */ TVBrowseKeyEntry::~TVBrowseKeyEntry() @@ -137,6 +139,6 @@ void TVBrowseKeyEntry::changeKeySlot(int id_param) ws->raiseWidget(2); break; - default: - return; + default: + return; } } @@ -147,5 +149,5 @@ void TVBrowseKeyEntry::changeKeySlot(int id_param) void TVBrowseKeyEntry::changeKeyMenuSlot() { - if(ts) + if(ts) keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0))); } @@ -166,5 +168,5 @@ 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); keyMenu->setItemParameter(i, i); @@ -173,6 +175,6 @@ 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 */ void TVBrowseKeyEntry::searchOnText() @@ -229,6 +231,5 @@ void TVBrowseKeyEntry::searchOnText() } default: - qWarning("TVBrowseKeyEntry::searchOnText() " - "cannot work out data type"); + owarn << "TVBrowseKeyEntry::searchOnText() cannot work out data type" << oendl; return; } @@ -240,3 +241,3 @@ void TVBrowseKeyEntry::searchOnText() This signal indicates that a search on key index currentKeyId should be 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 @@ -17,6 +17,6 @@ ** not clear to you. ** -**********************************************************************/ -#include "common.h" +**********************************************************************/ +#include "common.h" #include "datacache.h" @@ -89,5 +89,5 @@ int QStringVector::compareItems(Item a, Item b) QString *qa = (QString *)a; QString *qb = (QString *)b; - + return QString::compare(*qa, *qb); } @@ -95,5 +95,5 @@ 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 */ @@ -321,5 +321,5 @@ void TVVariant::load(QDataStream &s ) break; default: - ofatal << "Unrecognized data type" << oendl; + ofatal << "Unrecognized data type" << oendl; } } @@ -383,5 +383,5 @@ const QString TVVariant::toString() const case Time: return ((QTime*)d->value.ptr)->toString(); - case Int: + case Int: return QString::number(d->value.i); case Invalid: @@ -425,5 +425,5 @@ const QDate TVVariant::toDate() const return QDate(year, month, day); } - + return QDate(); @@ -434,5 +434,5 @@ const QTime TVVariant::toTime() const if(d->typ == Time) return *((QTime *)d->value.ptr); - + if(d->typ == String) { QString q = toString(); @@ -455,5 +455,5 @@ const QTime TVVariant::toTime() const detach(); \ return *((Q##f*)d->value.ptr); } - + TV_VARIANT_AS(String) TV_VARIANT_AS(Date) @@ -561,5 +561,5 @@ bool TVVariant::closer(TVVariant n, TVVariant o) /* Nothing is close to an invalid, so nothing can be closer */ if(d->typ == Invalid) - return FALSE; + return FALSE; /* can't be closer if of different type */ @@ -573,5 +573,5 @@ bool TVVariant::closer(TVVariant n, TVVariant o) switch(type()){ case String: { - /* case for strings is close is a substring.. closer is + /* case for strings is close is a substring.. closer is * earlier alphabetically */ QString qs1 = n.toString().lower(); @@ -583,5 +583,5 @@ 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; return TRUE; @@ -594,11 +594,11 @@ 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; return FALSE; @@ -611,8 +611,8 @@ bool TVVariant::closer(TVVariant n, TVVariant o) /* definition of closer is the least difference in days */ 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; @@ -628,8 +628,8 @@ bool TVVariant::closer(TVVariant n, TVVariant o) /* definition of closer is the least difference in days */ 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; if (diff1 < diff2) @@ -650,5 +650,5 @@ bool TVVariant::close(TVVariant n) /* Nothing is close to an invalid, so nothing can be closer */ if(type() == Invalid) - return FALSE; + return FALSE; /* can't be close if of different type */ @@ -658,5 +658,5 @@ bool TVVariant::close(TVVariant n) switch(type()){ case String: { - /* case for strings is close is a substring.. closer is + /* case for strings is close is a substring.. closer is * earlier alphabetically */ QString qs1 = n.toString().lower(); @@ -667,5 +667,5 @@ bool TVVariant::close(TVVariant n) return TRUE; } - case Int: + case Int: case Date: case Time: @@ -682,5 +682,5 @@ bool TVVariant::close(TVVariant n) \class Key \brief document me! - + document me! */ @@ -689,5 +689,5 @@ 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) { } Key::Key(const Key &other) @@ -698,5 +698,5 @@ Key::Key(const Key &other) } -Key& Key::operator=(const Key& key) +Key& Key::operator=(const Key& key) { kname = key.kname; @@ -778,5 +778,5 @@ void Key::setNewFlag(bool v) Constructs a KeyList */ -KeyList::KeyList() : QIntDict<Key>(20) +KeyList::KeyList() : QIntDict<Key>(20) { setAutoDelete(TRUE); @@ -784,5 +784,5 @@ 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) { KeyListIterator it(k); @@ -823,5 +823,5 @@ bool KeyList::operator!=(const KeyList &other) Returns the number of keys stored in the KeyList */ -int KeyList::getNumFields() const +int KeyList::getNumFields() const { return count(); @@ -848,19 +848,18 @@ int KeyList::addKey(QString name, TVVariant::KeyType type) TVVariant e = TVVariant("0"); 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()); break; 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; } @@ -868,5 +867,5 @@ int KeyList::addKey(QString name, TVVariant::KeyType type) } -void KeyList::setKeyFlags(int i, int flag) +void KeyList::setKeyFlags(int i, int flag) { if(find(i)) @@ -881,5 +880,5 @@ int KeyList::getKeyFlags(int i) const } -bool KeyList::checkNewFlag(int i) const +bool KeyList::checkNewFlag(int i) const { if (find(i)) @@ -888,5 +887,5 @@ bool KeyList::checkNewFlag(int i) const } -void KeyList::setNewFlag(int i, bool f) +void KeyList::setNewFlag(int i, bool f) { if(!find(i)) @@ -895,5 +894,5 @@ void KeyList::setNewFlag(int i, bool f) } -bool KeyList::checkDeleteFlag(int i) const +bool KeyList::checkDeleteFlag(int i) const { if (find(i)) @@ -902,5 +901,5 @@ bool KeyList::checkDeleteFlag(int i) const } -void KeyList::setDeleteFlag(int i, bool f) +void KeyList::setDeleteFlag(int i, bool f) { if(!find(i)) @@ -919,5 +918,5 @@ QString KeyList::getKeyName(int i) const } -void KeyList::setKeyName(int i, const QString &n) +void KeyList::setKeyName(int i, const QString &n) { if(find(i)) @@ -935,5 +934,5 @@ TVVariant::KeyType KeyList::getKeyType(int i) const } -void KeyList::setKeyType(int i, TVVariant::KeyType t) +void KeyList::setKeyType(int i, TVVariant::KeyType t) { if(!find(i)) @@ -1041,7 +1040,7 @@ 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 */ DataElem::DataElem(DBStore *c) : values(20) @@ -1087,5 +1086,5 @@ QDataStream &operator>>( QDataStream &s, DataElem &d) s >> size; /* redundent data but makes streaming easier */ if (size != d.getNumFields()) { - owarn << "DataSize mis-match" << oendl; + owarn << "DataSize mis-match" << oendl; return s; /* sanity check failed.. don't load */ } @@ -1110,10 +1109,10 @@ KeyList DataElem::getKeys() const } -/*! +/*! This function determines whether field index i of the element has been set yet. - \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(int i) const @@ -1121,17 +1120,17 @@ bool DataElem::hasValidValue(int i) const if(!values.find(i)) return FALSE; - if(!contained->getKeys()->validIndex(i)) + if(!contained->getKeys()->validIndex(i)) return FALSE; return values.find(i)->isValid(); } -/*! +/*! This function determines whether field name qs of the element has been set yet. - \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 { int i = contained->getKeyIndex(qs); @@ -1140,5 +1139,5 @@ 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 { return contained->getKeyType(i); @@ -1152,7 +1151,7 @@ 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) */ TVVariant DataElem::getField(int i) const @@ -1163,7 +1162,7 @@ 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) */ TVVariant DataElem::getField(QString qs) const @@ -1180,5 +1179,5 @@ TVVariant DataElem::getField(QString qs) const \param q a string that can be parsed to get the value to be set */ -void DataElem::setField(int i, QString q) +void DataElem::setField(int i, QString q) { /* from the type of the field, parse q and store */ @@ -1209,7 +1208,5 @@ 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; } } @@ -1220,7 +1217,7 @@ 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) { if (value.isValid()) { @@ -1237,5 +1234,5 @@ void DataElem::setField(int i, TVVariant value) \param q a string that can be parsed to get the value to be set */ -void DataElem::setField(QString qs, QString q) +void DataElem::setField(QString qs, QString q) { /* from the type of the field, parse q and store */ @@ -1249,5 +1246,5 @@ 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 */ void DataElem::setField(QString qs, TVVariant value) @@ -1268,5 +1265,5 @@ void DataElem::unsetField(QString qs) /*! - Converts the data element to a Rich Text QString + Converts the data element to a Rich Text QString */ QString DataElem::toQString() const @@ -1291,5 +1288,5 @@ 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 { if(hasValidValue(i)) { @@ -1299,5 +1296,5 @@ 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 { QString scratch = ""; @@ -1314,5 +1311,5 @@ QString DataElem::toSortableQString(int i) const case TVVariant::Date: { static QDate epochD(1800, 1, 1); - scratch.sprintf("%08d", + scratch.sprintf("%08d", epochD.daysTo(getField(i).toDate())); break; @@ -1320,5 +1317,5 @@ QString DataElem::toSortableQString(int i) const case TVVariant::Time: { static QTime epochT(0, 0, 0); - scratch.sprintf("%08d", + scratch.sprintf("%08d", epochT.msecsTo(getField(i).toTime())); break; @@ -1381,10 +1378,10 @@ bool DataElem::contains(int i, TVVariant v) const /* meaningless for time */ /* meaningless for dates */ - case TVVariant::Int: + case TVVariant::Int: case TVVariant::Time: case TVVariant::Date: break; default: - owarn << "Tried to compare unknown data type" << oendl; + owarn << "Tried to compare unknown data type" << oendl; } return FALSE; @@ -1407,10 +1404,10 @@ bool DataElem::startsWith(int i, TVVariant v) const /* meaningless for time */ /* meaningless for dates */ - case TVVariant::Int: + case TVVariant::Int: case TVVariant::Time: case TVVariant::Date: return FALSE; default: - owarn << "Tried to compare unknown data type" << oendl; + owarn << "Tried to compare unknown data type" << oendl; } return FALSE; @@ -1433,10 +1430,10 @@ bool DataElem::endsWith(int i, TVVariant v) const /* meaningless for time */ /* meaningless for dates */ - case TVVariant::Int: + case TVVariant::Int: case TVVariant::Time: case TVVariant::Date: return FALSE; default: - owarn << "Tried to compare unknown data type" << oendl; + owarn << "Tried to compare unknown data type" << oendl; } return FALSE; @@ -1447,7 +1444,7 @@ bool DataElem::endsWith(int i, TVVariant v) const parameter. - \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> <LI>FALSE if the first element is not a closer match to the target than @@ -1457,5 +1454,5 @@ bool DataElem::endsWith(int i, TVVariant v) const bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column) { - int type; + int type; if(!d1) return FALSE; @@ -1470,9 +1467,9 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column) if (type != d2->getField(column).type()) { /* can't do compare */ - owarn << "Tried to compare two incompatable types" << oendl; + owarn << "Tried to compare two incompatable types" << oendl; return FALSE; } 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 @@ -17,5 +17,5 @@ ** not clear to you. ** -**********************************************************************/ +**********************************************************************/ /* * This file is used to load the xml files that represent the database. @@ -64,8 +64,8 @@ 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) */ void DBStore::freeTable() @@ -94,5 +94,5 @@ 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. @@ -102,5 +102,5 @@ DBStore::~DBStore() 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) { freeTable(); @@ -110,12 +110,12 @@ bool DBStore::openSource(QIODevice *inDev, const QString &source) { archive = new DBXml(this); } else if (source == "text/csv") { - archive = new DBCsv(this); + archive = new DBCsv(this); } else - return false; + return false; return (archive->openSource(inDev)); } -bool DBStore::saveSource(QIODevice *outDev, const QString &source) +bool DBStore::saveSource(QIODevice *outDev, const QString &source) { /* saving a new file */ @@ -123,8 +123,8 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) if (source == "text/x-xml-tableviewer") { 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; } @@ -134,8 +134,8 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) if (source == "text/x-xml-tableviewer") { 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; } @@ -143,5 +143,5 @@ bool DBStore::saveSource(QIODevice *outDev, const QString &source) } -/*! +/*! This function is used to add new elements to the database. If the database has already reached the maximum allowable size this function does not alter @@ -157,7 +157,7 @@ void DBStore::addItem(DataElem *delem) 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; } @@ -186,11 +186,11 @@ 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; + } } @@ -202,5 +202,5 @@ void DBStore::removeItem(DataElem *r) void DBStore::setName(const QString &n) { - name = n; + name = n; } @@ -212,9 +212,9 @@ void DBStore::setName(const QString &n) QString DBStore::getName() { - return name; + return name; } /*! - 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. @@ -236,5 +236,5 @@ 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 */ void DBStore::first() @@ -244,5 +244,5 @@ 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 */ void DBStore::last() @@ -258,5 +258,5 @@ 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 elem will change it from invalid to valid) */ @@ -279,5 +279,5 @@ bool DBStore::previous() /* was valid */ 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 */ current_elem = new_current_elem; @@ -289,12 +289,12 @@ 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 \return a pointer to the current data element */ -DataElem *DBStore::getCurrentData() +DataElem *DBStore::getCurrentData() { - if (current_elem >= number_elems) + if (current_elem >= number_elems) return NULL; return master_table[current_elem]; 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 @@ -28,7 +28,13 @@ #define __DATACACHE_H__ +#include "common.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qstring.h> #include <qvector.h> -#include "common.h" class DBStore; @@ -46,10 +52,10 @@ public: virtual bool openSource(QIODevice *) { - qWarning("DBAccess::openSource not yet implemented"); + owarn << "DBAccess::openSource not yet implemented" << oendl; return false; } virtual bool saveSource(QIODevice *) { - qWarning("DBAccess::saveSource(QString) not yet implemented"); + owarn << "DBAccess::saveSource(QString) not yet implemented" << oendl; return false; } @@ -71,5 +77,5 @@ public: void addItem(DataElem *); void addItemInternal(DataElem *); - void removeItem(DataElem *); + void removeItem(DataElem *); // Set the name of the database @@ -107,13 +113,13 @@ public: void last(); - bool next(); - bool previous(); + bool next(); + bool previous(); - DataElem* getCurrentData(); + DataElem* getCurrentData(); private: /* does the work of freeing used memory */ void freeTable(); - QString name; + QString name; QVector<DataElem> master_table; @@ -124,5 +130,5 @@ private: unsigned int number_elems; 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. */ unsigned int current_elem; 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 @@ -17,8 +17,11 @@ ** not clear to you. ** -**********************************************************************/ +**********************************************************************/ #include "browsekeyentry.h" #include "commonwidgets.h" +#include <opie2/odebug.h> +using namespace Opie::Core; + #include <qtoolbutton.h> #include <qwidgetstack.h> @@ -30,7 +33,4 @@ #include <qdatetime.h> -#include <qheader.h> -// For qWarning(const char *) - /*! \class TVBrowseKeyEntry @@ -43,5 +43,5 @@ /*! - Constructs the widget + Constructs the widget */ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) @@ -74,16 +74,16 @@ 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())); @@ -92,16 +92,16 @@ TVBrowseKeyEntry::TVBrowseKeyEntry(QWidget *parent, const char *name, WFlags f) h_layout->addWidget(changeKeyButton); - 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())); } /*! - Destructs the widget + Destructs the widget */ TVBrowseKeyEntry::~TVBrowseKeyEntry() @@ -127,5 +127,5 @@ void TVBrowseKeyEntry::changeKeySlot(int id_param) void TVBrowseKeyEntry::changeKeyMenuSlot() { - if(ts) + if(ts) keyMenu->exec(changeKeyButton->mapToGlobal(QPoint(0,0))); } @@ -147,5 +147,5 @@ 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); keyMenu->setItemParameter(i, it.currentKey()); @@ -164,6 +164,6 @@ 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 */ void TVBrowseKeyEntry::searchOnText() @@ -190,9 +190,8 @@ void TVBrowseKeyEntry::searchOnText() break; } - 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; } @@ -204,3 +203,3 @@ void TVBrowseKeyEntry::searchOnText() This signal indicates that a search on key index currentKeyId should be 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 @@ -17,8 +17,13 @@ ** not clear to you. ** -**********************************************************************/ +**********************************************************************/ #include "filterkeyentry.h" #include "commonwidgets.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qwidgetstack.h> #include <qcombobox.h> @@ -99,11 +104,11 @@ 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())); @@ -120,5 +125,5 @@ TVFilterKeyEntry::TVFilterKeyEntry(QWidget *parent, const char *name, WFlags f) /*! - Destructs the widget + Destructs the widget */ TVFilterKeyEntry::~TVFilterKeyEntry() @@ -126,5 +131,5 @@ TVFilterKeyEntry::~TVFilterKeyEntry() } -void TVFilterKeyEntry::setKey(int i) +void TVFilterKeyEntry::setKey(int i) { @@ -184,23 +189,22 @@ 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; } default: { 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 @@ -19,4 +19,11 @@ **********************************************************************/ #include "tvfilterview.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/qpeapplication.h> +using namespace Opie::Core; + +/* QT */ #include <qtoolbutton.h> #include <qcombobox.h> @@ -27,11 +34,10 @@ #include <qlabel.h> -#include <qpe/qpeapplication.h> TVFilterView::TVFilterView(TableState *t, QWidget* parent, const char *name, WFlags fl ) : QDialog(parent, name, TRUE, fl) { - if ( !name ) - setName( "Filter View" ); + if ( !name ) + setName( "Filter View" ); QVBoxLayout *vlayout = new QVBoxLayout(this); @@ -89,6 +95,6 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() )); - connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, - SLOT(setTerm(QListViewItem*))); + connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, + SLOT(setTerm(QListViewItem*))); ts = t; @@ -103,5 +109,5 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, /*! - Destroys the TVFilterView widget + Destroys the TVFilterView widget */ TVFilterView::~TVFilterView() @@ -119,5 +125,5 @@ void TVFilterView::reset() } -void TVFilterView::rebuildKeys() +void TVFilterView::rebuildKeys() { int i; @@ -126,5 +132,5 @@ void TVFilterView::rebuildKeys() if(!ts->kRep) return; keyEntry->setTableState(ts); - + /* set up the list of keys that can be compared on */ keyNameCombo->clear(); @@ -133,10 +139,10 @@ void TVFilterView::rebuildKeys() i = 0; 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; } } @@ -147,5 +153,5 @@ bool TVFilterView::passesFilter(DataElem *d) { FilterTerm *t; - + for (t = terms.first(); t != 0; t = terms.next() ) { /* check against filter */ @@ -176,6 +182,5 @@ bool TVFilterView::passesFilter(DataElem *d) { break; default: - qWarning("TVFilterView::passesFilter() " - "unrecognized filter type"); + owarn << "TVFilterView::passesFilter() unrecognized filter type" << oendl; return false; } @@ -195,5 +200,5 @@ bool TVFilterView::filterActive() const /* SLOTS */ -void TVFilterView::newTerm() +void TVFilterView::newTerm() { if (!ts) return; @@ -213,5 +218,5 @@ void TVFilterView::newTerm() } -void TVFilterView::updateTerm() +void TVFilterView::updateTerm() { FilterTerm *term; @@ -232,5 +237,5 @@ void TVFilterView::updateTerm() term->ct = keyEntry->getCompareType(), term->value = keyEntry->getCompareValue(); - + keyString = keyNameCombo->currentText(); @@ -261,5 +266,5 @@ void TVFilterView::updateTerm() /* remove old view */ - if (term->view) + if (term->view) delete(term->view); term->view = new QListViewItem(display, 0, keyString, cmpString, vString); @@ -268,5 +273,5 @@ void TVFilterView::updateTerm() /* deletes current term */ -void TVFilterView::deleteTerm() +void TVFilterView::deleteTerm() { if(!current) return; @@ -285,5 +290,5 @@ void TVFilterView::deleteTerm() /* clears all terminations */ -void TVFilterView::clearTerms() +void TVFilterView::clearTerms() { while(current) @@ -293,5 +298,5 @@ void TVFilterView::clearTerms() 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 */ FilterTerm *term = current; @@ -302,5 +307,5 @@ 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 @@ -25,4 +25,5 @@ #include <opie2/odebug.h> #include <qpe/global.h> +using namespace Opie::Core; /* QT */ @@ -557,6 +558,5 @@ void KateConfig::write( const QString &fn ) // now rename the file... 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 @@ -9,4 +9,10 @@ #include "zsafe.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #ifdef DESKTOP #include <qapplication.h> @@ -14,4 +20,6 @@ #include <qpe/qpeapplication.h> #endif + +/* STD */ #include <stdio.h> #include <signal.h> @@ -59,8 +67,8 @@ int main( int argc, char ** argv ) DeskH = atoi(argv[2]); #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; #endif @@ -75,17 +83,14 @@ int main( int argc, char ** argv ) DeskH = a.desktop()->height(); - char buf[128]; - sprintf (buf, "Width: %d Height: %d\n", DeskW, DeskH); - qWarning (buf); + owarn << "Width: " << DeskW << " Height: " << DeskH << oendl; #ifdef JPATCH_HDE // nothings #else - if (DeskW > 240) + if (DeskW > 240) { DeskW -= 20; DeskH += 25; - sprintf (buf, "Changed width: %d Height: %d\n", DeskW, DeskH); - qWarning (buf); + owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl; } #endif 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 @@ -4,7 +4,12 @@ #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) { @@ -19,7 +24,5 @@ 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 @@ -882,5 +882,5 @@ void ZSafe::findPwd() username = dialog->UsernameField->text(); comment = dialog->CommentField->text(); - qWarning (name); + owarn << name << oendl; } else @@ -928,5 +928,5 @@ void ZSafe::findPwd() i = i->nextSibling()) { - qWarning (i->text(0)); + owarn << i->text(0) << oendl; i->setSelected(FALSE); @@ -942,5 +942,5 @@ void ZSafe::findPwd() si = si->nextSibling()) { - qWarning (si->text(0)); + owarn << si->text(0) << oendl; if (si->isSelected()) si->setSelected(FALSE); @@ -959,5 +959,5 @@ void ZSafe::findPwd() if ((n && u && c ) && !found) { - qWarning ("Found"); + owarn << "Found" << oendl; selectedItem = si; si->setSelected(TRUE); @@ -1229,6 +1229,5 @@ void ZSafe::removeAsciiFile() if ( !f.remove() ) { - qWarning( QString("Could not remove file %1").arg(fn), - 2000 ); + owarn << "Could not remove file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), tr("Could not remove text file.") ); @@ -1279,6 +1278,5 @@ void ZSafe::writeAllEntries() QFile f( fn ); 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", QString("Could not export to text file.") ); @@ -1323,8 +1321,8 @@ void ZSafe::writeAllEntries() oneEntry += si->text(5); oneEntry += "\""; - // qWarning (oneEntry); + // owarn << oneEntry << oendl; t << oneEntry << endl; - // qWarning (si->text(0)); + // owarn << si->text(0) << oendl; } } @@ -1374,6 +1372,5 @@ void ZSafe::readAllEntries() if ( !f.open( IO_ReadOnly ) ) { - qWarning( QString("Could not read file %1").arg(fn), - 2000 ); + owarn << "Could not read file " << fn << oendl; QMessageBox::critical( 0, "ZSafe", QString("Could not import text file.") ); @@ -1404,5 +1401,5 @@ void ZSafe::readAllEntries() } - qWarning ("ReadAllEntries(): "); + owarn << "ReadAllEntries(): " << oendl; QTextStream t(&f); @@ -1555,6 +1552,5 @@ void ZSafe::writeAllEntries() QFile f( fn ); 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"), tr("Could not export to text file.") ); @@ -1594,8 +1590,8 @@ void ZSafe::writeAllEntries() oneEntry += comment; oneEntry += "\""; - // qWarning (oneEntry); + // owarn << oneEntry << oendl; t << oneEntry << endl; - // qWarning (si->text(0)); + // owarn << si->text(0) << oendl; } } @@ -1609,6 +1605,5 @@ void ZSafe::readAllEntries() if ( !f.open( IO_ReadOnly ) ) { - qWarning( QString("Could not read file %1").arg(fn), - 2000 ); + owarn << "Could not read file " << fn << oendl; QMessageBox::critical( 0, tr("ZSafe"), tr("Could not import text file.") ); @@ -1639,5 +1634,5 @@ void ZSafe::readAllEntries() } - qWarning ("ReadAllEntries(): "); + owarn << "ReadAllEntries(): " << oendl; QTextStream t(&f); @@ -1763,5 +1758,5 @@ void ZSafe::readAllEntries() void ZSafe::resume(int) { - qWarning ("Resume"); + owarn << "Resume" << oendl; // hide the main window @@ -1819,5 +1814,5 @@ bool ZSafe::openDocument(const char* _filename, const char* ) if (m_password.isEmpty() && validationFlag == 0) { - qWarning ("Wrong password"); + owarn << "Wrong password" << oendl; QMessageBox::critical( 0, tr("ZSafe"), tr("Wrong password.\n\nZSafe will now exit.") ); @@ -1828,5 +1823,5 @@ bool ZSafe::openDocument(const char* _filename, const char* ) if (retval != PWERR_GOOD) { - qWarning ("Error loading Document"); + owarn << "Error loading Document" << oendl; return false; } @@ -2302,5 +2297,5 @@ void ZSafe::setPasswordDialogDone() void ZSafe::getDocPassword(QString title) { -qWarning ("getDocPassword"); + owarn << "getDocPassword" << oendl; // open the 'Password' dialog PasswordForm *dialog = new PasswordForm(this, title, TRUE); @@ -2481,5 +2476,5 @@ int ZSafe::saveFinalize(void) void ZSafe::quitMe () { - qWarning ("QUIT..."); + owarn << "QUIT..." << oendl; if (modified) @@ -2685,5 +2680,5 @@ void ZSafe::addCategory() icon = dialog->IconField->currentText()+".png"; - qWarning (category); + owarn << category << oendl; QListViewItem *li = new ShadedListItem( 1, ListView ); @@ -3193,5 +3188,5 @@ void ZSafe::editCategory() if (catItem) { - qWarning (category); + owarn << category << oendl; catItem->setText( 0, tr( category ) ); cat->setCategoryName (tr(category)); @@ -3594,5 +3589,5 @@ void ZSafe::paintEvent( QPaintEvent * ) void ZSafe::resizeEvent ( QResizeEvent * ) { - // qWarning ("resizeEvent"); + // owarn << "resizeEvent" << oendl; #ifndef DESKTOP DeskW = appl->desktop()->width(); |