-rw-r--r-- | noncore/apps/opie-reader/Aportis.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-reader/Bkmks.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-reader/BuffDoc.cpp | 18 | ||||
-rw-r--r-- | noncore/apps/opie-reader/CDrawBuffer.cpp | 22 | ||||
-rw-r--r-- | noncore/apps/opie-reader/QTReader.cpp | 52 | ||||
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 279 | ||||
-rw-r--r-- | noncore/apps/opie-reader/StyleConsts.cpp | 2 | ||||
-rw-r--r-- | noncore/apps/opie-reader/fileBrowser.cpp | 8 | ||||
-rw-r--r-- | noncore/apps/opie-reader/opie-reader.pro | 2 | ||||
-rw-r--r-- | noncore/apps/opie-reader/plucker.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-reader/plucker_base.cpp | 148 |
11 files changed, 282 insertions, 273 deletions
diff --git a/noncore/apps/opie-reader/Aportis.cpp b/noncore/apps/opie-reader/Aportis.cpp index 2f8cdc3..06f44a4 100644 --- a/noncore/apps/opie-reader/Aportis.cpp +++ b/noncore/apps/opie-reader/Aportis.cpp @@ -29,5 +29,5 @@ CList<Bkmk>* Aportis::getbkmklist() char name[17]; name[16] = '\0'; -// qDebug("Record:%d, Length:%u",i,recordlength(i)); +// odebug << "Record:" << i << ", Length:" << recordlength(i) << "" << oendl; gotorecordnumber(i); fread(name,1,16,fin); @@ -36,5 +36,5 @@ CList<Bkmk>* Aportis::getbkmklist() lcn ^= 0xa5a5a5a5; lcn = SwapLong(lcn); -// qDebug("Bookmark:%s:%u", name,lcn); +// odebug << "Bookmark:" << name << ":" << lcn << "" << oendl; tchar tname[17]; memset(tname, 0, sizeof(tname)); @@ -122,5 +122,5 @@ int Aportis::OpenFile(const char *src) gotorecordnumber(0); fread(&hdr0, sizeof(hdr0), 1, fin); -// qDebug("Version:%x", ntohs(hdr0.Version)); +// odebug << "Version:" << ntohs(hdr0.Version) << "" << oendl; if (hdr0.Version && 0x0200) { @@ -183,5 +183,5 @@ int Aportis::OpenFile(const char *src) outptr = 0; refreshbuffer(); -// qDebug("Number of records:[%u,%u]", nRecs, nRecs2); +// odebug << "Number of records:[" << nRecs << "," << nRecs2 << "]" << oendl; return ret; } diff --git a/noncore/apps/opie-reader/Bkmks.cpp b/noncore/apps/opie-reader/Bkmks.cpp index 16bc1f1..480c240 100644 --- a/noncore/apps/opie-reader/Bkmks.cpp +++ b/noncore/apps/opie-reader/Bkmks.cpp @@ -218,13 +218,13 @@ CList<Bkmk>* BkmkFile::readall() isUpgraded = false; bl = readall00(read06); -// qDebug("Correct version!"); +// odebug << "Correct version!" << oendl; break; case 5: isUpgraded = true; bl = readall00(read05); -// qDebug("Known version!"); +// odebug << "Known version!" << oendl; break; default: -// qDebug("Unknown version!"); +// odebug << "Unknown version!" << oendl; isUpgraded = true; bl = readall00(read05); diff --git a/noncore/apps/opie-reader/BuffDoc.cpp b/noncore/apps/opie-reader/BuffDoc.cpp index 4fbab93..68391b8 100644 --- a/noncore/apps/opie-reader/BuffDoc.cpp +++ b/noncore/apps/opie-reader/BuffDoc.cpp @@ -33,5 +33,5 @@ linkType BuffDoc::hyperlink(unsigned int n, QString& wrd) void BuffDoc::locate(unsigned int n) { - // //qDebug("BuffDoc:locating:%u",n); + // //odebug << "BuffDoc:locating:" << n << "" << oendl; lastword.empty(); lastsizes[0] = laststartline = n; @@ -43,5 +43,5 @@ void BuffDoc::locate(unsigned int n) // tchar linebuf[1024]; if (exp != NULL) exp->locate(n); - // //qDebug("BuffDoc:Located"); + // //odebug << "BuffDoc:Located" << oendl; } @@ -189,5 +189,5 @@ bool BuffDoc::getline(CDrawBuffer* buff, int wth, unsigned char _border) } else buff->empty(); -// //qDebug("Buff:%s Lastword:%s", (const char*)toQString(buff->data()), (const char*)toQString(lastword.data())); +// //odebug << "Buff:" << toQString(buff->data()) << " Lastword:" << toQString(lastword.data()) << "" << oendl; lastcheck = len = buff->length(); unsigned int slen = buff->width(len); @@ -323,6 +323,6 @@ bool BuffDoc::getline(CDrawBuffer* buff, int wth, int cw, unsigned char _border) int BuffDoc::openfile(QWidget* _parent, const char *src) { - // //qDebug("BuffDoc:Openfile:%s", src); - // //qDebug("Trying aportis %x",exp); + // //odebug << "BuffDoc:Openfile:" << src << "" << oendl; + // //odebug << "Trying aportis " << exp << "" << oendl; if (exp != NULL) delete exp; lastword.empty(); @@ -379,5 +379,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) { delete exp; - //qDebug("Trying ppms"); + //odebug << "Trying ppms" << oendl; exp = new ppm_expander; ret = exp->openfile(src); @@ -387,5 +387,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) delete exp; exp = new Text; -// //qDebug("Trying text"); +// //odebug << "Trying text" << oendl; ret = exp->openfile(src); } @@ -397,5 +397,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) return ret; } - // //qDebug("Doing final open:%x:%x",exp,filt); + // //odebug << "Doing final open:" << exp << ":" << filt << "" << oendl; lastword.empty(); @@ -408,5 +408,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) exp->locate(0); filt->setsource(exp); - // //qDebug("BuffDoc:file opened"); + // //odebug << "BuffDoc:file opened" << oendl; return 0; } diff --git a/noncore/apps/opie-reader/CDrawBuffer.cpp b/noncore/apps/opie-reader/CDrawBuffer.cpp index ec36fb2..b137ac3 100644 --- a/noncore/apps/opie-reader/CDrawBuffer.cpp +++ b/noncore/apps/opie-reader/CDrawBuffer.cpp @@ -41,5 +41,5 @@ CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs) { int i; -// //qDebug("Trying 2"); +// //odebug << "Trying 2" << oendl; len = rhs.len; m_maxstyle = rhs.m_maxstyle; @@ -59,5 +59,5 @@ CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs) (*this)[i] = '\0'; len = i; -// //qDebug("Tried 2"); +// //odebug << "Tried 2" << oendl; return *this; } @@ -209,5 +209,5 @@ int CDrawBuffer::width(int numchars, bool onscreen, int scwidth, unsigned char _ { QString nstr = str.mid(lastspace+1, nsp-lastspace); -// qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); +// odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl; int lw = fm.width(nstr); cx += lw; @@ -318,5 +318,5 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int QFont f((currentstyle.isMono() && fc->hasCourier()) ? fc->fixedfontname() : fc->name(), fc->getsize(currentstyle), (currentstyle.isBold()) ? QFont::Bold : QFont::Normal, (currentstyle.isItalic()) ); // f.setUnderline(currentstyle.isUnderline()); -// if (currentstyle.isUnderline()) qDebug("UNDERLINE"); +// if (currentstyle.isUnderline()) odebug << "UNDERLINE" << oendl; _p->setFont(f); QString str = text.mid(textstart->start, end-textstart->start); @@ -409,5 +409,5 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int int nexttoadd = (extraspace*spacenumber+spaces/2)/spaces - spacesofar; QString nstr = str.mid(lastspace+1, nsp-lastspace); -// qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); +// odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl; int lw = fm.width(nstr); _p->drawText( cx, _y+voffset, nstr); @@ -419,5 +419,5 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int { QString nstr = str.mid(lastspace+1, nsp-lastspace); -// qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); +// odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl; int lw = fm.width(nstr); _p->drawText( cx, _y+voffset, nstr); @@ -471,12 +471,12 @@ linkType CDrawBuffer::getLinkType(int numchars, size_t& tgt) currentstyle = textstart->style; /* - if (currentstyle.isPicture()) qDebug("Passed thru picture"); - if (currentstyle.getLink()) qDebug("Passed thru link"); - //qDebug("islink:%d - %d", numchars, end); + if (currentstyle.isPicture()) odebug << "Passed thru picture" << oendl; + if (currentstyle.getLink()) odebug << "Passed thru link" << oendl; + //odebug << "islink:" << numchars << " - " << end << "" << oendl; */ textstart = textend; } while (textend != segs.end() && end <= numchars); -// if (currentstyle.isPicture()) qDebug("Clicked on picture"); +// if (currentstyle.isPicture()) odebug << "Clicked on picture" << oendl; if (currentstyle.getPictureLink()) { @@ -540,5 +540,5 @@ void CDrawBuffer::resize() { int xt = ((segs.begin()->style.getExtraSpace()+fc->getextraspace())*fc->getsize(segs.begin()->style)+5)/10; -// qDebug("ExtraSpace:%d", xt); +// odebug << "ExtraSpace:" << xt << "" << oendl; m_ascent += xt; m_lineSpacing += xt; diff --git a/noncore/apps/opie-reader/QTReader.cpp b/noncore/apps/opie-reader/QTReader.cpp index d64abb4..b356ba5 100644 --- a/noncore/apps/opie-reader/QTReader.cpp +++ b/noncore/apps/opie-reader/QTReader.cpp @@ -81,5 +81,5 @@ QTReader::QTReader( const QString& filename, QWidget *parent=0, const tchar *nam { init(); -// // qDebug("Load_file(1)"); +// // odebug << "Load_file(1)" << oendl; load_file((const tchar*)filename); } @@ -92,5 +92,5 @@ void QTReader::mouseMoveEvent(QMouseEvent* _e) mouseUpOn = !(_e->pos().x() == -1); - qDebug("MouseMove:[%d, %d]", _e->pos().x(), _e->pos().y()); + odebug << "MouseMove:[" << _e->pos().x() << ", " << _e->pos().y() << "]" << oendl; } */ @@ -105,5 +105,5 @@ void QTReader::mousePressEvent( QMouseEvent* _e ) if (_e->button() == RightButton) { -// qDebug("MousePress"); +// odebug << "MousePress" << oendl; mouseUpOn = false; if (m_swapmouse) @@ -318,5 +318,5 @@ void QTReader::processmousewordevent(size_t startpos, size_t startoffset, QMouse { wrd = toQString(t->data()+first, i - first); -// qDebug("Got %s", (const char *)wrd); +// odebug << "Got " << (const char *)wrd << "" << oendl; break; } @@ -328,5 +328,5 @@ void QTReader::processmousewordevent(size_t startpos, size_t startoffset, QMouse if (!wrd.isEmpty()) { -// qDebug("Selected:%s", (const char*)wrd); +// odebug << "Selected:" << wrd << "" << oendl; emit OnWordSelected(wrd, locnarray[lineno], (m_twotouch) ? wrd : toQString(textarray[lineno]->data())); } @@ -340,5 +340,5 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e ) if (mouseUpOn) { -// qDebug("MouseRelease"); +// odebug << "MouseRelease" << oendl; if (_e->x() > width() - m_border) { @@ -395,5 +395,5 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e ) case ePicture: { -// qDebug("Picture:%x", tgt); +// odebug << "Picture:" << tgt << "" << oendl; QImage* pm = buffdoc.getPicture(tgt); if (pm != NULL) @@ -411,5 +411,5 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e ) break; default: -// qDebug("Unknown linktype"); +// odebug << "Unknown linktype" << oendl; return; } @@ -697,5 +697,5 @@ void QTReader::setautoscroll(bool _sc) if (!m_pipetarget.isEmpty()) { -// qDebug("Opening pipe to %s", (const char*)m_pipetarget); +// odebug << "Opening pipe to " << m_pipetarget << "" << oendl; m_pipeout = popen((const char*)m_pipetarget, "w"); m_isPaused = false; @@ -824,15 +824,15 @@ void QTReader::drawFonts( QPainter *p ) if (bDoUpdates) { -// qDebug("How refreshing..."); +// odebug << "How refreshing..." << oendl; if (buffdoc.empty()) return; setfont(); if (m_lastwidth != width()) { -// qDebug("Not Optimised %d", m_lastwidth); +// odebug << "Not Optimised " << m_lastwidth << "" << oendl; m_lastwidth = width(); m_lastheight = height(); buffdoc.setwidth(m_lastwidth-2*m_border); locate(pagelocate()); -// qDebug("Not Optimised %d", m_lastwidth); +// odebug << "Not Optimised " << m_lastwidth << "" << oendl; } else @@ -841,5 +841,5 @@ void QTReader::drawFonts( QPainter *p ) if (m_lastheight > newht) { -// qDebug("Optimised < %d %d %d", numlines, m_lastheight, newht); +// odebug << "Optimised < " << numlines << " " << m_lastheight << " " << newht << "" << oendl; int ypos = 0; for (int i = 0; i < numlines; i++) @@ -852,10 +852,10 @@ void QTReader::drawFonts( QPainter *p ) } } -// qDebug("Optimised < %d", numlines); +// odebug << "Optimised < " << numlines << "" << oendl; m_lastheight = newht; } else if (m_lastheight < newht) { -// qDebug("Optimised > %d", numlines); +// odebug << "Optimised > " << numlines << "" << oendl; int ypos = 0; for (int i = 0; i <= numlines; i++) @@ -864,5 +864,5 @@ void QTReader::drawFonts( QPainter *p ) } fillbuffer(numlines+1, ypos, newht); -// qDebug("Optimised > %d", numlines); +// odebug << "Optimised > " << numlines << "" << oendl; } if (numlines > 0) @@ -898,5 +898,5 @@ void QTReader::drawFonts( QPainter *p ) else { - qDebug("Not so refreshing..."); + odebug << "Not so refreshing..." << oendl; } */ @@ -1029,5 +1029,5 @@ void QTReader::paintEvent( QPaintEvent * ) void QTReader::resizeEvent( QResizeEvent * ) { -// // qDebug("resize:(%u,%u)", width(), height()); +// // odebug << "resize:(" << width() << "," << height() << ")" << oendl; // bgroup->move( width()-bgroup->width(), 0 ); } @@ -1054,9 +1054,9 @@ bool QTReader::locate(unsigned long n) { buffdoc.unsuspend(); buffdoc.locate(n); -// // qDebug("&buffdoc.located"); +// // odebug << "&buffdoc.located" << oendl; fillbuffer(); -// // qDebug("&Buffer filled"); +// // odebug << "&Buffer filled" << oendl; update(); -// // qDebug("&Located"); +// // odebug << "&Located" << oendl; return true; } @@ -1118,10 +1118,10 @@ bool QTReader::fillbuffer(int reuse, int ht, int newht) void QTReader::dopagedn() { -// qDebug("HEIGHT(2):%d", m_lastheight); +// odebug << "HEIGHT(2):" << m_lastheight << "" << oendl; buffdoc.unsuspend(); int skip = 0, ypos = 0; if (locate() != mylastpos) { -//// qDebug("Jumping to %u", mylastpos); +//// odebug << "Jumping to " << mylastpos << "" << oendl; jumpto(mylastpos); } @@ -1314,11 +1314,11 @@ bool QTReader::load_file(const char *newfile, unsigned int _lcn) bRC = true; buffdoc.setContinuous(m_continuousDocument); -// // qDebug("buffdoc.openfile done"); +// // odebug << "buffdoc.openfile done" << oendl; locate(lcn); -// // qDebug("buffdoc.locate done"); +// // odebug << "buffdoc.locate done" << oendl; } setfilter(getfilter()); update(); -// // qDebug("Updated"); +// // odebug << "Updated" << oendl; return bRC; } diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp index b072854..f18cb59 100644 --- a/noncore/apps/opie-reader/QTReaderApp.cpp +++ b/noncore/apps/opie-reader/QTReaderApp.cpp @@ -18,18 +18,46 @@ ** **********************************************************************/ + #include "useqpe.h" -#include <qregexp.h> -#include <qclipboard.h> -#include <qwidgetstack.h> +#include "QTReader.h" +#include "GraphicWin.h" +#include "Bkmks.h" +#include "cbkmkselector.h" +#include "infowin.h" +#include "ToolbarPrefs.h" +#include "Prefs.h" +#include "CAnnoEdit.h" +#include "QFloatBar.h" +#include "FixedFont.h" +#include "URLDialog.h" +#include "QTReaderApp.h" +#include "CDrawBuffer.h" +#include "Filedata.h" +#include "opie.h" +#include "names.h" +#include "CEncoding_tables.h" +#include "CloseDialog.h" + +/* OPIE */ +#include <opie2/odebug.h> +#ifdef USEQPE +#include <qpe/menubutton.h> +#include <qpe/fontdatabase.h> +#include <qpe/global.h> +#include <qpe/applnk.h> +#include <qpe/config.h> +#include <qpe/qcopenvelope_qws.h> +#endif + +/* QT */ #ifdef USEQPE #include <qmenubar.h> #include <qtoolbar.h> #endif +#include <qregexp.h> +#include <qclipboard.h> +#include <qwidgetstack.h> #include <qmenubar.h> #include <qtoolbar.h> -#ifdef USEQPE -#include <qpe/menubutton.h> -#include <qpe/fontdatabase.h> -#endif #include <qcombobox.h> #include <qpopupmenu.h> @@ -40,31 +68,12 @@ #include <qspinbox.h> #include <qobjectlist.h> -#ifdef USEQPE -#include <qpe/global.h> -#include <qpe/applnk.h> -#endif #include <qfileinfo.h> -#include <stdlib.h> //getenv #include <qprogressbar.h> -#ifdef USEQPE -#include <qpe/config.h> -#endif #include <qbuttongroup.h> #include <qradiobutton.h> -#ifdef USEQPE -#include <qpe/qcopenvelope_qws.h> -#endif -#include "QTReader.h" -#include "GraphicWin.h" -#include "Bkmks.h" -#include "cbkmkselector.h" -#include "infowin.h" -#include "ToolbarPrefs.h" -#include "Prefs.h" -#include "CAnnoEdit.h" -#include "QFloatBar.h" -#include "FixedFont.h" -#include "URLDialog.h" -//#include <qpe/fontdatabase.h> + +/* STD */ +#include <stdlib.h> //getenv + #ifdef USEQPE @@ -76,12 +85,4 @@ #endif -#include "QTReaderApp.h" -#include "CDrawBuffer.h" -#include "Filedata.h" -#include "opie.h" -#include "names.h" -#include "CEncoding_tables.h" -#include "CloseDialog.h" - bool CheckVersion(int&, int&, char&); @@ -126,5 +127,5 @@ void QTReaderApp::listBkmkFiles() QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -147,5 +148,5 @@ void QTReaderApp::listBkmkFiles() cnt++; - //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); + //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl; ++it; // goto next list element } @@ -215,6 +216,6 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) m_url_globalfile = false; ftime(&m_lastkeytime); -//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir()); -//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml")); +//// odebug << "Application directory = " << (const tchar *)QPEApplication::documentDir() << "" << oendl; +//// odebug << "Application directory = " << (const tchar *)Global::applicationFileName("uqtreader" << "" << oendl; m_bcloseDisabled = true; @@ -244,5 +245,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) } -// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot); +// odebug << "Initial Rotation(" << m_rot << "):" << rot << "" << oendl; */ m_autogenstr = "^ *[A-Z].*[a-z] *$"; @@ -261,5 +262,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -267,5 +268,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) } QFileInfo fi(d, INIFILE); -// qDebug("Path:%s", (const char*)fi.absFilePath()); +// odebug << "Path:" << fi.absFilePath() << "" << oendl; Config config(fi.absFilePath()); #endif @@ -357,5 +358,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) importSelector->setCloseVisible( FALSE ); */ -// qDebug("Reading file list"); +// odebug << "Reading file list" << oendl; readfilelist(); @@ -368,5 +369,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) #endif -// qDebug("Reading config"); +// odebug << "Reading config" << oendl; // Config config( APPDIR ); config.setGroup( "View" ); @@ -770,5 +771,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) m_fontBar->setHorizontalStretchable( TRUE ); -// qDebug("Font selector"); +// odebug << "Font selector" << oendl; m_fontSelector = new QComboBox(false, m_fontBar); m_fontBar->setStretchableWidget( m_fontSelector ); @@ -802,15 +803,15 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) this, SLOT( msgHandler(const QCString&,const QByteArray&) ) ); #endif -// qDebug("Initing"); +// odebug << "Initing" << oendl; reader->init(); -// qDebug("Inited"); +// odebug << "Inited" << oendl; // m_buttonAction[m_spaceTarget]->setOn(true); -// qDebug("fonting"); +// odebug << "fonting" << oendl; do_setfont(reader->m_fontname); if (!reader->m_lastfile.isEmpty()) { -// qDebug("doclnk"); +// odebug << "doclnk" << oendl; // doc = new DocLnk(reader->m_lastfile); -// qDebug("doclnk done"); +// odebug << "doclnk done" << oendl; if (pOpenlist != NULL) { @@ -832,10 +833,10 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) break; } -// qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name())); +// odebug << "Item:" << toQString(CFiledata(p->anno()).name()) << "" << oendl; p = NULL; } if (p != NULL) { -// qDebug("openfrombkmk"); +// odebug << "openfrombkmk" << oendl; if (!openfrombkmk(p)) showEditTools(); @@ -843,5 +844,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) else { -// qDebug("openfile"); +// odebug << "openfile" << oendl; openFile( reader->m_lastfile ); } @@ -849,5 +850,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) else { -// qDebug("Openfile 2"); +// odebug << "Openfile 2" << oendl; if (!reader->m_lastfile.isEmpty()) openFile( reader->m_lastfile ); @@ -871,5 +872,5 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) config.writeEntry("Minor", (int)minor); } -// qDebug("finished update"); +// odebug << "finished update" << oendl; } @@ -1029,12 +1030,12 @@ QToolBar* QTReaderApp::filebar() { case cesSingle: -// qDebug("Setting filebar to menubar"); +// odebug << "Setting filebar to menubar" << oendl; fileBar = menubar; break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesMenuTool: case cesMultiple: -// qDebug("Creating new file bar"); +// odebug << "Creating new file bar" << oendl; fileBar = new QToolBar("File", this, m_tbposition); break; @@ -1054,5 +1055,5 @@ QToolBar* QTReaderApp::viewbar() break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesSingle: case cesMenuTool: @@ -1070,13 +1071,13 @@ QToolBar* QTReaderApp::navbar() { case cesMultiple: -// qDebug("Creating new nav bar"); +// odebug << "Creating new nav bar" << oendl; navBar = new QToolBar("Navigation", this, m_tbposition); break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesSingle: case cesMenuTool: navBar = fileBar; -// qDebug("Setting navbar to filebar"); +// odebug << "Setting navbar to filebar" << oendl; break; } @@ -1094,5 +1095,5 @@ QToolBar* QTReaderApp::markbar() break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesSingle: case cesMenuTool: @@ -1128,5 +1129,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) QString msg = QString::fromUtf8(_msg); -//// qDebug("Received:%s", (const char*)msg); +//// odebug << "Received:" << msg << "" << oendl; QDataStream stream( _data, IO_ReadOnly ); @@ -1482,5 +1483,5 @@ void QTReaderApp::setfullscreen(bool sfs) void QTReaderApp::buttonActionSelected(QAction* _a) { -//// qDebug("es:%x : %s (%u)", _a, (const char *)(_a->text()), ActNameToInt(_a->text())); +//// odebug << "es:" << _a << " : " << (const char *)(_a->text()) << " (" << ActNameToInt(_a->text()) << ")" << oendl; m_spaceTarget = ActNameToInt(_a->text()); } @@ -1564,5 +1565,5 @@ void QTReaderApp::updatefileinfo() tchar* nm = fromQString(reader->m_string); tchar* fl = fromQString(reader->m_lastfile); -// qDebug("Lastfile:%x", fl); +// odebug << "Lastfile:" << fl << "" << oendl; bool notadded = true; if (pOpenlist == NULL) pOpenlist = new CList<Bkmk>; @@ -1578,5 +1579,5 @@ void QTReaderApp::updatefileinfo() CFiledata fd(iter->anno()); reader->setSaveData(data, dlen, fd.content(), fd.length()); -// qDebug("Filedata(1):%u, %u", fd.length(), dlen); +// odebug << "Filedata(1):" << fd.length() << ", " << dlen << "" << oendl; // getstate(data, dlen); iter->setAnno(data, dlen); @@ -1587,5 +1588,5 @@ void QTReaderApp::updatefileinfo() } } -// qDebug("Added?:%x", notadded); +// odebug << "Added?:" << notadded << "" << oendl; if (notadded) { @@ -1597,5 +1598,5 @@ void QTReaderApp::updatefileinfo() reader->setSaveData(data, dlen, fd.content(), fd.length()); pOpenlist->push_front(Bkmk(nm, data, dlen, reader->pagelocate())); -// qDebug("Filedata(2):%u, %u", fd.length(), dlen); +// odebug << "Filedata(2):" << fd.length() << ", " << dlen << "" << oendl; delete [] data; } @@ -1612,5 +1613,5 @@ void QTReaderApp::fileOpen() if (searchVisible) searchBar->hide(); */ -// qDebug("fileOpen"); +// odebug << "fileOpen" << oendl; // if (!reader->m_lastfile.isEmpty()) updatefileinfo(); @@ -1653,5 +1654,5 @@ void QTReaderApp::fileOpen2() } // reader->refresh(); -// qDebug("HEIGHT:%d", reader->m_lastheight); +// odebug << "HEIGHT:" << reader->m_lastheight << "" << oendl; } @@ -1673,5 +1674,5 @@ QString QTReaderApp::usefilebrowser() fn = fb->getCurrentFile(); } -// qDebug("Selected %s", (const char*)fn); +// odebug << "Selected " << fn << "" << oendl; delete fb; showEditTools(); @@ -1804,5 +1805,5 @@ void QTReaderApp::showprefs() break; default: - qDebug("Format out of range"); + odebug << "Format out of range" << oendl; } reader->bdepluck = prefwin->Depluck(); @@ -1864,5 +1865,5 @@ void QTReaderApp::showtoolbarprefs() if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); + owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -1901,5 +1902,5 @@ void QTReaderApp::showtoolbarprefs() if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); + owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -2176,5 +2177,5 @@ void QTReaderApp::editFind() void QTReaderApp::findNext() { -// // qDebug("findNext called\n"); +// // odebug << "findNext called\n" << oendl; #ifdef __ISEARCH QString arg = searchEdit->text(); @@ -2272,10 +2273,10 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg) } } -// qDebug("Found it at %u:%u", pos, offset); +// odebug << "Found it at " << pos << ":" << offset << "" << oendl; pbar->hide(); -// qDebug("Hid"); +// odebug << "Hid" << oendl; reader->locate(pos+offset); -// qDebug("Loacted"); -// qDebug("page up"); +// odebug << "Loacted" << oendl; +// odebug << "page up" << oendl; ret = true; } @@ -2334,5 +2335,5 @@ void QTReaderApp::search() void QTReaderApp::openFile( const QString &f ) { -// qDebug("File:%s", (const char*)f); +// odebug << "File:" << f << "" << oendl; // openFile(DocLnk(f)); //} @@ -2381,5 +2382,5 @@ void QTReaderApp::resizeEvent(QResizeEvent* e) void QTReaderApp::handlekey(QKeyEvent* e) { -// qDebug("Keypress event"); +// odebug << "Keypress event" << oendl; timeb now; ftime(&now); @@ -2393,5 +2394,5 @@ void QTReaderApp::handlekey(QKeyEvent* e) { case Key_Escape: -// qDebug("escape event"); +// odebug << "escape event" << oendl; if (m_disableesckey) { @@ -2408,5 +2409,5 @@ void QTReaderApp::handlekey(QKeyEvent* e) else { -// qDebug("escape action"); +// odebug << "escape action" << oendl; doAction(m_escapeTarget, e); } @@ -2507,9 +2508,9 @@ void QTReaderApp::showEditTools() else { -// qDebug("him"); +// odebug << "him" << oendl; #ifdef USEQPE Global::hideInputMethod(); #endif -// qDebug("eb"); +// odebug << "eb" << oendl; menubar->show(); if (fileBar != NULL) fileBar->show(); @@ -2533,7 +2534,7 @@ void QTReaderApp::showEditTools() } if (m_fontVisible) m_fontBar->show(); -// qDebug("sn"); +// odebug << "sn" << oendl; showNormal(); -// qDebug("sm"); +// odebug << "sm" << oendl; #ifdef USEQPE showMaximized(); @@ -2542,9 +2543,9 @@ void QTReaderApp::showEditTools() } -// qDebug("uc"); +// odebug << "uc" << oendl; updateCaption(); -// qDebug("rw"); +// odebug << "rw" << oendl; editorStack->raiseWidget( reader ); -// qDebug("sf"); +// odebug << "sf" << oendl; reader->setFocus(); reader->refresh(); @@ -2615,5 +2616,5 @@ void QTReaderApp::setDocument(const QString& fileref) void QTReaderApp::closeEvent( QCloseEvent *e ) { -// qDebug("Close event"); +// odebug << "Close event" << oendl; if (m_fullscreen) { @@ -2632,5 +2633,5 @@ void QTReaderApp::closeEvent( QCloseEvent *e ) if ((m_escapeTarget != cesNone) && m_bcloseDisabled) { -// qDebug("Close disabled"); +// odebug << "Close disabled" << oendl; m_bcloseDisabled = false; e->ignore(); @@ -2710,5 +2711,5 @@ bool QTReaderApp::listbkmk(CList<Bkmk>* plist, const QString& _lab) { #ifdef _UNICODE -// qDebug("Item:%s", (const char*)toQString(i->name())); +// odebug << "Item:" << toQString(i->name()) << "" << oendl; bkmkselector->insertItem(toQString(i->name())); #else @@ -2739,7 +2740,7 @@ void QTReaderApp::do_regedit() // fileBar->hide(); reader->bDoUpdates = false; -// qDebug("Showing regbar"); +// odebug << "Showing regbar" << oendl; regBar->show(); -// qDebug("Showing kbd"); +// odebug << "Showing kbd" << oendl; #ifdef USEQPE Global::showInputMethod(); @@ -2757,8 +2758,8 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk) CFiledata(bk->anno()).name() ); -// qDebug("fileinfo"); +// odebug << "fileinfo" << oendl; if (!fn.isEmpty() && QFileInfo(fn).isFile()) { -// qDebug("Opening"); +// odebug << "Opening" << oendl; openFile(fn); struct stat fnstat; @@ -2782,5 +2783,5 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk) QMessageBox::warning(this, PROGNAME, "Not all file data used\nNew version?"); } -// qDebug("updating"); +// odebug << "updating" << oendl; // showEditTools(); reader->locate(bk->value()); @@ -2813,5 +2814,5 @@ void QTReaderApp::gotobkmk(int ind) break; case cDelBkmk: -//// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); +//// odebug << "Deleting:" << (*pBkmklist)[ind]->name() << "\n" << oendl; pBkmklist->erase(ind); m_fBkmksChanged = true; @@ -2913,5 +2914,5 @@ void QTReaderApp::gotobkmk(int ind) CFileSelector *f = new CFileSelector("text/html", this, NULL, !m_bFloatingDialog, TRUE, TRUE ); int ret = f->exec(); - qDebug("Return:%d", ret); + odebug << "Return:" << ret << "" << oendl; DocLnk* doc = f->getDoc(); if (doc != NULL) @@ -2933,9 +2934,9 @@ void QTReaderApp::gotobkmk(int ind) FileManager fm; fm.saveFile( *doc, rt ); - qDebug("YES"); + odebug << "YES" << oendl; } else { - qDebug("NO"); + odebug << "NO" << oendl; } delete f; @@ -3010,5 +3011,5 @@ void QTReaderApp::do_regaction() #endif case cSetConfigName: -// qDebug("Saving config"); +// odebug << "Saving config" << oendl; do_saveconfig(regEdit->text(), false); break; @@ -3102,5 +3103,5 @@ void QTReaderApp::setfontHelper(const QString& lcn, int size) void QTReaderApp::do_setencoding(int i) { -// qDebug("setencoding:%d", i); +// odebug << "setencoding:" << i << "" << oendl; if (m_fontAction == cChooseEncoding) { @@ -3110,7 +3111,7 @@ void QTReaderApp::do_setencoding(int i) m_fontBar->hide(); m_fontVisible = false; -// qDebug("showedit"); +// odebug << "showedit" << oendl; if (reader->isVisible()) showEditTools(); -// qDebug("showeditdone"); +// odebug << "showeditdone" << oendl; } @@ -3124,8 +3125,8 @@ void QTReaderApp::do_setfont(const QString& lcn) m_fontBar->hide(); m_fontVisible = false; -// qDebug("showedit"); +// odebug << "showedit" << oendl; //if (reader->isVisible()) showEditTools(); -// qDebug("showeditdone"); +// odebug << "showeditdone" << oendl; } @@ -3134,5 +3135,5 @@ void QTReaderApp::do_autogen(const QString& regText) unsigned long fs, ts; reader->sizes(fs,ts); -// // qDebug("Reg:%s\n", (const tchar*)(regEdit->text())); +// // odebug << "Reg:" << (const tchar*)(regEdit->text()) << "\n" << oendl; m_autogenstr = regText; QRegExp re(regText); @@ -3181,5 +3182,5 @@ void QTReaderApp::do_autogen(const QString& regText) void QTReaderApp::saveprefs() { -// qDebug("saveprefs"); +// odebug << "saveprefs" << oendl; // reader->saveprefs("uqtreader"); // if (!m_loadedconfig) @@ -3262,9 +3263,9 @@ void QTReaderApp::saveprefs() void QTReaderApp::oldFile() { -// qDebug("oldFile called"); +// odebug << "oldFile called" << oendl; reader->setText(true); -// qDebug("settext called"); +// odebug << "settext called" << oendl; showEditTools(); -// qDebug("showedit called"); +// odebug << "showedit called" << oendl; } */ @@ -3342,8 +3343,8 @@ void QTReaderApp::readfilelist() BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles")); #endif /* USEQPE */ -// qDebug("Reading open files"); +// odebug << "Reading open files" << oendl; pOpenlist = bf.readall(); -// if (pOpenlist != NULL) qDebug("...with success"); -// else qDebug("...without success!"); +// if (pOpenlist != NULL) odebug << "...with success" << oendl; +// else odebug << "...without success!" << oendl; } @@ -3360,5 +3361,5 @@ void QTReaderApp::savefilelist() BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles"), true); #endif /* USEQPE */ -// qDebug("Writing open files"); +// odebug << "Writing open files" << oendl; bf.write(*pOpenlist); } @@ -3470,5 +3471,5 @@ void QTReaderApp::showAnnotation() void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& line) { -//// qDebug("OnWordSelected(%u):%s", posn, (const char*)wrd); +//// odebug << "OnWordSelected(" << posn << "):" << wrd << "" << oendl; if (m_doClipboard) @@ -3520,5 +3521,5 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) { e->accept(); -// qDebug("Accepted"); +// odebug << "Accepted" << oendl; switch (a) { @@ -3583,5 +3584,5 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) break; default: - qDebug("Unknown ActionType:%u", a); + odebug << "Unknown ActionType:" << a << "" << oendl; break; } @@ -3601,5 +3602,5 @@ void QTReaderApp::SaveConfig() void QTReaderApp::do_saveconfig(const QString& _txt, bool full) { -// qDebug("do_saveconfig:%s", (const char*)_txt); +// odebug << "do_saveconfig:" << _txt << "" << oendl; #ifdef USEQPE QString configname; @@ -3624,9 +3625,9 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) if (full) { -// qDebug("full:%s", (const char*)_txt); +// odebug << "full:" << _txt << "" << oendl; QDir d = QDir::home(); // "/" if ( !d.cd(_txt) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); + owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl; d = QDir::home(); d.mkdir(_txt); @@ -3640,5 +3641,5 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -3647,5 +3648,5 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) if ( !d.cd("configs") ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl; d = QDir::home(); d.cd(APPDIR); @@ -3655,5 +3656,5 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) fi.setFile(d, _txt); } -// qDebug("Path:%s", (const char*)fi.absFilePath()); +// odebug << "Path:" << fi.absFilePath() << "" << oendl; Config config(fi.absFilePath()); #endif @@ -3935,5 +3936,5 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false) if ( !d.cd(_txt) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); + owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl; d = QDir::home(); d.mkdir(_txt); @@ -3947,5 +3948,5 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false) if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -3954,5 +3955,5 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false) if ( !d.cd("configs") ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl; d = QDir::home(); d.mkdir("configs"); @@ -4062,5 +4063,5 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -4068,5 +4069,5 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) } if ( !d.cd(tgtdir) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/%s\" directory", tgtdir ); + owarn << "Cannot find the \"~/" APPDIR "/" << tgtdir << "\" directory" << oendl; d = QDir::home(); d.mkdir(tgtdir); @@ -4085,5 +4086,5 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) cnt++; - //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); + //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl; ++it; // goto next list element } @@ -4169,5 +4170,5 @@ void QTReaderApp::OnURLSelected(const QString& href) QClipboard* cb = QApplication::clipboard(); cb->setText(href); - qDebug("<a href=\"%s\">%s</a>", (const char*)href, (const char*)href); + odebug << "<a href=\"" << href << "\">" << href << "</a>" << oendl; } if (m_url_localfile) @@ -4193,5 +4194,5 @@ void QTReaderApp::writeUrl(const QString& file, const QString& href) if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); @@ -4200,5 +4201,5 @@ void QTReaderApp::writeUrl(const QString& file, const QString& href) if ( !d.cd("urls") ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/urls\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "/urls\" directory" << oendl; d = QDir::home(); d.cd(APPDIR); diff --git a/noncore/apps/opie-reader/StyleConsts.cpp b/noncore/apps/opie-reader/StyleConsts.cpp index 9fb56b7..f47acee 100644 --- a/noncore/apps/opie-reader/StyleConsts.cpp +++ b/noncore/apps/opie-reader/StyleConsts.cpp @@ -7,5 +7,5 @@ GraphicLink::~GraphicLink() { delete graphic; } pmstore::~pmstore() { -//// qDebug("Deleting image"); +//// odebug << "Deleting image" << oendl; delete graphic; } diff --git a/noncore/apps/opie-reader/fileBrowser.cpp b/noncore/apps/opie-reader/fileBrowser.cpp index e1cde6c..72a1222 100644 --- a/noncore/apps/opie-reader/fileBrowser.cpp +++ b/noncore/apps/opie-reader/fileBrowser.cpp @@ -133,5 +133,5 @@ void fileBrowser::populateList() { ListView->clear(); -////qDebug(currentDir.canonicalPath()); +////odebug << currentDir.canonicalPath() << oendl; // currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::NoSymLinks ); currentDir.setFilter( filterspec ); @@ -157,5 +157,5 @@ void fileBrowser::populateList() else { -//// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); +//// odebug << "Not a dir: "+currentDir.canonicalPath()+fileL << oendl; } new QListViewItem( ListView,fileL,fileS ); @@ -170,5 +170,5 @@ void fileBrowser::populateList() void fileBrowser::upDir() { -//// qDebug(currentDir.canonicalPath()); +//// odebug << currentDir.canonicalPath() << oendl; } @@ -178,5 +178,5 @@ void fileBrowser::listClicked(QListViewItem *selectedItem) QString strItem=selectedItem->text(0); -//// qDebug("%s", (const char*)strItem); +//// odebug << "" << strItem << "" << oendl; diff --git a/noncore/apps/opie-reader/opie-reader.pro b/noncore/apps/opie-reader/opie-reader.pro index e42204a..dbf6964 100644 --- a/noncore/apps/opie-reader/opie-reader.pro +++ b/noncore/apps/opie-reader/opie-reader.pro @@ -86,5 +86,5 @@ TARGET = reader INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopiecore2 include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/opie-reader/plucker.cpp b/noncore/apps/opie-reader/plucker.cpp index e52fd6a..a8e688f 100644 --- a/noncore/apps/opie-reader/plucker.cpp +++ b/noncore/apps/opie-reader/plucker.cpp @@ -58,5 +58,5 @@ int CPlucker::bgetch() if (!m_continuous) return EOF; if (bufferrec >= ntohs(head.recordList.numRecords) - 1) return EOF; -//// qDebug("Passing through %u", currentpos); +//// odebug << "Passing through " << currentpos << "" << oendl; if (!expand(bufferrec+1)) return EOF; mystyle.unset(); @@ -65,10 +65,10 @@ int CPlucker::bgetch() while (m_ParaOffsets[m_nextParaIndex+1] == 0) { -// qDebug("Skipping extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); +// odebug << "Skipping extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; m_nextParaIndex++; } } mystyle.setExtraSpace((m_ParaAttrs[m_nextParaIndex]&7)*2); -// qDebug("Using extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); +// odebug << "Using extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; ch = 10; EOPPhase = 4; @@ -80,5 +80,5 @@ int CPlucker::bgetch() UInt16 attr = m_ParaAttrs[m_nextParaIndex]; m_nextParaIndex++; -// qDebug("Skipping extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); +// odebug << "Skipping extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; if (m_nextParaIndex == m_nParas) { @@ -92,5 +92,5 @@ int CPlucker::bgetch() mystyle.unset(); mystyle.setExtraSpace((m_ParaAttrs[m_nextParaIndex]&7)*2); -// qDebug("Using extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); +// odebug << "Using extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; if (m_lastBreak == locate()) { diff --git a/noncore/apps/opie-reader/plucker_base.cpp b/noncore/apps/opie-reader/plucker_base.cpp index caa945d..b523a54 100644 --- a/noncore/apps/opie-reader/plucker_base.cpp +++ b/noncore/apps/opie-reader/plucker_base.cpp @@ -1,14 +1,16 @@ + + #include "useqpe.h" -#include <stdio.h> -#include <string.h> +#include "plucker_base.h" +#include "Aportis.h" +#include "Palm2QImage.h" + +/* OPIE */ +#include <opie2/odebug.h> #ifdef USEQPE #include <qpe/qcopenvelope_qws.h> -#endif /* USEQPE */ -#ifdef LOCALPICTURES -#include <qscrollview.h> -#endif -#ifdef USEQPE #include <qpe/global.h> #endif /* USEQPE */ + #ifndef USEQPE #include <qapplication.h> @@ -17,7 +19,13 @@ #endif /* USEQPE */ -#include "plucker_base.h" -#include "Aportis.h" -#include "Palm2QImage.h" +/* QT */ +#ifdef LOCALPICTURES +#include <qscrollview.h> +#endif + +/* STD */ +#include <stdio.h> +#include <string.h> + CPlucker_base::CPlucker_base() : @@ -94,5 +102,5 @@ char* CPlucker_base::geturl(UInt16 tgt) fread(&hdr0, 1, 6, fin); unsigned int nrecs = ntohs(hdr0.nRecords); - //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs); + //odebug << "Version " << ntohs(hdr0.version) << ", no. recs " << nrecs << "" << oendl; UInt16 urlid = 0; bool urlsfound = false; @@ -104,12 +112,12 @@ char* CPlucker_base::geturl(UInt16 tgt) fread(&name, 1, sizeof(name), fin); fread(&id, 1, sizeof(id), fin); - //qDebug("N:%d, I:%d", ntohs(name), ntohs(id)); + //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl; if (ntohs(name) == 2) { urlsfound = true; urlid = id; - //qDebug("Found url index:%d", ntohs(urlid)); + //odebug << "Found url index:" << ntohs(urlid) << "" << oendl; } -// //qDebug("%x", id); +// //odebug << "" << id << "" << oendl; } if (urlsfound) @@ -130,5 +138,5 @@ char* CPlucker_base::geturl(UInt16 tgt) fread(&urlid, 1, sizeof(urlid), fin); tctr = ntohs(tctr); - //qDebug("tgt:%u urlctr:%u tctr:%u", tgt, urlctr, tctr); + //odebug << "tgt:" << tgt << " urlctr:" << urlctr << " tctr:" << tctr << "" << oendl; if (tctr >= tgt) { @@ -137,5 +145,5 @@ char* CPlucker_base::geturl(UInt16 tgt) urlctr = tctr; } - //qDebug("urls are in %d", ntohs(urlid)); + //odebug << "urls are in " << ntohs(urlid) << "" << oendl; recptr = finduid(ntohs(urlid)); if (recptr != 0) @@ -144,5 +152,5 @@ char* CPlucker_base::geturl(UInt16 tgt) gotorecordnumber(recptr); GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); - //qDebug("Found urls:%x",thishdr_type); + //odebug << "Found urls:" << thishdr_type << "" << oendl; urlsize = thishdr_size; urls = new char[urlsize]; @@ -154,5 +162,5 @@ char* CPlucker_base::geturl(UInt16 tgt) if (rn == tgt) { - //qDebug("URL:%s", ptr); + //odebug << "URL:" << ptr << "" << oendl; int len = strlen(ptr)+1; pRet = new char[len]; @@ -251,5 +259,5 @@ void CPlucker_base::locate(unsigned int n) recptr--; gotorecordnumber(recptr); - //qDebug("recptr:%u", recptr); + //odebug << "recptr:" << recptr << "" << oendl; GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); if (thishdr_type < 2) @@ -276,5 +284,5 @@ void CPlucker_base::locate(unsigned int n) } } -// qDebug("Time(1): %u", clock()-start); +// odebug << "Time(1): " << clock()-start << "" << oendl; /* expand(recptr); @@ -322,8 +330,8 @@ void CPlucker_base::locate(unsigned int n) } while (locpos + bs <= n); -// qDebug("Time(2): %u", clock()-start); +// odebug << "Time(2): " << clock()-start << "" << oendl; if (recptr != thisrec) { - qDebug("Disaster:recptr:%u thisrec:%u", recptr, thisrec); + odebug << "Disaster:recptr:" << recptr << " thisrec:" << thisrec << "" << oendl; UInt16 thishdr_uid, thishdr_nParagraphs; UInt32 thishdr_size = buffercontent; @@ -333,5 +341,5 @@ void CPlucker_base::locate(unsigned int n) gotorecordnumber(recptr); GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); -// qDebug("UID:%u Paras:%u Size:%u Type:%u Reserved:%u", thishdr_uid, thishdr_nParagraphs, thishdr_size, (unsigned int)thishdr_type, (unsigned int)thishdr_reserved); +// odebug << "UID:" << thishdr_uid << " Paras:" << thishdr_nParagraphs << " Size:" << thishdr_size << " Type:" << (unsigned int)thishdr_type << " Reserved:" << (unsigned int)thishdr_reserved << "" << oendl; } // QApplication::exit ( 100 ); @@ -372,7 +380,7 @@ bool CPlucker_base::expand(int thisrec) { GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); - //qDebug("This (%d) type is %d, uid is %u", thisrec, thishdr_type, thishdr_uid); + //odebug << "This (" << thisrec << ") type is " << thishdr_type << ", uid is " << thishdr_uid << "" << oendl; if (thishdr_type < 2) break; - //qDebug("Skipping paragraph of type %d", thishdr_type); + //odebug << "Skipping paragraph of type " << thishdr_type << "" << oendl; if (++thisrec >= ntohs(head.recordList.numRecords) - 1) return false; reclen = recordlength(thisrec); @@ -381,5 +389,5 @@ bool CPlucker_base::expand(int thisrec) m_nParas = thishdr_nParagraphs; m_bufferisreserved = (thishdr_reserved != 0); - //qDebug("It has %u paragraphs and is %u bytes", thishdr_nParagraphs, thishdr_size); + //odebug << "It has " << thishdr_nParagraphs << " paragraphs and is " << thishdr_size << " bytes" << oendl; uid = thishdr_uid; // gotorecordnumber(thisrec); @@ -392,10 +400,10 @@ bool CPlucker_base::expand(int thisrec) m_ParaOffsets[i] = ntohs(ubytes); m_ParaAttrs[i] = ntohs(attrs); -// //qDebug("Bytes %u, Attr %x", ntohs(ubytes), ntohs(attrs)); +// //odebug << "Bytes " << ntohs(ubytes) << ", Attr " << ntohs(attrs) << "" << oendl; } if (m_nParas > 0) { m_nextPara = m_ParaOffsets[0]; - //qDebug("First offset = %u", m_nextPara); + //odebug << "First offset = " << m_nextPara << "" << oendl; m_nextParaIndex = 0; } @@ -419,5 +427,5 @@ bool CPlucker_base::expand(int thisrec) bufferpos = 0; bufferrec = thisrec; - //qDebug("BC:%u, HS:%u", buffercontent, thishdr_size); + //odebug << "BC:" << buffercontent << ", HS:" << thishdr_size << "" << oendl; return true; } @@ -453,5 +461,5 @@ void CPlucker_base::UnZip(UInt8* compressedbuffer, size_t reclen, UInt8* tgtbuff err = inflate( &zstream, Z_SYNC_FLUSH ); -// //qDebug("err:%d - %u", err, zstream.avail_in); +// //odebug << "err:" << err << " - " << zstream.avail_in << "" << oendl; } while ( err == Z_OK ); @@ -535,7 +543,7 @@ CList<Bkmk>* CPlucker_base::getbkmklist() fread(&n, 1, sizeof(n), fin); n = ntohs(n); - //qDebug("Found %u bookmarks", n); + //odebug << "Found " << n << " bookmarks" << oendl; } - //qDebug("Found:%d, %u", i , thishdr_type); + //odebug << "Found:" << i << ", " << thishdr_type << "" << oendl; } */ @@ -593,5 +601,5 @@ QImage* CPlucker_base::getPicture(unsigned long tgt) void CPlucker_base::showimg(UInt16 tgt) { - //qDebug("Crassssssh!"); + //odebug << "Crassssssh!" << oendl; QPixmap* qimage = expandimg(tgt); m_picture->setFixedSize(qimage->size()); @@ -604,5 +612,5 @@ void CPlucker_base::showimg(UInt16 tgt) QImage* qimage = getimg(tgt); QPixmap* image = new QPixmap(0,0); -// //qDebug("New image"); +// //odebug << "New image" << oendl; image->convertFromImage(*qimage); delete qimage; @@ -611,5 +619,5 @@ void CPlucker_base::showimg(UInt16 tgt) int f = mkstemp(tmpfile); close(f); - //qDebug("TMPFILE:%s", tmpfile); + //odebug << "TMPFILE:" << tmpfile << "" << oendl; if (image->save(tmpfile,"PNG")) { @@ -628,5 +636,5 @@ void CPlucker_base::showimg(UInt16 tgt) unsigned short CPlucker_base::finduid(unsigned short urlid) { -// //qDebug("Finding %u", urlid); +// //odebug << "Finding " << urlid << "" << oendl; unsigned short jmin = 1, jmax = ntohs(head.recordList.numRecords); unsigned short jmid = (jmin+jmax) >> 1; @@ -639,5 +647,5 @@ unsigned short CPlucker_base::finduid(unsigned short urlid) GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); unsigned short luid = thishdr_uid; -// //qDebug("%u %u %u : %u", jmin, jmid, jmax, urlid); +// //odebug << "" << jmin << " " << jmid << " " << jmax << " : " << urlid << "" << oendl; if (luid == urlid) { @@ -660,5 +668,5 @@ unsigned short CPlucker_base::finduid(unsigned short urlid) GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); unsigned short luid = thishdr_uid; - //qDebug("jmin at end:%u,%u", jmin, luid); + //odebug << "jmin at end:" << jmin << "," << luid << "" << oendl; if (luid == urlid) { @@ -668,10 +676,10 @@ unsigned short CPlucker_base::finduid(unsigned short urlid) GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); luid = thishdr_uid; - //qDebug("jmax at end:%u,%u", jmax, luid); + //odebug << "jmax at end:" << jmax << "," << luid << "" << oendl; if (luid == urlid) { return jmax; } - //qDebug("Couldn't find %u", urlid); + //odebug << "Couldn't find " << urlid << "" << oendl; return 0; // Not found! } @@ -699,5 +707,5 @@ void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsig { unsigned long t = *it; -// qDebug("[%u]", t); +// odebug << "[" << t << "]" << oendl; memcpy(newdata, &t, sizeof(t)); newdata += sizeof(t); @@ -722,5 +730,5 @@ void CPlucker_base::putSaveData(unsigned char*& src, unsigned short& srclen) { memcpy(&t, src, sizeof(t)); -// qDebug("[%u]", t); +// odebug << "[" << t << "]" << oendl; visited.push_front(t); src += sizeof(t); @@ -752,8 +760,8 @@ int CPlucker_base::OpenFile(const char *src) expandedtextbuffer = new UInt8[buffersize]; - //qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); + //odebug << "Total number of records:" << ntohs(head.recordList.numRecords) << "" << oendl; unsigned int nrecs = ntohs(hdr0.nRecords); - //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs); + //odebug << "Version " << ntohs(hdr0.version) << ", no. recs " << nrecs << "" << oendl; UInt16 homerecid = 1; for (unsigned int i = 0; i < nrecs; i++) @@ -762,5 +770,5 @@ int CPlucker_base::OpenFile(const char *src) fread(&name, 1, sizeof(name), fin); fread(&id, 1, sizeof(id), fin); - //qDebug("N:%d, I:%d", ntohs(name), ntohs(id)); + //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl; if (ntohs(name) == 0) homerecid = ntohs(id); } @@ -820,5 +828,5 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) UInt16 tuid = (n >> 16); n &= 0xffff; -// //qDebug("Hyper:<%u,%u>", tuid, n); +// //odebug << "Hyper:<" << tuid << "," << n << ">" << oendl; UInt16 thisrec = 1; currentpos = 0; @@ -832,5 +840,5 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) if (tuid == thishdr_uid) break; if (thishdr_type < 2) currentpos += thishdr_size; -// //qDebug("hyper-cp:%u", currentpos); +// //odebug << "hyper-cp:" << currentpos << "" << oendl; thisrec++; if (thisrec >= ntohs(head.recordList.numRecords)) @@ -858,5 +866,5 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) #else #endif /* USEQPE */ - //qDebug("Link:%s", (const char*)wrd); + //odebug << "Link:" << wrd << "" << oendl; // setlink(fn, wrd); delete [] turl; @@ -927,5 +935,5 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) return eNone; } - //qDebug("Hyper:<%u,%u>", tuid, n); + //odebug << "Hyper:<" << tuid << "," << n << ">" << oendl; while (bufferpos < n && bufferpos < buffercontent) getch_base(true); /* // This is faster but the alignment doesn't get set @@ -957,9 +965,9 @@ tchar CPlucker_base::getch_base(bool fast) { ch = bgetch(); -// //qDebug("Function:%x", ch); +// //odebug << "Function:" << ch << "" << oendl; switch (ch) { case 0x38: -// //qDebug("Break:%u", locate()); +// //odebug << "Break:" << locate() << "" << oendl; if (m_lastBreak == locate()) { @@ -981,5 +989,5 @@ tchar CPlucker_base::getch_base(bool fast) int ch = bgetch(); ln = (ln << 8) + ch; -// //qDebug("ch:%d, ln:%u", ch, ln); +// //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl; } if (skip == 2) @@ -993,8 +1001,8 @@ tchar CPlucker_base::getch_base(bool fast) int ch = bgetch(); ln = (ln << 8) + ch; -// //qDebug("ch:%d, ln:%u", ch, ln); +// //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl; } } -// //qDebug("ln:%u", ln); +// //odebug << "ln:" << ln << "" << oendl; mystyle.setLink(true); mystyle.setData(ln); @@ -1039,5 +1047,5 @@ tchar CPlucker_base::getch_base(bool fast) { ch = bgetch(); -// //qDebug("Font:%d",ch); +// //odebug << "Font:" << ch << "" << oendl; mystyle.setVOffset(0); mystyle.unsetMono(); @@ -1073,5 +1081,5 @@ tchar CPlucker_base::getch_base(bool fast) break; case 8: // should be fixed width - //qDebug("Trying fixed width"); + //odebug << "Trying fixed width" << oendl; mystyle.setMono(); break; @@ -1088,5 +1096,5 @@ tchar CPlucker_base::getch_base(bool fast) break; default: - qDebug("Unrecognised font"); + odebug << "Unrecognised font" << oendl; break; } @@ -1100,17 +1108,17 @@ tchar CPlucker_base::getch_base(bool fast) case 0: mystyle.setLeftJustify(); -// //qDebug("left"); +// //odebug << "left" << oendl; break; case 1: mystyle.setRightJustify(); -// //qDebug("right"); +// //odebug << "right" << oendl; break; case 2: mystyle.setCentreJustify(); -// //qDebug("centre"); +// //odebug << "centre" << oendl; break; case 3: mystyle.setFullJustify(); -// //qDebug("full"); +// //odebug << "full" << oendl; break; @@ -1135,5 +1143,5 @@ tchar CPlucker_base::getch_base(bool fast) if (hasalternate) { - //qDebug("Alternate image:%x", ir); + //odebug << "Alternate image:" << ir << "" << oendl; UInt16 ir2 = bgetch(); ir2 = (ir2 << 8) + bgetch(); @@ -1150,5 +1158,5 @@ tchar CPlucker_base::getch_base(bool fast) if (!fast) mystyle.setPicture(true, expandimg(ir)); } -// if (mystyle.getLink()) qDebug("Picture link!"); +// if (mystyle.getLink()) odebug << "Picture link!" << oendl; ch = '#'; } @@ -1161,5 +1169,5 @@ tchar CPlucker_base::getch_base(bool fast) UInt8 pc = bgetch(); UInt16 w = wc; -// //qDebug("h,w,pc [%u, %u, %u]", h, w, pc); +// //odebug << "h,w,pc [" << h << ", " << w << ", " << pc << "]" << oendl; if (w == 0) { @@ -1168,5 +1176,5 @@ tchar CPlucker_base::getch_base(bool fast) if (w == 0) w = m_scrWidth; mystyle.setPicture(false, hRule(w,h,mystyle.Red(),mystyle.Green(),mystyle.Blue())); -// if (mystyle.getLink()) //qDebug("hRule link!"); +// if (mystyle.getLink()) //odebug << "hRule link!" << oendl; ch = '#'; } @@ -1183,8 +1191,8 @@ tchar CPlucker_base::getch_base(bool fast) ch = bgetch(); mystyle.setLeftMargin(ch); -// //qDebug("Left margin:%d", ch); +// //odebug << "Left margin:" << ch << "" << oendl; ch = bgetch(); mystyle.setRightMargin(ch); -// //qDebug("Right margin:%d", ch); +// //odebug << "Right margin:" << ch << "" << oendl; ch = bgetch(); break; @@ -1204,10 +1212,10 @@ tchar CPlucker_base::getch_base(bool fast) ch |= (tchar)bgetch(); for (int i = 0; i < tlen; i++) bgetch(); - //qDebug("Function 83"); + //odebug << "Function 83" << oendl; } break; case 0x85: default: - qDebug("Function:%x NOT IMPLEMENTED", ch); + odebug << "Function:" << ch << " NOT IMPLEMENTED" << oendl; { int skip = ch & 7; @@ -1215,5 +1223,5 @@ tchar CPlucker_base::getch_base(bool fast) { ch = bgetch(); - //qDebug("Arg %d, %d", i, ch); + //odebug << "Arg " << i << ", " << ch << "" << oendl; } ch = bgetch(); |