summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/opie-write
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/apps/opie-write') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-write/mainwindow.cpp12
-rw-r--r--noncore/apps/opie-write/opie-write.pro3
-rw-r--r--noncore/apps/opie-write/qcomplextext.cpp4
-rw-r--r--noncore/apps/opie-write/qrichtext.cpp28
-rw-r--r--noncore/apps/opie-write/qrichtext_p.cpp15
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 @@
**********************************************************************/
#include "mainwindow.h"
+
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/fileselector.h>
#include <qpe/applnk.h>
#include <qpe/resource.h>
#include <qpe/fontdatabase.h>
+using namespace Opie::Core;
-//#include "qspellchecker.h"
+/* QT */
#include "qtextedit.h"
#include <qaction.h>
#include <qtoolbar.h>
@@ -444,7 +448,7 @@ void MainWindow::fileOpen()
void MainWindow::fileRevert()
{
- qDebug( "QMainWindow::fileRevert needs to be done" );
+ odebug << "QMainWindow::fileRevert needs to be done" << oendl;
}
void MainWindow::fileNew()
@@ -456,7 +460,7 @@ void MainWindow::fileNew()
void MainWindow::insertTable()
{
- qDebug( "MainWindow::insertTable() needs to be done" );
+ odebug << "MainWindow::insertTable() needs to be done" << oendl;
}
void MainWindow::newFile( const DocLnk &dl )
@@ -475,7 +479,7 @@ void MainWindow::openFile( const DocLnk &dl )
FileManager fm;
QString txt;
if ( !fm.loadFile( dl, txt ) )
- qDebug( "couldn't open file" );
+ odebug << "couldn't open file" << oendl;
clear();
editorStack->raiseWidget( editor );
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 @@
-CONFIG += qt warn on quick-app
-
+CONFIG += qt warn on quick-app
HEADERS = qcleanuphandler.h \
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()
*/
static inline const QChar *prevChar( const QString &str, int pos )
{
- //qDebug("leftChar: pos=%d", pos);
+ //odebug << "leftChar: pos=" << pos << "" << oendl;
pos--;
const QChar *ch = str.unicode() + pos;
while( pos > -1 ) {
@@ -124,7 +124,7 @@ static inline const QChar *nextChar( const QString &str, int pos)
int len = str.length();
const QChar *ch = str.unicode() + pos;
while( pos < len ) {
- //qDebug("rightChar: %d isLetter=%d, joining=%d", pos, ch.isLetter(), ch.joining());
+ //odebug << "rightChar: " << pos << " isLetter=" << ch.isLetter() << ", joining=" << ch.joining() << "" << oendl;
if( !ch->isMark() )
return ch;
// 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 @@
#include "qrichtext_p.h"
+/* OPIE */
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
+/* QT */
#include "qdragobject.h"
#include "qpaintdevicemetrics.h"
#include "qdrawutil.h"
#include "qcleanuphandler.h"
+/* STD */
#include <stdlib.h>
using namespace Qt3;
@@ -184,7 +190,7 @@ QTextCursor *QTextDeleteCommand::execute( QTextCursor *c )
{
QTextParagraph *s = doc ? doc->paragAt( id ) : parag;
if ( !s ) {
- qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() );
+ owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl;
return 0;
}
@@ -212,7 +218,7 @@ QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c )
{
QTextParagraph *s = doc ? doc->paragAt( id ) : parag;
if ( !s ) {
- qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() );
+ owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl;
return 0;
}
@@ -1544,10 +1550,10 @@ void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* curso
QString bg = attr["background"];
const QMimeSource* m = factory_->data( bg, contxt );
if ( !m ) {
- qWarning("QRichText: no mimesource for %s", bg.latin1() );
+ owarn << "QRichText: no mimesource for " << bg.latin1() << "" << oendl;
} else {
if ( !QImageDrag::decode( m, img ) ) {
- qWarning("QTextImage: cannot decode %s", bg.latin1() );
+ owarn << "QTextImage: cannot decode " << bg.latin1() << "" << oendl;
}
}
if ( !img.isNull() ) {
@@ -2152,7 +2158,7 @@ QString QTextDocument::richText() const
QStyleSheetItem* item_ol = styleSheet()->item("ol");
QStyleSheetItem* item_li = styleSheet()->item("li");
if ( !item_p || !item_ul || !item_ol || !item_li ) {
- qWarning( "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" );
+ owarn << "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" << oendl;
return QString::null;
}
int pastListDepth = 0;
@@ -4096,7 +4102,7 @@ int QTextParagraph::lineHeightOfChar( int i, int *bl, int *y ) const
--it;
}
- qWarning( "QTextParagraph::lineHeightOfChar: couldn't find lh for %d", i );
+ owarn << "QTextParagraph::lineHeightOfChar: couldn't find lh for " << i << "" << oendl;
return 15;
}
@@ -4122,7 +4128,7 @@ QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line )
--l;
}
- qWarning( "QTextParagraph::lineStartOfChar: couldn't find %d", i );
+ owarn << "QTextParagraph::lineStartOfChar: couldn't find " << i << "" << oendl;
return 0;
}
@@ -4149,7 +4155,7 @@ QTextStringChar *QTextParagraph::lineStartOfLine( int line, int *index ) const
return &str->at( i );
}
- qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line );
+ owarn << "QTextParagraph::lineStartOfLine: couldn't find " << line << "" << oendl;
return 0;
}
@@ -5697,7 +5703,7 @@ QTextFormat *QTextFormatCollection::format( const QFont &f, const QColor &c )
cachedFormat->collection = this;
cKey.insert( cachedFormat->key(), cachedFormat );
if ( cachedFormat->key() != key )
- qWarning("ASSERT: keys for format not identical: '%s '%s'", cachedFormat->key().latin1(), key.latin1() );
+ owarn << "ASSERT: keys for format not identical: '" << cachedFormat->key().latin1() << " '" << key.latin1() << "'" << oendl;
return cachedFormat;
}
@@ -6083,11 +6089,11 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co
const QMimeSource* m =
factory.data( imageName, context );
if ( !m ) {
- qWarning("QTextImage: no mimesource for %s", imageName.latin1() );
+ owarn << "QTextImage: no mimesource for " << imageName.latin1() << "" << oendl;
}
else {
if ( !QImageDrag::decode( m, img ) ) {
- qWarning("QTextImage: cannot decode %s", imageName.latin1() );
+ owarn << "QTextImage: cannot decode " << imageName.latin1() << "" << oendl;
}
}
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 @@
**
**********************************************************************/
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
#include "qrichtext_p.h"
using namespace Qt3;
@@ -137,7 +140,7 @@ void QTextCursor::gotoPosition( QTextParagraph* p, int index )
para = p;
if ( index < 0 || index >= para->length() ) {
#if defined(QT_CHECK_RANGE)
- qWarning( "QTextCursor::gotoParagraph Index: %d out of range", index );
+ owarn << "QTextCursor::gotoParagraph Index: " << index << " out of range" << oendl;
#endif
index = index < 0 ? 0 : para->length() - 1;
}
@@ -477,7 +480,7 @@ bool QTextParagraph::fullSelected( int id ) const
int QTextParagraph::lineY( int l ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineY: line %d out of range!", l );
+ owarn << "QTextParagraph::lineY: line " << l << " out of range!" << oendl;
return 0;
}
@@ -493,7 +496,7 @@ int QTextParagraph::lineY( int l ) const
int QTextParagraph::lineBaseLine( int l ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineBaseLine: line %d out of range!", l );
+ owarn << "QTextParagraph::lineBaseLine: line " << l << " out of range!" << oendl;
return 10;
}
@@ -509,7 +512,7 @@ int QTextParagraph::lineBaseLine( int l ) const
int QTextParagraph::lineHeight( int l ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineHeight: line %d out of range!", l );
+ owarn << "QTextParagraph::lineHeight: line " << l << " out of range!" << oendl;
return 15;
}
@@ -525,8 +528,8 @@ int QTextParagraph::lineHeight( int l ) const
void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineInfo: line %d out of range!", l );
- qDebug( "%d %d", (int)lineStarts.count() - 1, l );
+ owarn << "QTextParagraph::lineInfo: line " << l << " out of range!" << oendl;
+ odebug << "" << (int)lineStarts.count() - 1 << " " << l << "" << oendl;
y = 0;
h = 15;
bl = 10;