author | ar <ar> | 2004-05-27 22:04:46 (UTC) |
---|---|---|
committer | ar <ar> | 2004-05-27 22:04:46 (UTC) |
commit | 4f7c3c4d0d634706d13950b3827714b168e279e3 (patch) (side-by-side diff) | |
tree | 2df448e7a4dcd538c26365873e194be2b55e83b7 /noncore/apps/tinykate | |
parent | 46f81a089ba8febdb79e0d150b69f74bb1ea7d18 (diff) | |
download | opie-4f7c3c4d0d634706d13950b3827714b168e279e3.zip opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.gz opie-4f7c3c4d0d634706d13950b3827714b168e279e3.tar.bz2 |
- convert qDebug to odebug
-rw-r--r-- | noncore/apps/tinykate/libkate/document/katedocument.h | 2 | ||||
-rw-r--r-- | noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp | 80 |
2 files changed, 44 insertions, 38 deletions
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.h b/noncore/apps/tinykate/libkate/document/katedocument.h index 9d8ec6a..969be87 100644 --- a/noncore/apps/tinykate/libkate/document/katedocument.h +++ b/noncore/apps/tinykate/libkate/document/katedocument.h @@ -63,33 +63,33 @@ class KateCmd; class CachedFontMetrics : public QFontMetrics { private: short *warray[256]; public: CachedFontMetrics(const QFont& f) : QFontMetrics(f) { for (int i=0; i<256; i++) warray[i]=0; } ~CachedFontMetrics() { for (int i=0; i<256; i++) if (warray[i]) delete[] warray[i]; } int width(QChar c) { uchar cell=c.cell(); uchar row=c.row(); short *wa=warray[row]; if (!wa) { - // qDebug("create row: %d",row); + // odebug << "create row: " << row << oendl; wa=warray[row]=new short[256]; for (int i=0; i<256; i++) wa[i]=-1; } if (wa[cell]<0) wa[cell]=(short) QFontMetrics::width(c); return (int)wa[cell]; } int width(QString s) { return QFontMetrics::width(s); } }; class Attribute { public: Attribute() { ; }; QColor col; QColor selCol; bool bold; diff --git a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp index a2c680f..78635b2 100644 --- a/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp +++ b/noncore/apps/tinykate/libkate/qt3back/qregexp3.cpp @@ -25,46 +25,52 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for ** information about Qt Commercial License Agreements. ** See http://www.trolltech.com/qpl/ for QPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #if QT_VERSION >=300 #error QRegExp3 is now in QT 3 use QRegExp instead #endif -#include "qarray.h" -#include "qbitarray.h" -#include "qcache.h" -#include "qintdict.h" -#include "qmap.h" #if QT_VERSION < 300 #include "./qregexp3.h" #else #include "qregexp.h" #endif -#include "qstring.h" -#include "qtl.h" -#include "qvector.h" +/* OPIE */ +#include <opie2/odebug.h> + +/* QT */ +#include <qarray.h> +#include <qbitarray.h> +#include <qcache.h> +#include <qintdict.h> +#include <qmap.h> +#include <qstring.h> +#include <qtl.h> +#include <qvector.h> + +/* STD */ #include <limits.h> /* WARNING! Be sure to read qregexp.tex before modifying this file. */ /*! \class QRegExp3 qregexp.h \brief The QRegExp class provides pattern matching using regular expressions. \ingroup tools \ingroup misc \ingroup shared @@ -1418,76 +1424,76 @@ void QRegExpEngine::heuristicallyChooseHeuristic() for ( i = 1; i < NumBadChars; i += step ) { if ( occ1[i] == NoOccurrence ) badCharScore += minl; else badCharScore += occ1[i]; } badCharScore /= minl; useGoodStringHeuristic = ( goodStringScore > badCharScore ); } #endif #if defined(QT_DEBUG) void QRegExpEngine::dump() const { int i, j; - qDebug( "Case %ssensitive engine", cs ? "" : "in" ); - qDebug( " States" ); + odebug << "Case " << (cs ? "" : "in") << "sensitive engine" << oendl; + odebug << " States" << oendl; for ( i = 0; i < ns; i++ ) { - qDebug( " %d%s", i, - i == InitialState ? " (initial)" : - i == FinalState ? " (final)" : "" ); + odebug << " " << i + << (i == InitialState ? " (initial)" : i == FinalState ? " (final)" : "") << oendl; + #ifndef QT_NO_REGEXP_CAPTURE - qDebug( " in atom %d", s[i]->atom ); + odebug << " in atom " << s[i]->atom << oendl; #endif int m = s[i]->match; if ( (m & CharClassBit) != 0 ) { - qDebug( " match character class %d", m ^ CharClassBit ); + odebug << " match character class " << (m ^ CharClassBit) << oendl; #ifndef QT_NO_REGEXP_CCLASS cl[m ^ CharClassBit]->dump(); #else - qDebug( " negative character class" ); + odebug << " negative character class" << oendl; #endif } else if ( (m & BackRefBit) != 0 ) { - qDebug( " match back-reference %d", m ^ BackRefBit ); + odebug << " match back-reference " << (m ^ BackRefBit) << oendl; } else if ( m >= 0x20 && m <= 0x7e ) { - qDebug( " match 0x%.4x (%c)", m, m ); + odebug << " match " << QString().sprintf( "0x%.4x", m) << " (" << m << ")" << oendl; + } else { - qDebug( " match 0x%.4x", m ); + odebug << " match " << QString().sprintf( "0x%.4x", m) << oendl; } for ( j = 0; j < (int) s[i]->outs.size(); j++ ) { int next = s[i]->outs[j]; - qDebug( " -> %d", next ); + odebug << " -> " << next << oendl; if ( s[i]->reenter != 0 && s[i]->reenter->contains(next) ) - qDebug( " [reenter %d]", (*s[i]->reenter)[next] ); + odebug << " [reenter " << (*s[i]->reenter)[next] << "]" << oendl; if ( s[i]->anchors != 0 && at(*s[i]->anchors, next) != 0 ) - qDebug( " [anchors 0x%.8x]", (*s[i]->anchors)[next] ); + odebug << " [anchors " << QString().sprintf( "0x%.8x]", (*s[i]->anchors)[next] ) << oendl; } } #ifndef QT_NO_REGEXP_CAPTURE if ( nf > 0 ) { - qDebug( " Atom Parent Capture" ); + odebug << " Atom Parent Capture" << oendl; for ( i = 0; i < nf; i++ ) - qDebug( " %6d %6d %6d", i, f[i].parent, f[i].capture ); + odebug << QString().sprintf(" %6d %6d %6d", i, f[i].parent, f[i].capture ) << oendl; } #endif #ifndef QT_NO_REGEXP_ANCHOR_ALT for ( i = 0; i < (int) aa.size(); i++ ) - qDebug( " Anchor alternation 0x%.8x: 0x%.8x 0x%.9x", i, aa[i].a, - aa[i].b ); + odebug << QString().sprintf(" Anchor alternation 0x%.8x: 0x%.8x 0x%.9x", i, aa[i].a, aa[i].b ) << oendl; #endif } #endif void QRegExpEngine::setup( bool caseSensitive ) { #ifndef QT_NO_REGEXP_OPTIM if ( engCount++ == 0 ) { noOccurrences = new QArray<int>( NumBadChars ); firstOccurrenceAtZero = new QArray<int>( NumBadChars ); noOccurrences->fill( NoOccurrence ); firstOccurrenceAtZero->fill( 0 ); } #endif s.setAutoDelete( TRUE ); s.resize( 32 ); @@ -2183,39 +2189,39 @@ bool QRegExpEngine::CharClass::in( QChar ch ) const return n; #endif if ( c != 0 && (c & (1 << (int) ch.category())) != 0 ) return !n; for ( int i = 0; i < (int) r.size(); i++ ) { if ( ch.unicode() >= r[i].from && ch.unicode() <= r[i].to ) return !n; } return n; } #if defined(QT_DEBUG) void QRegExpEngine::CharClass::dump() const { int i; - qDebug( " %stive character class", n ? "nega" : "posi" ); + odebug << " " << (n ? "nega" : "posi") << "tive character class" << oendl; #ifndef QT_NO_REGEXP_CCLASS if ( c != 0 ) - qDebug( " categories 0x%.8x", c ); + odebug << QString().sprintf(" categories 0x%.8x", c ) << oendl; #endif for ( i = 0; i < (int) r.size(); i++ ) - qDebug( " 0x%.4x through 0x%.4x", r[i].from, r[i].to ); + odebug << QString().sprintf(" 0x%.4x through 0x%.4x", r[i].from, r[i].to ) << oendl; } #endif #endif QRegExpEngine::Box::Box( QRegExpEngine *engine ) : eng( engine ), skipanchors( 0 ) #ifndef QT_NO_REGEXP_OPTIM , earlyStart( 0 ), lateStart( 0 ), maxl( 0 ), occ1( *noOccurrences ) #endif { minl = 0; } QRegExpEngine::Box& QRegExpEngine::Box::operator=( const Box& b ) { eng = b.eng; @@ -2433,48 +2439,48 @@ void QRegExpEngine::Box::setupHeuristics() (112|1)34. */ for ( int i = 0; i < NumBadChars; i++ ) { if ( occ1[i] != NoOccurrence && occ1[i] >= minl ) occ1[i] = minl; } eng->setupBadCharHeuristic( minl, occ1 ); eng->heuristicallyChooseHeuristic(); } #endif #if defined(QT_DEBUG) void QRegExpEngine::Box::dump() const { int i; - qDebug( "Box of at least %d character%s", minl, minl == 1 ? "" : "s" ); - qDebug( " Left states:" ); + odebug << "Box of at least " << minl << " character" << (minl == 1 ? "" : "s") << oendl; + odebug << " Left states:" << oendl; for ( i = 0; i < (int) ls.size(); i++ ) { if ( at(lanchors, ls[i]) == 0 ) - qDebug( " %d", ls[i] ); + odebug << " " << ls[i] << oendl; else - qDebug( " %d [anchors 0x%.8x]", ls[i], lanchors[ls[i]] ); + odebug << " " << ls[i] << QString().sprintf(" [anchors 0x%.8x]", lanchors[ls[i]]) << oendl; } - qDebug( " Right states:" ); + odebug << " Right states:" << oendl; for ( i = 0; i < (int) rs.size(); i++ ) { if ( at(ranchors, ls[i]) == 0 ) - qDebug( " %d", rs[i] ); + odebug << " " << rs[i] << oendl; else - qDebug( " %d [anchors 0x%.8x]", rs[i], ranchors[rs[i]] ); + odebug << " " << rs[i] << QString().sprintf(" [anchors 0x%.8x]", ranchors[rs[i]]) << oendl; } - qDebug( " Skip anchors: 0x%.8x", skipanchors ); + odebug << QString().sprintf(" Skip anchors: 0x%.8x", skipanchors) << oendl; } #endif void QRegExpEngine::Box::addAnchorsToEngine( const Box& to ) const { for ( int i = 0; i < (int) to.ls.size(); i++ ) { for ( int j = 0; j < (int) rs.size(); j++ ) { int a = eng->anchorConcatenation( at(ranchors, rs[j]), at(to.lanchors, to.ls[i]) ); eng->addAnchors( rs[j], to.ls[i], a ); } } } int QRegExpEngine::getChar() { |