author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/opie-write | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
-rw-r--r-- | noncore/apps/opie-write/mainwindow.cpp | 12 | ||||
-rw-r--r-- | noncore/apps/opie-write/opie-write.pro | 3 | ||||
-rw-r--r-- | noncore/apps/opie-write/qcomplextext.cpp | 4 | ||||
-rw-r--r-- | noncore/apps/opie-write/qrichtext.cpp | 28 | ||||
-rw-r--r-- | noncore/apps/opie-write/qrichtext_p.cpp | 15 |
5 files changed, 37 insertions, 25 deletions
diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp index 90e1a70..aa03060 100644 --- a/noncore/apps/opie-write/mainwindow.cpp +++ b/noncore/apps/opie-write/mainwindow.cpp | |||
@@ -20,12 +20,16 @@ | |||
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | |||
24 | /* OPIE */ | ||
25 | #include <opie2/odebug.h> | ||
23 | #include <qpe/fileselector.h> | 26 | #include <qpe/fileselector.h> |
24 | #include <qpe/applnk.h> | 27 | #include <qpe/applnk.h> |
25 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
26 | #include <qpe/fontdatabase.h> | 29 | #include <qpe/fontdatabase.h> |
30 | using namespace Opie::Core; | ||
27 | 31 | ||
28 | //#include "qspellchecker.h" | 32 | /* QT */ |
29 | #include "qtextedit.h" | 33 | #include "qtextedit.h" |
30 | #include <qaction.h> | 34 | #include <qaction.h> |
31 | #include <qtoolbar.h> | 35 | #include <qtoolbar.h> |
@@ -444,7 +448,7 @@ void MainWindow::fileOpen() | |||
444 | 448 | ||
445 | void MainWindow::fileRevert() | 449 | void MainWindow::fileRevert() |
446 | { | 450 | { |
447 | qDebug( "QMainWindow::fileRevert needs to be done" ); | 451 | odebug << "QMainWindow::fileRevert needs to be done" << oendl; |
448 | } | 452 | } |
449 | 453 | ||
450 | void MainWindow::fileNew() | 454 | void MainWindow::fileNew() |
@@ -456,7 +460,7 @@ void MainWindow::fileNew() | |||
456 | 460 | ||
457 | void MainWindow::insertTable() | 461 | void MainWindow::insertTable() |
458 | { | 462 | { |
459 | qDebug( "MainWindow::insertTable() needs to be done" ); | 463 | odebug << "MainWindow::insertTable() needs to be done" << oendl; |
460 | } | 464 | } |
461 | 465 | ||
462 | void MainWindow::newFile( const DocLnk &dl ) | 466 | void MainWindow::newFile( const DocLnk &dl ) |
@@ -475,7 +479,7 @@ void MainWindow::openFile( const DocLnk &dl ) | |||
475 | FileManager fm; | 479 | FileManager fm; |
476 | QString txt; | 480 | QString txt; |
477 | if ( !fm.loadFile( dl, txt ) ) | 481 | if ( !fm.loadFile( dl, txt ) ) |
478 | qDebug( "couldn't open file" ); | 482 | odebug << "couldn't open file" << oendl; |
479 | clear(); | 483 | clear(); |
480 | editorStack->raiseWidget( editor ); | 484 | editorStack->raiseWidget( editor ); |
481 | editor->viewport()->setFocus(); | 485 | editor->viewport()->setFocus(); |
diff --git a/noncore/apps/opie-write/opie-write.pro b/noncore/apps/opie-write/opie-write.pro index 044ce7e..8e514d4 100644 --- a/noncore/apps/opie-write/opie-write.pro +++ b/noncore/apps/opie-write/opie-write.pro | |||
@@ -1,6 +1,5 @@ | |||
1 | 1 | ||
2 | CONFIG += qt warn on quick-app | 2 | CONFIG += qt warn on quick-app |
3 | |||
4 | 3 | ||
5 | HEADERS = qcleanuphandler.h \ | 4 | HEADERS = qcleanuphandler.h \ |
6 | qcomplextext_p.h \ | 5 | qcomplextext_p.h \ |
diff --git a/noncore/apps/opie-write/qcomplextext.cpp b/noncore/apps/opie-write/qcomplextext.cpp index 473f184..00a91c5 100644 --- a/noncore/apps/opie-write/qcomplextext.cpp +++ b/noncore/apps/opie-write/qcomplextext.cpp | |||
@@ -106,7 +106,7 @@ QBidiContext::~QBidiContext() | |||
106 | */ | 106 | */ |
107 | static inline const QChar *prevChar( const QString &str, int pos ) | 107 | static inline const QChar *prevChar( const QString &str, int pos ) |
108 | { | 108 | { |
109 | //qDebug("leftChar: pos=%d", pos); | 109 | //odebug << "leftChar: pos=" << pos << "" << oendl; |
110 | pos--; | 110 | pos--; |
111 | const QChar *ch = str.unicode() + pos; | 111 | const QChar *ch = str.unicode() + pos; |
112 | while( pos > -1 ) { | 112 | while( pos > -1 ) { |
@@ -124,7 +124,7 @@ static inline const QChar *nextChar( const QString &str, int pos) | |||
124 | int len = str.length(); | 124 | int len = str.length(); |
125 | const QChar *ch = str.unicode() + pos; | 125 | const QChar *ch = str.unicode() + pos; |
126 | while( pos < len ) { | 126 | while( pos < len ) { |
127 | //qDebug("rightChar: %d isLetter=%d, joining=%d", pos, ch.isLetter(), ch.joining()); | 127 | //odebug << "rightChar: " << pos << " isLetter=" << ch.isLetter() << ", joining=" << ch.joining() << "" << oendl; |
128 | if( !ch->isMark() ) | 128 | if( !ch->isMark() ) |
129 | return ch; | 129 | return ch; |
130 | // assume it's a transparent char, this might not be 100% correct | 130 | // assume it's a transparent char, this might not be 100% correct |
diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp index b77a0fc..c27eb1e 100644 --- a/noncore/apps/opie-write/qrichtext.cpp +++ b/noncore/apps/opie-write/qrichtext.cpp | |||
@@ -37,11 +37,17 @@ | |||
37 | 37 | ||
38 | #include "qrichtext_p.h" | 38 | #include "qrichtext_p.h" |
39 | 39 | ||
40 | /* OPIE */ | ||
41 | #include <opie2/odebug.h> | ||
42 | using namespace Opie::Core; | ||
43 | |||
44 | /* QT */ | ||
40 | #include "qdragobject.h" | 45 | #include "qdragobject.h" |
41 | #include "qpaintdevicemetrics.h" | 46 | #include "qpaintdevicemetrics.h" |
42 | #include "qdrawutil.h" | 47 | #include "qdrawutil.h" |
43 | #include "qcleanuphandler.h" | 48 | #include "qcleanuphandler.h" |
44 | 49 | ||
50 | /* STD */ | ||
45 | #include <stdlib.h> | 51 | #include <stdlib.h> |
46 | 52 | ||
47 | using namespace Qt3; | 53 | using namespace Qt3; |
@@ -184,7 +190,7 @@ QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) | |||
184 | { | 190 | { |
185 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; | 191 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; |
186 | if ( !s ) { | 192 | if ( !s ) { |
187 | qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); | 193 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; |
188 | return 0; | 194 | return 0; |
189 | } | 195 | } |
190 | 196 | ||
@@ -212,7 +218,7 @@ QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) | |||
212 | { | 218 | { |
213 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; | 219 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; |
214 | if ( !s ) { | 220 | if ( !s ) { |
215 | qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); | 221 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; |
216 | return 0; | 222 | return 0; |
217 | } | 223 | } |
218 | 224 | ||
@@ -1544,10 +1550,10 @@ void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* curso | |||
1544 | QString bg = attr["background"]; | 1550 | QString bg = attr["background"]; |
1545 | const QMimeSource* m = factory_->data( bg, contxt ); | 1551 | const QMimeSource* m = factory_->data( bg, contxt ); |
1546 | if ( !m ) { | 1552 | if ( !m ) { |
1547 | qWarning("QRichText: no mimesource for %s", bg.latin1() ); | 1553 | owarn << "QRichText: no mimesource for " << bg.latin1() << "" << oendl; |
1548 | } else { | 1554 | } else { |
1549 | if ( !QImageDrag::decode( m, img ) ) { | 1555 | if ( !QImageDrag::decode( m, img ) ) { |
1550 | qWarning("QTextImage: cannot decode %s", bg.latin1() ); | 1556 | owarn << "QTextImage: cannot decode " << bg.latin1() << "" << oendl; |
1551 | } | 1557 | } |
1552 | } | 1558 | } |
1553 | if ( !img.isNull() ) { | 1559 | if ( !img.isNull() ) { |
@@ -2152,7 +2158,7 @@ QString QTextDocument::richText() const | |||
2152 | QStyleSheetItem* item_ol = styleSheet()->item("ol"); | 2158 | QStyleSheetItem* item_ol = styleSheet()->item("ol"); |
2153 | QStyleSheetItem* item_li = styleSheet()->item("li"); | 2159 | QStyleSheetItem* item_li = styleSheet()->item("li"); |
2154 | if ( !item_p || !item_ul || !item_ol || !item_li ) { | 2160 | if ( !item_p || !item_ul || !item_ol || !item_li ) { |
2155 | qWarning( "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" ); | 2161 | owarn << "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" << oendl; |
2156 | return QString::null; | 2162 | return QString::null; |
2157 | } | 2163 | } |
2158 | int pastListDepth = 0; | 2164 | int pastListDepth = 0; |
@@ -4096,7 +4102,7 @@ int QTextParagraph::lineHeightOfChar( int i, int *bl, int *y ) const | |||
4096 | --it; | 4102 | --it; |
4097 | } | 4103 | } |
4098 | 4104 | ||
4099 | qWarning( "QTextParagraph::lineHeightOfChar: couldn't find lh for %d", i ); | 4105 | owarn << "QTextParagraph::lineHeightOfChar: couldn't find lh for " << i << "" << oendl; |
4100 | return 15; | 4106 | return 15; |
4101 | } | 4107 | } |
4102 | 4108 | ||
@@ -4122,7 +4128,7 @@ QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) | |||
4122 | --l; | 4128 | --l; |
4123 | } | 4129 | } |
4124 | 4130 | ||
4125 | qWarning( "QTextParagraph::lineStartOfChar: couldn't find %d", i ); | 4131 | owarn << "QTextParagraph::lineStartOfChar: couldn't find " << i << "" << oendl; |
4126 | return 0; | 4132 | return 0; |
4127 | } | 4133 | } |
4128 | 4134 | ||
@@ -4149,7 +4155,7 @@ QTextStringChar *QTextParagraph::lineStartOfLine( int line, int *index ) const | |||
4149 | return &str->at( i ); | 4155 | return &str->at( i ); |
4150 | } | 4156 | } |
4151 | 4157 | ||
4152 | qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line ); | 4158 | owarn << "QTextParagraph::lineStartOfLine: couldn't find " << line << "" << oendl; |
4153 | return 0; | 4159 | return 0; |
4154 | } | 4160 | } |
4155 | 4161 | ||
@@ -5697,7 +5703,7 @@ QTextFormat *QTextFormatCollection::format( const QFont &f, const QColor &c ) | |||
5697 | cachedFormat->collection = this; | 5703 | cachedFormat->collection = this; |
5698 | cKey.insert( cachedFormat->key(), cachedFormat ); | 5704 | cKey.insert( cachedFormat->key(), cachedFormat ); |
5699 | if ( cachedFormat->key() != key ) | 5705 | if ( cachedFormat->key() != key ) |
5700 | qWarning("ASSERT: keys for format not identical: '%s '%s'", cachedFormat->key().latin1(), key.latin1() ); | 5706 | owarn << "ASSERT: keys for format not identical: '" << cachedFormat->key().latin1() << " '" << key.latin1() << "'" << oendl; |
5701 | return cachedFormat; | 5707 | return cachedFormat; |
5702 | } | 5708 | } |
5703 | 5709 | ||
@@ -6083,11 +6089,11 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co | |||
6083 | const QMimeSource* m = | 6089 | const QMimeSource* m = |
6084 | factory.data( imageName, context ); | 6090 | factory.data( imageName, context ); |
6085 | if ( !m ) { | 6091 | if ( !m ) { |
6086 | qWarning("QTextImage: no mimesource for %s", imageName.latin1() ); | 6092 | owarn << "QTextImage: no mimesource for " << imageName.latin1() << "" << oendl; |
6087 | } | 6093 | } |
6088 | else { | 6094 | else { |
6089 | if ( !QImageDrag::decode( m, img ) ) { | 6095 | if ( !QImageDrag::decode( m, img ) ) { |
6090 | qWarning("QTextImage: cannot decode %s", imageName.latin1() ); | 6096 | owarn << "QTextImage: cannot decode " << imageName.latin1() << "" << oendl; |
6091 | } | 6097 | } |
6092 | } | 6098 | } |
6093 | 6099 | ||
diff --git a/noncore/apps/opie-write/qrichtext_p.cpp b/noncore/apps/opie-write/qrichtext_p.cpp index 6783e0b..2e8b09c 100644 --- a/noncore/apps/opie-write/qrichtext_p.cpp +++ b/noncore/apps/opie-write/qrichtext_p.cpp | |||
@@ -35,6 +35,9 @@ | |||
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #include <opie2/odebug.h> | ||
39 | using namespace Opie::Core; | ||
40 | |||
38 | #include "qrichtext_p.h" | 41 | #include "qrichtext_p.h" |
39 | 42 | ||
40 | using namespace Qt3; | 43 | using namespace Qt3; |
@@ -137,7 +140,7 @@ void QTextCursor::gotoPosition( QTextParagraph* p, int index ) | |||
137 | para = p; | 140 | para = p; |
138 | if ( index < 0 || index >= para->length() ) { | 141 | if ( index < 0 || index >= para->length() ) { |
139 | #if defined(QT_CHECK_RANGE) | 142 | #if defined(QT_CHECK_RANGE) |
140 | qWarning( "QTextCursor::gotoParagraph Index: %d out of range", index ); | 143 | owarn << "QTextCursor::gotoParagraph Index: " << index << " out of range" << oendl; |
141 | #endif | 144 | #endif |
142 | index = index < 0 ? 0 : para->length() - 1; | 145 | index = index < 0 ? 0 : para->length() - 1; |
143 | } | 146 | } |
@@ -477,7 +480,7 @@ bool QTextParagraph::fullSelected( int id ) const | |||
477 | int QTextParagraph::lineY( int l ) const | 480 | int QTextParagraph::lineY( int l ) const |
478 | { | 481 | { |
479 | if ( l > (int)lineStarts.count() - 1 ) { | 482 | if ( l > (int)lineStarts.count() - 1 ) { |
480 | qWarning( "QTextParagraph::lineY: line %d out of range!", l ); | 483 | owarn << "QTextParagraph::lineY: line " << l << " out of range!" << oendl; |
481 | return 0; | 484 | return 0; |
482 | } | 485 | } |
483 | 486 | ||
@@ -493,7 +496,7 @@ int QTextParagraph::lineY( int l ) const | |||
493 | int QTextParagraph::lineBaseLine( int l ) const | 496 | int QTextParagraph::lineBaseLine( int l ) const |
494 | { | 497 | { |
495 | if ( l > (int)lineStarts.count() - 1 ) { | 498 | if ( l > (int)lineStarts.count() - 1 ) { |
496 | qWarning( "QTextParagraph::lineBaseLine: line %d out of range!", l ); | 499 | owarn << "QTextParagraph::lineBaseLine: line " << l << " out of range!" << oendl; |
497 | return 10; | 500 | return 10; |
498 | } | 501 | } |
499 | 502 | ||
@@ -509,7 +512,7 @@ int QTextParagraph::lineBaseLine( int l ) const | |||
509 | int QTextParagraph::lineHeight( int l ) const | 512 | int QTextParagraph::lineHeight( int l ) const |
510 | { | 513 | { |
511 | if ( l > (int)lineStarts.count() - 1 ) { | 514 | if ( l > (int)lineStarts.count() - 1 ) { |
512 | qWarning( "QTextParagraph::lineHeight: line %d out of range!", l ); | 515 | owarn << "QTextParagraph::lineHeight: line " << l << " out of range!" << oendl; |
513 | return 15; | 516 | return 15; |
514 | } | 517 | } |
515 | 518 | ||
@@ -525,8 +528,8 @@ int QTextParagraph::lineHeight( int l ) const | |||
525 | void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const | 528 | void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const |
526 | { | 529 | { |
527 | if ( l > (int)lineStarts.count() - 1 ) { | 530 | if ( l > (int)lineStarts.count() - 1 ) { |
528 | qWarning( "QTextParagraph::lineInfo: line %d out of range!", l ); | 531 | owarn << "QTextParagraph::lineInfo: line " << l << " out of range!" << oendl; |
529 | qDebug( "%d %d", (int)lineStarts.count() - 1, l ); | 532 | odebug << "" << (int)lineStarts.count() - 1 << " " << l << "" << oendl; |
530 | y = 0; | 533 | y = 0; |
531 | h = 15; | 534 | h = 15; |
532 | bl = 10; | 535 | bl = 10; |