-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 | |||
@@ -28,14 +28,14 @@ CList<Bkmk>* Aportis::getbkmklist() | |||
28 | { | 28 | { |
29 | char name[17]; | 29 | char name[17]; |
30 | name[16] = '\0'; | 30 | name[16] = '\0'; |
31 | // qDebug("Record:%d, Length:%u",i,recordlength(i)); | 31 | // odebug << "Record:" << i << ", Length:" << recordlength(i) << "" << oendl; |
32 | gotorecordnumber(i); | 32 | gotorecordnumber(i); |
33 | fread(name,1,16,fin); | 33 | fread(name,1,16,fin); |
34 | unsigned long lcn; | 34 | unsigned long lcn; |
35 | fread(&lcn,sizeof(lcn),1,fin); | 35 | fread(&lcn,sizeof(lcn),1,fin); |
36 | lcn ^= 0xa5a5a5a5; | 36 | lcn ^= 0xa5a5a5a5; |
37 | lcn = SwapLong(lcn); | 37 | lcn = SwapLong(lcn); |
38 | // qDebug("Bookmark:%s:%u", name,lcn); | 38 | // odebug << "Bookmark:" << name << ":" << lcn << "" << oendl; |
39 | tchar tname[17]; | 39 | tchar tname[17]; |
40 | memset(tname, 0, sizeof(tname)); | 40 | memset(tname, 0, sizeof(tname)); |
41 | for (int i = 0; name[i] != 0; i++) | 41 | for (int i = 0; name[i] != 0; i++) |
@@ -121,7 +121,7 @@ int Aportis::OpenFile(const char *src) | |||
121 | PeanutHeader hdr0; | 121 | PeanutHeader hdr0; |
122 | gotorecordnumber(0); | 122 | gotorecordnumber(0); |
123 | fread(&hdr0, sizeof(hdr0), 1, fin); | 123 | fread(&hdr0, sizeof(hdr0), 1, fin); |
124 | // qDebug("Version:%x", ntohs(hdr0.Version)); | 124 | // odebug << "Version:" << ntohs(hdr0.Version) << "" << oendl; |
125 | if (hdr0.Version && 0x0200) | 125 | if (hdr0.Version && 0x0200) |
126 | { | 126 | { |
127 | bCompressed = 2; | 127 | bCompressed = 2; |
@@ -182,7 +182,7 @@ int Aportis::OpenFile(const char *src) | |||
182 | cbptr = 0; | 182 | cbptr = 0; |
183 | outptr = 0; | 183 | outptr = 0; |
184 | refreshbuffer(); | 184 | refreshbuffer(); |
185 | // qDebug("Number of records:[%u,%u]", nRecs, nRecs2); | 185 | // odebug << "Number of records:[" << nRecs << "," << nRecs2 << "]" << oendl; |
186 | return ret; | 186 | return ret; |
187 | } | 187 | } |
188 | 188 | ||
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 | |||
@@ -217,15 +217,15 @@ CList<Bkmk>* BkmkFile::readall() | |||
217 | case 6: | 217 | case 6: |
218 | isUpgraded = false; | 218 | isUpgraded = false; |
219 | bl = readall00(read06); | 219 | bl = readall00(read06); |
220 | // qDebug("Correct version!"); | 220 | // odebug << "Correct version!" << oendl; |
221 | break; | 221 | break; |
222 | case 5: | 222 | case 5: |
223 | isUpgraded = true; | 223 | isUpgraded = true; |
224 | bl = readall00(read05); | 224 | bl = readall00(read05); |
225 | // qDebug("Known version!"); | 225 | // odebug << "Known version!" << oendl; |
226 | break; | 226 | break; |
227 | default: | 227 | default: |
228 | // qDebug("Unknown version!"); | 228 | // odebug << "Unknown version!" << oendl; |
229 | isUpgraded = true; | 229 | isUpgraded = true; |
230 | bl = readall00(read05); | 230 | bl = readall00(read05); |
231 | } | 231 | } |
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 | |||
@@ -32,7 +32,7 @@ linkType BuffDoc::hyperlink(unsigned int n, QString& wrd) | |||
32 | 32 | ||
33 | void BuffDoc::locate(unsigned int n) | 33 | void BuffDoc::locate(unsigned int n) |
34 | { | 34 | { |
35 | // //qDebug("BuffDoc:locating:%u",n); | 35 | // //odebug << "BuffDoc:locating:" << n << "" << oendl; |
36 | lastword.empty(); | 36 | lastword.empty(); |
37 | lastsizes[0] = laststartline = n; | 37 | lastsizes[0] = laststartline = n; |
38 | #ifdef NEWLINEBREAK | 38 | #ifdef NEWLINEBREAK |
@@ -42,7 +42,7 @@ void BuffDoc::locate(unsigned int n) | |||
42 | #endif | 42 | #endif |
43 | // tchar linebuf[1024]; | 43 | // tchar linebuf[1024]; |
44 | if (exp != NULL) exp->locate(n); | 44 | if (exp != NULL) exp->locate(n); |
45 | // //qDebug("BuffDoc:Located"); | 45 | // //odebug << "BuffDoc:Located" << oendl; |
46 | } | 46 | } |
47 | 47 | ||
48 | #ifdef NEWLINEBREAK | 48 | #ifdef NEWLINEBREAK |
@@ -188,7 +188,7 @@ bool BuffDoc::getline(CDrawBuffer* buff, int wth, unsigned char _border) | |||
188 | margindone = true; | 188 | margindone = true; |
189 | } | 189 | } |
190 | else buff->empty(); | 190 | else buff->empty(); |
191 | // //qDebug("Buff:%s Lastword:%s", (const char*)toQString(buff->data()), (const char*)toQString(lastword.data())); | 191 | // //odebug << "Buff:" << toQString(buff->data()) << " Lastword:" << toQString(lastword.data()) << "" << oendl; |
192 | lastcheck = len = buff->length(); | 192 | lastcheck = len = buff->length(); |
193 | unsigned int slen = buff->width(len); | 193 | unsigned int slen = buff->width(len); |
194 | if (slen > w) | 194 | if (slen > w) |
@@ -322,8 +322,8 @@ bool BuffDoc::getline(CDrawBuffer* buff, int wth, int cw, unsigned char _border) | |||
322 | 322 | ||
323 | int BuffDoc::openfile(QWidget* _parent, const char *src) | 323 | int BuffDoc::openfile(QWidget* _parent, const char *src) |
324 | { | 324 | { |
325 | // //qDebug("BuffDoc:Openfile:%s", src); | 325 | // //odebug << "BuffDoc:Openfile:" << src << "" << oendl; |
326 | // //qDebug("Trying aportis %x",exp); | 326 | // //odebug << "Trying aportis " << exp << "" << oendl; |
327 | if (exp != NULL) delete exp; | 327 | if (exp != NULL) delete exp; |
328 | lastword.empty(); | 328 | lastword.empty(); |
329 | lastsizes[0] = laststartline = 0; | 329 | lastsizes[0] = laststartline = 0; |
@@ -378,7 +378,7 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) | |||
378 | if (ret != 0) | 378 | if (ret != 0) |
379 | { | 379 | { |
380 | delete exp; | 380 | delete exp; |
381 | //qDebug("Trying ppms"); | 381 | //odebug << "Trying ppms" << oendl; |
382 | exp = new ppm_expander; | 382 | exp = new ppm_expander; |
383 | ret = exp->openfile(src); | 383 | ret = exp->openfile(src); |
384 | } | 384 | } |
@@ -386,7 +386,7 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) | |||
386 | { | 386 | { |
387 | delete exp; | 387 | delete exp; |
388 | exp = new Text; | 388 | exp = new Text; |
389 | // //qDebug("Trying text"); | 389 | // //odebug << "Trying text" << oendl; |
390 | ret = exp->openfile(src); | 390 | ret = exp->openfile(src); |
391 | } | 391 | } |
392 | 392 | ||
@@ -396,7 +396,7 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) | |||
396 | QMessageBox::information(_parent, PROGNAME, "Unknown file compression type","Try another file"); | 396 | QMessageBox::information(_parent, PROGNAME, "Unknown file compression type","Try another file"); |
397 | return ret; | 397 | return ret; |
398 | } | 398 | } |
399 | // //qDebug("Doing final open:%x:%x",exp,filt); | 399 | // //odebug << "Doing final open:" << exp << ":" << filt << "" << oendl; |
400 | 400 | ||
401 | lastword.empty(); | 401 | lastword.empty(); |
402 | lastsizes[0] = laststartline = 0; | 402 | lastsizes[0] = laststartline = 0; |
@@ -407,6 +407,6 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) | |||
407 | #endif | 407 | #endif |
408 | exp->locate(0); | 408 | exp->locate(0); |
409 | filt->setsource(exp); | 409 | filt->setsource(exp); |
410 | // //qDebug("BuffDoc:file opened"); | 410 | // //odebug << "BuffDoc:file opened" << oendl; |
411 | return 0; | 411 | return 0; |
412 | } | 412 | } |
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 | |||
@@ -40,7 +40,7 @@ void CDrawBuffer::setright(CDrawBuffer& rhs, int f) | |||
40 | CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs) | 40 | CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs) |
41 | { | 41 | { |
42 | int i; | 42 | int i; |
43 | // //qDebug("Trying 2"); | 43 | // //odebug << "Trying 2" << oendl; |
44 | len = rhs.len; | 44 | len = rhs.len; |
45 | m_maxstyle = rhs.m_maxstyle; | 45 | m_maxstyle = rhs.m_maxstyle; |
46 | m_ascent = rhs.m_ascent; | 46 | m_ascent = rhs.m_ascent; |
@@ -58,7 +58,7 @@ CDrawBuffer& CDrawBuffer::operator=(CDrawBuffer& rhs) | |||
58 | for (i = 0; rhs[i] != '\0'; i++) (*this)[i] = rhs[i]; | 58 | for (i = 0; rhs[i] != '\0'; i++) (*this)[i] = rhs[i]; |
59 | (*this)[i] = '\0'; | 59 | (*this)[i] = '\0'; |
60 | len = i; | 60 | len = i; |
61 | // //qDebug("Tried 2"); | 61 | // //odebug << "Tried 2" << oendl; |
62 | return *this; | 62 | return *this; |
63 | } | 63 | } |
64 | 64 | ||
@@ -208,7 +208,7 @@ int CDrawBuffer::width(int numchars, bool onscreen, int scwidth, unsigned char _ | |||
208 | else | 208 | else |
209 | { | 209 | { |
210 | QString nstr = str.mid(lastspace+1, nsp-lastspace); | 210 | QString nstr = str.mid(lastspace+1, nsp-lastspace); |
211 | // qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); | 211 | // odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl; |
212 | int lw = fm.width(nstr); | 212 | int lw = fm.width(nstr); |
213 | cx += lw; | 213 | cx += lw; |
214 | lastspace = nsp; | 214 | lastspace = nsp; |
@@ -317,7 +317,7 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int | |||
317 | CStyle currentstyle = textstart->style; | 317 | CStyle currentstyle = textstart->style; |
318 | QFont f((currentstyle.isMono() && fc->hasCourier()) ? fc->fixedfontname() : fc->name(), fc->getsize(currentstyle), (currentstyle.isBold()) ? QFont::Bold : QFont::Normal, (currentstyle.isItalic()) ); | 318 | QFont f((currentstyle.isMono() && fc->hasCourier()) ? fc->fixedfontname() : fc->name(), fc->getsize(currentstyle), (currentstyle.isBold()) ? QFont::Bold : QFont::Normal, (currentstyle.isItalic()) ); |
319 | //f.setUnderline(currentstyle.isUnderline()); | 319 | //f.setUnderline(currentstyle.isUnderline()); |
320 | //if (currentstyle.isUnderline()) qDebug("UNDERLINE"); | 320 | //if (currentstyle.isUnderline()) odebug << "UNDERLINE" << oendl; |
321 | _p->setFont(f); | 321 | _p->setFont(f); |
322 | QString str = text.mid(textstart->start, end-textstart->start); | 322 | QString str = text.mid(textstart->start, end-textstart->start); |
323 | #if defined(OPIE) || !defined(USEQPE) | 323 | #if defined(OPIE) || !defined(USEQPE) |
@@ -408,7 +408,7 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int | |||
408 | spacenumber++; | 408 | spacenumber++; |
409 | int nexttoadd = (extraspace*spacenumber+spaces/2)/spaces - spacesofar; | 409 | int nexttoadd = (extraspace*spacenumber+spaces/2)/spaces - spacesofar; |
410 | QString nstr = str.mid(lastspace+1, nsp-lastspace); | 410 | QString nstr = str.mid(lastspace+1, nsp-lastspace); |
411 | // qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); | 411 | // odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl; |
412 | int lw = fm.width(nstr); | 412 | int lw = fm.width(nstr); |
413 | _p->drawText( cx, _y+voffset, nstr); | 413 | _p->drawText( cx, _y+voffset, nstr); |
414 | cx += lw+nexttoadd; | 414 | cx += lw+nexttoadd; |
@@ -418,7 +418,7 @@ void CDrawBuffer::render(QPainter* _p, int _y, bool _bMono, int _charWidth, int | |||
418 | else | 418 | else |
419 | { | 419 | { |
420 | QString nstr = str.mid(lastspace+1, nsp-lastspace); | 420 | QString nstr = str.mid(lastspace+1, nsp-lastspace); |
421 | // qDebug("str:%s: last:%d new:%d nstr:%s:", (const char*)str, lastspace, nsp, (const char*)nstr); | 421 | // odebug << "str:" << str << ": last:" << lastspace << " new:" << nsp << " nstr:" << nstr << ":" << oendl; |
422 | int lw = fm.width(nstr); | 422 | int lw = fm.width(nstr); |
423 | _p->drawText( cx, _y+voffset, nstr); | 423 | _p->drawText( cx, _y+voffset, nstr); |
424 | cx += lw; | 424 | cx += lw; |
@@ -470,14 +470,14 @@ linkType CDrawBuffer::getLinkType(int numchars, size_t& tgt) | |||
470 | end = (textend != segs.end()) ? textend->start : len; | 470 | end = (textend != segs.end()) ? textend->start : len; |
471 | currentstyle = textstart->style; | 471 | currentstyle = textstart->style; |
472 | /* | 472 | /* |
473 | if (currentstyle.isPicture()) qDebug("Passed thru picture"); | 473 | if (currentstyle.isPicture()) odebug << "Passed thru picture" << oendl; |
474 | if (currentstyle.getLink()) qDebug("Passed thru link"); | 474 | if (currentstyle.getLink()) odebug << "Passed thru link" << oendl; |
475 | //qDebug("islink:%d - %d", numchars, end); | 475 | //odebug << "islink:" << numchars << " - " << end << "" << oendl; |
476 | */ | 476 | */ |
477 | textstart = textend; | 477 | textstart = textend; |
478 | } | 478 | } |
479 | while (textend != segs.end() && end <= numchars); | 479 | while (textend != segs.end() && end <= numchars); |
480 | // if (currentstyle.isPicture()) qDebug("Clicked on picture"); | 480 | // if (currentstyle.isPicture()) odebug << "Clicked on picture" << oendl; |
481 | if (currentstyle.getPictureLink()) | 481 | if (currentstyle.getPictureLink()) |
482 | { | 482 | { |
483 | tgt = currentstyle.getPictureLinkData(); | 483 | tgt = currentstyle.getPictureLinkData(); |
@@ -539,7 +539,7 @@ void CDrawBuffer::resize() | |||
539 | if (m_bSop) | 539 | if (m_bSop) |
540 | { | 540 | { |
541 | int xt = ((segs.begin()->style.getExtraSpace()+fc->getextraspace())*fc->getsize(segs.begin()->style)+5)/10; | 541 | int xt = ((segs.begin()->style.getExtraSpace()+fc->getextraspace())*fc->getsize(segs.begin()->style)+5)/10; |
542 | //qDebug("ExtraSpace:%d", xt); | 542 | //odebug << "ExtraSpace:" << xt << "" << oendl; |
543 | m_ascent += xt; | 543 | m_ascent += xt; |
544 | m_lineSpacing += xt; | 544 | m_lineSpacing += xt; |
545 | } | 545 | } |
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 | |||
@@ -80,7 +80,7 @@ QTReader::QTReader( const QString& filename, QWidget *parent=0, const tchar *nam | |||
80 | m_fm(NULL) | 80 | m_fm(NULL) |
81 | { | 81 | { |
82 | init(); | 82 | init(); |
83 | // // qDebug("Load_file(1)"); | 83 | // // odebug << "Load_file(1)" << oendl; |
84 | load_file((const tchar*)filename); | 84 | load_file((const tchar*)filename); |
85 | } | 85 | } |
86 | */ | 86 | */ |
@@ -91,7 +91,7 @@ void QTReader::mouseMoveEvent(QMouseEvent* _e) | |||
91 | 91 | ||
92 | mouseUpOn = !(_e->pos().x() == -1); | 92 | mouseUpOn = !(_e->pos().x() == -1); |
93 | 93 | ||
94 | qDebug("MouseMove:[%d, %d]", _e->pos().x(), _e->pos().y()); | 94 | odebug << "MouseMove:[" << _e->pos().x() << ", " << _e->pos().y() << "]" << oendl; |
95 | } | 95 | } |
96 | */ | 96 | */ |
97 | long QTReader::real_delay() | 97 | long QTReader::real_delay() |
@@ -104,7 +104,7 @@ void QTReader::mousePressEvent( QMouseEvent* _e ) | |||
104 | buffdoc.unsuspend(); | 104 | buffdoc.unsuspend(); |
105 | if (_e->button() == RightButton) | 105 | if (_e->button() == RightButton) |
106 | { | 106 | { |
107 | //qDebug("MousePress"); | 107 | //odebug << "MousePress" << oendl; |
108 | mouseUpOn = false; | 108 | mouseUpOn = false; |
109 | if (m_swapmouse) | 109 | if (m_swapmouse) |
110 | { | 110 | { |
@@ -317,7 +317,7 @@ void QTReader::processmousewordevent(size_t startpos, size_t startoffset, QMouse | |||
317 | if (t->width(i, true, width(), m_border) > tgt) | 317 | if (t->width(i, true, width(), m_border) > tgt) |
318 | { | 318 | { |
319 | wrd = toQString(t->data()+first, i - first); | 319 | wrd = toQString(t->data()+first, i - first); |
320 | // qDebug("Got %s", (const char *)wrd); | 320 | // odebug << "Got " << (const char *)wrd << "" << oendl; |
321 | break; | 321 | break; |
322 | } | 322 | } |
323 | while (!QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++; | 323 | while (!QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++; |
@@ -327,7 +327,7 @@ void QTReader::processmousewordevent(size_t startpos, size_t startoffset, QMouse | |||
327 | } | 327 | } |
328 | if (!wrd.isEmpty()) | 328 | if (!wrd.isEmpty()) |
329 | { | 329 | { |
330 | //qDebug("Selected:%s", (const char*)wrd); | 330 | //odebug << "Selected:" << wrd << "" << oendl; |
331 | emit OnWordSelected(wrd, locnarray[lineno], (m_twotouch) ? wrd : toQString(textarray[lineno]->data())); | 331 | emit OnWordSelected(wrd, locnarray[lineno], (m_twotouch) ? wrd : toQString(textarray[lineno]->data())); |
332 | } | 332 | } |
333 | } | 333 | } |
@@ -339,7 +339,7 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e ) | |||
339 | { | 339 | { |
340 | if (mouseUpOn) | 340 | if (mouseUpOn) |
341 | { | 341 | { |
342 | // qDebug("MouseRelease"); | 342 | // odebug << "MouseRelease" << oendl; |
343 | if (_e->x() > width() - m_border) | 343 | if (_e->x() > width() - m_border) |
344 | { | 344 | { |
345 | locate(buffdoc.startSection()+((buffdoc.endSection()-buffdoc.startSection())*_e->y()+height()/2)/height()); | 345 | locate(buffdoc.startSection()+((buffdoc.endSection()-buffdoc.startSection())*_e->y()+height()/2)/height()); |
@@ -394,7 +394,7 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e ) | |||
394 | } | 394 | } |
395 | case ePicture: | 395 | case ePicture: |
396 | { | 396 | { |
397 | // qDebug("Picture:%x", tgt); | 397 | // odebug << "Picture:" << tgt << "" << oendl; |
398 | QImage* pm = buffdoc.getPicture(tgt); | 398 | QImage* pm = buffdoc.getPicture(tgt); |
399 | if (pm != NULL) | 399 | if (pm != NULL) |
400 | { | 400 | { |
@@ -410,7 +410,7 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e ) | |||
410 | case eNone: | 410 | case eNone: |
411 | break; | 411 | break; |
412 | default: | 412 | default: |
413 | // qDebug("Unknown linktype"); | 413 | // odebug << "Unknown linktype" << oendl; |
414 | return; | 414 | return; |
415 | } | 415 | } |
416 | if (m_swapmouse) | 416 | if (m_swapmouse) |
@@ -696,7 +696,7 @@ void QTReader::setautoscroll(bool _sc) | |||
696 | #ifdef _SCROLLPIPE | 696 | #ifdef _SCROLLPIPE |
697 | if (!m_pipetarget.isEmpty()) | 697 | if (!m_pipetarget.isEmpty()) |
698 | { | 698 | { |
699 | // qDebug("Opening pipe to %s", (const char*)m_pipetarget); | 699 | // odebug << "Opening pipe to " << m_pipetarget << "" << oendl; |
700 | m_pipeout = popen((const char*)m_pipetarget, "w"); | 700 | m_pipeout = popen((const char*)m_pipetarget, "w"); |
701 | m_isPaused = false; | 701 | m_isPaused = false; |
702 | } | 702 | } |
@@ -823,24 +823,24 @@ void QTReader::drawFonts( QPainter *p ) | |||
823 | { | 823 | { |
824 | if (bDoUpdates) | 824 | if (bDoUpdates) |
825 | { | 825 | { |
826 | //qDebug("How refreshing..."); | 826 | //odebug << "How refreshing..." << oendl; |
827 | if (buffdoc.empty()) return; | 827 | if (buffdoc.empty()) return; |
828 | setfont(); | 828 | setfont(); |
829 | if (m_lastwidth != width()) | 829 | if (m_lastwidth != width()) |
830 | { | 830 | { |
831 | // qDebug("Not Optimised %d", m_lastwidth); | 831 | // odebug << "Not Optimised " << m_lastwidth << "" << oendl; |
832 | m_lastwidth = width(); | 832 | m_lastwidth = width(); |
833 | m_lastheight = height(); | 833 | m_lastheight = height(); |
834 | buffdoc.setwidth(m_lastwidth-2*m_border); | 834 | buffdoc.setwidth(m_lastwidth-2*m_border); |
835 | locate(pagelocate()); | 835 | locate(pagelocate()); |
836 | // qDebug("Not Optimised %d", m_lastwidth); | 836 | // odebug << "Not Optimised " << m_lastwidth << "" << oendl; |
837 | } | 837 | } |
838 | else | 838 | else |
839 | { | 839 | { |
840 | int newht = height(); | 840 | int newht = height(); |
841 | if (m_lastheight > newht) | 841 | if (m_lastheight > newht) |
842 | { | 842 | { |
843 | // qDebug("Optimised < %d %d %d", numlines, m_lastheight, newht); | 843 | // odebug << "Optimised < " << numlines << " " << m_lastheight << " " << newht << "" << oendl; |
844 | int ypos = 0; | 844 | int ypos = 0; |
845 | for (int i = 0; i < numlines; i++) | 845 | for (int i = 0; i < numlines; i++) |
846 | { | 846 | { |
@@ -851,19 +851,19 @@ void QTReader::drawFonts( QPainter *p ) | |||
851 | break; | 851 | break; |
852 | } | 852 | } |
853 | } | 853 | } |
854 | // qDebug("Optimised < %d", numlines); | 854 | // odebug << "Optimised < " << numlines << "" << oendl; |
855 | m_lastheight = newht; | 855 | m_lastheight = newht; |
856 | } | 856 | } |
857 | else if (m_lastheight < newht) | 857 | else if (m_lastheight < newht) |
858 | { | 858 | { |
859 | // qDebug("Optimised > %d", numlines); | 859 | // odebug << "Optimised > " << numlines << "" << oendl; |
860 | int ypos = 0; | 860 | int ypos = 0; |
861 | for (int i = 0; i <= numlines; i++) | 861 | for (int i = 0; i <= numlines; i++) |
862 | { | 862 | { |
863 | ypos += textarray[i]->lineSpacing(); | 863 | ypos += textarray[i]->lineSpacing(); |
864 | } | 864 | } |
865 | fillbuffer(numlines+1, ypos, newht); | 865 | fillbuffer(numlines+1, ypos, newht); |
866 | // qDebug("Optimised > %d", numlines); | 866 | // odebug << "Optimised > " << numlines << "" << oendl; |
867 | } | 867 | } |
868 | if (numlines > 0) | 868 | if (numlines > 0) |
869 | { | 869 | { |
@@ -897,7 +897,7 @@ void QTReader::drawFonts( QPainter *p ) | |||
897 | /* | 897 | /* |
898 | else | 898 | else |
899 | { | 899 | { |
900 | qDebug("Not so refreshing..."); | 900 | odebug << "Not so refreshing..." << oendl; |
901 | } | 901 | } |
902 | */ | 902 | */ |
903 | } | 903 | } |
@@ -1028,7 +1028,7 @@ void QTReader::paintEvent( QPaintEvent * ) | |||
1028 | /* | 1028 | /* |
1029 | void QTReader::resizeEvent( QResizeEvent * ) | 1029 | void QTReader::resizeEvent( QResizeEvent * ) |
1030 | { | 1030 | { |
1031 | // // qDebug("resize:(%u,%u)", width(), height()); | 1031 | // // odebug << "resize:(" << width() << "," << height() << ")" << oendl; |
1032 | // bgroup->move( width()-bgroup->width(), 0 ); | 1032 | // bgroup->move( width()-bgroup->width(), 0 ); |
1033 | } | 1033 | } |
1034 | */ | 1034 | */ |
@@ -1053,11 +1053,11 @@ bool QTReader::locate(unsigned long n) { | |||
1053 | //printf("Locate\n"); | 1053 | //printf("Locate\n"); |
1054 | buffdoc.unsuspend(); | 1054 | buffdoc.unsuspend(); |
1055 | buffdoc.locate(n); | 1055 | buffdoc.locate(n); |
1056 | // // qDebug("&buffdoc.located"); | 1056 | // // odebug << "&buffdoc.located" << oendl; |
1057 | fillbuffer(); | 1057 | fillbuffer(); |
1058 | // // qDebug("&Buffer filled"); | 1058 | // // odebug << "&Buffer filled" << oendl; |
1059 | update(); | 1059 | update(); |
1060 | // // qDebug("&Located"); | 1060 | // // odebug << "&Located" << oendl; |
1061 | return true; | 1061 | return true; |
1062 | } | 1062 | } |
1063 | 1063 | ||
@@ -1117,12 +1117,12 @@ bool QTReader::fillbuffer(int reuse, int ht, int newht) | |||
1117 | 1117 | ||
1118 | void QTReader::dopagedn() | 1118 | void QTReader::dopagedn() |
1119 | { | 1119 | { |
1120 | // qDebug("HEIGHT(2):%d", m_lastheight); | 1120 | // odebug << "HEIGHT(2):" << m_lastheight << "" << oendl; |
1121 | buffdoc.unsuspend(); | 1121 | buffdoc.unsuspend(); |
1122 | int skip = 0, ypos = 0; | 1122 | int skip = 0, ypos = 0; |
1123 | if (locate() != mylastpos) | 1123 | if (locate() != mylastpos) |
1124 | { | 1124 | { |
1125 | ////qDebug("Jumping to %u", mylastpos); | 1125 | ////odebug << "Jumping to " << mylastpos << "" << oendl; |
1126 | jumpto(mylastpos); | 1126 | jumpto(mylastpos); |
1127 | } | 1127 | } |
1128 | CDrawBuffer* reusebuffer = textarray[numlines]; | 1128 | CDrawBuffer* reusebuffer = textarray[numlines]; |
@@ -1313,13 +1313,13 @@ bool QTReader::load_file(const char *newfile, unsigned int _lcn) | |||
1313 | buffdoc.setwidth(m_lastwidth-2*m_border); | 1313 | buffdoc.setwidth(m_lastwidth-2*m_border); |
1314 | bRC = true; | 1314 | bRC = true; |
1315 | buffdoc.setContinuous(m_continuousDocument); | 1315 | buffdoc.setContinuous(m_continuousDocument); |
1316 | // // qDebug("buffdoc.openfile done"); | 1316 | // // odebug << "buffdoc.openfile done" << oendl; |
1317 | locate(lcn); | 1317 | locate(lcn); |
1318 | // // qDebug("buffdoc.locate done"); | 1318 | // // odebug << "buffdoc.locate done" << oendl; |
1319 | } | 1319 | } |
1320 | setfilter(getfilter()); | 1320 | setfilter(getfilter()); |
1321 | update(); | 1321 | update(); |
1322 | // // qDebug("Updated"); | 1322 | // // odebug << "Updated" << oendl; |
1323 | return bRC; | 1323 | return bRC; |
1324 | } | 1324 | } |
1325 | 1325 | ||
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 | |||
@@ -17,20 +17,48 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | |||
20 | #include "useqpe.h" | 21 | #include "useqpe.h" |
21 | #include <qregexp.h> | 22 | #include "QTReader.h" |
22 | #include <qclipboard.h> | 23 | #include "GraphicWin.h" |
23 | #include <qwidgetstack.h> | 24 | #include "Bkmks.h" |
25 | #include "cbkmkselector.h" | ||
26 | #include "infowin.h" | ||
27 | #include "ToolbarPrefs.h" | ||
28 | #include "Prefs.h" | ||
29 | #include "CAnnoEdit.h" | ||
30 | #include "QFloatBar.h" | ||
31 | #include "FixedFont.h" | ||
32 | #include "URLDialog.h" | ||
33 | #include "QTReaderApp.h" | ||
34 | #include "CDrawBuffer.h" | ||
35 | #include "Filedata.h" | ||
36 | #include "opie.h" | ||
37 | #include "names.h" | ||
38 | #include "CEncoding_tables.h" | ||
39 | #include "CloseDialog.h" | ||
40 | |||
41 | /* OPIE */ | ||
42 | #include <opie2/odebug.h> | ||
43 | #ifdef USEQPE | ||
44 | #include <qpe/menubutton.h> | ||
45 | #include <qpe/fontdatabase.h> | ||
46 | #include <qpe/global.h> | ||
47 | #include <qpe/applnk.h> | ||
48 | #include <qpe/config.h> | ||
49 | #include <qpe/qcopenvelope_qws.h> | ||
50 | #endif | ||
51 | |||
52 | /* QT */ | ||
24 | #ifdef USEQPE | 53 | #ifdef USEQPE |
25 | #include <qmenubar.h> | 54 | #include <qmenubar.h> |
26 | #include <qtoolbar.h> | 55 | #include <qtoolbar.h> |
27 | #endif | 56 | #endif |
57 | #include <qregexp.h> | ||
58 | #include <qclipboard.h> | ||
59 | #include <qwidgetstack.h> | ||
28 | #include <qmenubar.h> | 60 | #include <qmenubar.h> |
29 | #include <qtoolbar.h> | 61 | #include <qtoolbar.h> |
30 | #ifdef USEQPE | ||
31 | #include <qpe/menubutton.h> | ||
32 | #include <qpe/fontdatabase.h> | ||
33 | #endif | ||
34 | #include <qcombobox.h> | 62 | #include <qcombobox.h> |
35 | #include <qpopupmenu.h> | 63 | #include <qpopupmenu.h> |
36 | #include <qaction.h> | 64 | #include <qaction.h> |
@@ -39,33 +67,14 @@ | |||
39 | #include <qtoolbutton.h> | 67 | #include <qtoolbutton.h> |
40 | #include <qspinbox.h> | 68 | #include <qspinbox.h> |
41 | #include <qobjectlist.h> | 69 | #include <qobjectlist.h> |
42 | #ifdef USEQPE | ||
43 | #include <qpe/global.h> | ||
44 | #include <qpe/applnk.h> | ||
45 | #endif | ||
46 | #include <qfileinfo.h> | 70 | #include <qfileinfo.h> |
47 | #include <stdlib.h> //getenv | ||
48 | #include <qprogressbar.h> | 71 | #include <qprogressbar.h> |
49 | #ifdef USEQPE | ||
50 | #include <qpe/config.h> | ||
51 | #endif | ||
52 | #include <qbuttongroup.h> | 72 | #include <qbuttongroup.h> |
53 | #include <qradiobutton.h> | 73 | #include <qradiobutton.h> |
54 | #ifdef USEQPE | 74 | |
55 | #include <qpe/qcopenvelope_qws.h> | 75 | /* STD */ |
56 | #endif | 76 | #include <stdlib.h> //getenv |
57 | #include "QTReader.h" | 77 | |
58 | #include "GraphicWin.h" | ||
59 | #include "Bkmks.h" | ||
60 | #include "cbkmkselector.h" | ||
61 | #include "infowin.h" | ||
62 | #include "ToolbarPrefs.h" | ||
63 | #include "Prefs.h" | ||
64 | #include "CAnnoEdit.h" | ||
65 | #include "QFloatBar.h" | ||
66 | #include "FixedFont.h" | ||
67 | #include "URLDialog.h" | ||
68 | //#include <qpe/fontdatabase.h> | ||
69 | 78 | ||
70 | #ifdef USEQPE | 79 | #ifdef USEQPE |
71 | #include <qpe/resource.h> | 80 | #include <qpe/resource.h> |
@@ -75,14 +84,6 @@ | |||
75 | #include "qfiledialog.h" | 84 | #include "qfiledialog.h" |
76 | #endif | 85 | #endif |
77 | 86 | ||
78 | #include "QTReaderApp.h" | ||
79 | #include "CDrawBuffer.h" | ||
80 | #include "Filedata.h" | ||
81 | #include "opie.h" | ||
82 | #include "names.h" | ||
83 | #include "CEncoding_tables.h" | ||
84 | #include "CloseDialog.h" | ||
85 | |||
86 | bool CheckVersion(int&, int&, char&); | 87 | bool CheckVersion(int&, int&, char&); |
87 | 88 | ||
88 | #ifdef _WINDOWS | 89 | #ifdef _WINDOWS |
@@ -125,7 +126,7 @@ void QTReaderApp::listBkmkFiles() | |||
125 | 126 | ||
126 | QDir d = QDir::home(); // "/" | 127 | QDir d = QDir::home(); // "/" |
127 | if ( !d.cd(APPDIR) ) { // "/tmp" | 128 | if ( !d.cd(APPDIR) ) { // "/tmp" |
128 | qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); | 129 | owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; |
129 | d = QDir::home(); | 130 | d = QDir::home(); |
130 | d.mkdir(APPDIR); | 131 | d.mkdir(APPDIR); |
131 | d.cd(APPDIR); | 132 | d.cd(APPDIR); |
@@ -146,7 +147,7 @@ void QTReaderApp::listBkmkFiles() | |||
146 | bkmkselector->insertItem(fi->fileName()); | 147 | bkmkselector->insertItem(fi->fileName()); |
147 | cnt++; | 148 | cnt++; |
148 | 149 | ||
149 | //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); | 150 | //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl; |
150 | ++it; // goto next list element | 151 | ++it; // goto next list element |
151 | } | 152 | } |
152 | 153 | ||
@@ -214,8 +215,8 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
214 | m_url_localfile = false; | 215 | m_url_localfile = false; |
215 | m_url_globalfile = false; | 216 | m_url_globalfile = false; |
216 | ftime(&m_lastkeytime); | 217 | ftime(&m_lastkeytime); |
217 | //// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir()); | 218 | //// odebug << "Application directory = " << (const tchar *)QPEApplication::documentDir() << "" << oendl; |
218 | //// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml")); | 219 | //// odebug << "Application directory = " << (const tchar *)Global::applicationFileName("uqtreader" << "" << oendl; |
219 | 220 | ||
220 | m_bcloseDisabled = true; | 221 | m_bcloseDisabled = true; |
221 | m_disableesckey = false; | 222 | m_disableesckey = false; |
@@ -243,7 +244,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
243 | m_rot = 270; | 244 | m_rot = 270; |
244 | } | 245 | } |
245 | 246 | ||
246 | // qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot); | 247 | // odebug << "Initial Rotation(" << m_rot << "):" << rot << "" << oendl; |
247 | */ | 248 | */ |
248 | m_autogenstr = "^ *[A-Z].*[a-z] *$"; | 249 | m_autogenstr = "^ *[A-Z].*[a-z] *$"; |
249 | 250 | ||
@@ -260,13 +261,13 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
260 | #else | 261 | #else |
261 | QDir d = QDir::home(); // "/" | 262 | QDir d = QDir::home(); // "/" |
262 | if ( !d.cd(APPDIR) ) { // "/tmp" | 263 | if ( !d.cd(APPDIR) ) { // "/tmp" |
263 | qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); | 264 | owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; |
264 | d = QDir::home(); | 265 | d = QDir::home(); |
265 | d.mkdir(APPDIR); | 266 | d.mkdir(APPDIR); |
266 | d.cd(APPDIR); | 267 | d.cd(APPDIR); |
267 | } | 268 | } |
268 | QFileInfo fi(d, INIFILE); | 269 | QFileInfo fi(d, INIFILE); |
269 | // qDebug("Path:%s", (const char*)fi.absFilePath()); | 270 | // odebug << "Path:" << fi.absFilePath() << "" << oendl; |
270 | Config config(fi.absFilePath()); | 271 | Config config(fi.absFilePath()); |
271 | #endif | 272 | #endif |
272 | config.setGroup("Toolbar"); | 273 | config.setGroup("Toolbar"); |
@@ -356,7 +357,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
356 | // don't need the close visible, it is redundant... | 357 | // don't need the close visible, it is redundant... |
357 | importSelector->setCloseVisible( FALSE ); | 358 | importSelector->setCloseVisible( FALSE ); |
358 | */ | 359 | */ |
359 | // qDebug("Reading file list"); | 360 | // odebug << "Reading file list" << oendl; |
360 | readfilelist(); | 361 | readfilelist(); |
361 | 362 | ||
362 | reader = new QTReader( editorStack ); | 363 | reader = new QTReader( editorStack ); |
@@ -367,7 +368,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
367 | ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold); | 368 | ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold); |
368 | #endif | 369 | #endif |
369 | 370 | ||
370 | // qDebug("Reading config"); | 371 | // odebug << "Reading config" << oendl; |
371 | // Config config( APPDIR ); | 372 | // Config config( APPDIR ); |
372 | config.setGroup( "View" ); | 373 | config.setGroup( "View" ); |
373 | m_debounce = config.readNumEntry("Debounce", 0); | 374 | m_debounce = config.readNumEntry("Debounce", 0); |
@@ -769,7 +770,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
769 | 770 | ||
770 | m_fontBar->setHorizontalStretchable( TRUE ); | 771 | m_fontBar->setHorizontalStretchable( TRUE ); |
771 | 772 | ||
772 | // qDebug("Font selector"); | 773 | // odebug << "Font selector" << oendl; |
773 | m_fontSelector = new QComboBox(false, m_fontBar); | 774 | m_fontSelector = new QComboBox(false, m_fontBar); |
774 | m_fontBar->setStretchableWidget( m_fontSelector ); | 775 | m_fontBar->setStretchableWidget( m_fontSelector ); |
775 | { | 776 | { |
@@ -801,17 +802,17 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
801 | connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), | 802 | connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), |
802 | this, SLOT( msgHandler(const QCString&,const QByteArray&) ) ); | 803 | this, SLOT( msgHandler(const QCString&,const QByteArray&) ) ); |
803 | #endif | 804 | #endif |
804 | // qDebug("Initing"); | 805 | // odebug << "Initing" << oendl; |
805 | reader->init(); | 806 | reader->init(); |
806 | // qDebug("Inited"); | 807 | // odebug << "Inited" << oendl; |
807 | // m_buttonAction[m_spaceTarget]->setOn(true); | 808 | // m_buttonAction[m_spaceTarget]->setOn(true); |
808 | // qDebug("fonting"); | 809 | // odebug << "fonting" << oendl; |
809 | do_setfont(reader->m_fontname); | 810 | do_setfont(reader->m_fontname); |
810 | if (!reader->m_lastfile.isEmpty()) | 811 | if (!reader->m_lastfile.isEmpty()) |
811 | { | 812 | { |
812 | //qDebug("doclnk"); | 813 | // odebug << "doclnk" << oendl; |
813 | //doc = new DocLnk(reader->m_lastfile); | 814 | //doc = new DocLnk(reader->m_lastfile); |
814 | //qDebug("doclnk done"); | 815 | // odebug << "doclnk done" << oendl; |
815 | if (pOpenlist != NULL) | 816 | if (pOpenlist != NULL) |
816 | { | 817 | { |
817 | 818 | ||
@@ -831,24 +832,24 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
831 | { | 832 | { |
832 | break; | 833 | break; |
833 | } | 834 | } |
834 | // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name())); | 835 | // odebug << "Item:" << toQString(CFiledata(p->anno()).name()) << "" << oendl; |
835 | p = NULL; | 836 | p = NULL; |
836 | } | 837 | } |
837 | if (p != NULL) | 838 | if (p != NULL) |
838 | { | 839 | { |
839 | //qDebug("openfrombkmk"); | 840 | // odebug << "openfrombkmk" << oendl; |
840 | if (!openfrombkmk(p)) | 841 | if (!openfrombkmk(p)) |
841 | showEditTools(); | 842 | showEditTools(); |
842 | } | 843 | } |
843 | else | 844 | else |
844 | { | 845 | { |
845 | //qDebug("openfile"); | 846 | // odebug << "openfile" << oendl; |
846 | openFile( reader->m_lastfile ); | 847 | openFile( reader->m_lastfile ); |
847 | } | 848 | } |
848 | } | 849 | } |
849 | else | 850 | else |
850 | { | 851 | { |
851 | // qDebug("Openfile 2"); | 852 | // odebug << "Openfile 2" << oendl; |
852 | if (!reader->m_lastfile.isEmpty()) | 853 | if (!reader->m_lastfile.isEmpty()) |
853 | openFile( reader->m_lastfile ); | 854 | openFile( reader->m_lastfile ); |
854 | } | 855 | } |
@@ -870,7 +871,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
870 | config.writeEntry("BkmkType", bkmktype); | 871 | config.writeEntry("BkmkType", bkmktype); |
871 | config.writeEntry("Minor", (int)minor); | 872 | config.writeEntry("Minor", (int)minor); |
872 | } | 873 | } |
873 | // qDebug("finished update"); | 874 | // odebug << "finished update" << oendl; |
874 | } | 875 | } |
875 | 876 | ||
876 | void QTReaderApp::addtoolbars(Config* config) | 877 | void QTReaderApp::addtoolbars(Config* config) |
@@ -1028,14 +1029,14 @@ QToolBar* QTReaderApp::filebar() | |||
1028 | switch (m_tbpol) | 1029 | switch (m_tbpol) |
1029 | { | 1030 | { |
1030 | case cesSingle: | 1031 | case cesSingle: |
1031 | // qDebug("Setting filebar to menubar"); | 1032 | // odebug << "Setting filebar to menubar" << oendl; |
1032 | fileBar = menubar; | 1033 | fileBar = menubar; |
1033 | break; | 1034 | break; |
1034 | default: | 1035 | default: |
1035 | qDebug("Incorrect toolbar policy set"); | 1036 | odebug << "Incorrect toolbar policy set" << oendl; |
1036 | case cesMenuTool: | 1037 | case cesMenuTool: |
1037 | case cesMultiple: | 1038 | case cesMultiple: |
1038 | // qDebug("Creating new file bar"); | 1039 | // odebug << "Creating new file bar" << oendl; |
1039 | fileBar = new QToolBar("File", this, m_tbposition); | 1040 | fileBar = new QToolBar("File", this, m_tbposition); |
1040 | break; | 1041 | break; |
1041 | } | 1042 | } |
@@ -1053,7 +1054,7 @@ QToolBar* QTReaderApp::viewbar() | |||
1053 | viewBar = new QToolBar("View", this, m_tbposition); | 1054 | viewBar = new QToolBar("View", this, m_tbposition); |
1054 | break; | 1055 | break; |
1055 | default: | 1056 | default: |
1056 | qDebug("Incorrect toolbar policy set"); | 1057 | odebug << "Incorrect toolbar policy set" << oendl; |
1057 | case cesSingle: | 1058 | case cesSingle: |
1058 | case cesMenuTool: | 1059 | case cesMenuTool: |
1059 | viewBar = fileBar; | 1060 | viewBar = fileBar; |
@@ -1069,15 +1070,15 @@ QToolBar* QTReaderApp::navbar() | |||
1069 | switch (m_tbpol) | 1070 | switch (m_tbpol) |
1070 | { | 1071 | { |
1071 | case cesMultiple: | 1072 | case cesMultiple: |
1072 | // qDebug("Creating new nav bar"); | 1073 | // odebug << "Creating new nav bar" << oendl; |
1073 | navBar = new QToolBar("Navigation", this, m_tbposition); | 1074 | navBar = new QToolBar("Navigation", this, m_tbposition); |
1074 | break; | 1075 | break; |
1075 | default: | 1076 | default: |
1076 | qDebug("Incorrect toolbar policy set"); | 1077 | odebug << "Incorrect toolbar policy set" << oendl; |
1077 | case cesSingle: | 1078 | case cesSingle: |
1078 | case cesMenuTool: | 1079 | case cesMenuTool: |
1079 | navBar = fileBar; | 1080 | navBar = fileBar; |
1080 | // qDebug("Setting navbar to filebar"); | 1081 | // odebug << "Setting navbar to filebar" << oendl; |
1081 | break; | 1082 | break; |
1082 | } | 1083 | } |
1083 | } | 1084 | } |
@@ -1093,7 +1094,7 @@ QToolBar* QTReaderApp::markbar() | |||
1093 | markBar = new QToolBar("Marks", this, m_tbposition); | 1094 | markBar = new QToolBar("Marks", this, m_tbposition); |
1094 | break; | 1095 | break; |
1095 | default: | 1096 | default: |
1096 | qDebug("Incorrect toolbar policy set"); | 1097 | odebug << "Incorrect toolbar policy set" << oendl; |
1097 | case cesSingle: | 1098 | case cesSingle: |
1098 | case cesMenuTool: | 1099 | case cesMenuTool: |
1099 | markBar = fileBar; | 1100 | markBar = fileBar; |
@@ -1127,7 +1128,7 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) | |||
1127 | { | 1128 | { |
1128 | QString msg = QString::fromUtf8(_msg); | 1129 | QString msg = QString::fromUtf8(_msg); |
1129 | 1130 | ||
1130 | //// qDebug("Received:%s", (const char*)msg); | 1131 | //// odebug << "Received:" << msg << "" << oendl; |
1131 | 1132 | ||
1132 | QDataStream stream( _data, IO_ReadOnly ); | 1133 | QDataStream stream( _data, IO_ReadOnly ); |
1133 | if ( msg == "info(QString)" ) | 1134 | if ( msg == "info(QString)" ) |
@@ -1481,7 +1482,7 @@ void QTReaderApp::setfullscreen(bool sfs) | |||
1481 | 1482 | ||
1482 | void QTReaderApp::buttonActionSelected(QAction* _a) | 1483 | void QTReaderApp::buttonActionSelected(QAction* _a) |
1483 | { | 1484 | { |
1484 | //// qDebug("es:%x : %s (%u)", _a, (const char *)(_a->text()), ActNameToInt(_a->text())); | 1485 | //// odebug << "es:" << _a << " : " << (const char *)(_a->text()) << " (" << ActNameToInt(_a->text()) << ")" << oendl; |
1485 | m_spaceTarget = ActNameToInt(_a->text()); | 1486 | m_spaceTarget = ActNameToInt(_a->text()); |
1486 | } | 1487 | } |
1487 | 1488 | ||
@@ -1563,7 +1564,7 @@ void QTReaderApp::updatefileinfo() | |||
1563 | if (reader->m_lastfile.isEmpty()) return; | 1564 | if (reader->m_lastfile.isEmpty()) return; |
1564 | tchar* nm = fromQString(reader->m_string); | 1565 | tchar* nm = fromQString(reader->m_string); |
1565 | tchar* fl = fromQString(reader->m_lastfile); | 1566 | tchar* fl = fromQString(reader->m_lastfile); |
1566 | // qDebug("Lastfile:%x", fl); | 1567 | // odebug << "Lastfile:" << fl << "" << oendl; |
1567 | bool notadded = true; | 1568 | bool notadded = true; |
1568 | if (pOpenlist == NULL) pOpenlist = new CList<Bkmk>; | 1569 | if (pOpenlist == NULL) pOpenlist = new CList<Bkmk>; |
1569 | else | 1570 | else |
@@ -1577,7 +1578,7 @@ void QTReaderApp::updatefileinfo() | |||
1577 | unsigned char* data; | 1578 | unsigned char* data; |
1578 | CFiledata fd(iter->anno()); | 1579 | CFiledata fd(iter->anno()); |
1579 | reader->setSaveData(data, dlen, fd.content(), fd.length()); | 1580 | reader->setSaveData(data, dlen, fd.content(), fd.length()); |
1580 | // qDebug("Filedata(1):%u, %u", fd.length(), dlen); | 1581 | // odebug << "Filedata(1):" << fd.length() << ", " << dlen << "" << oendl; |
1581 | // getstate(data, dlen); | 1582 | // getstate(data, dlen); |
1582 | iter->setAnno(data, dlen); | 1583 | iter->setAnno(data, dlen); |
1583 | notadded = false; | 1584 | notadded = false; |
@@ -1586,7 +1587,7 @@ void QTReaderApp::updatefileinfo() | |||
1586 | } | 1587 | } |
1587 | } | 1588 | } |
1588 | } | 1589 | } |
1589 | // qDebug("Added?:%x", notadded); | 1590 | // odebug << "Added?:" << notadded << "" << oendl; |
1590 | if (notadded) | 1591 | if (notadded) |
1591 | { | 1592 | { |
1592 | struct stat fnstat; | 1593 | struct stat fnstat; |
@@ -1596,7 +1597,7 @@ void QTReaderApp::updatefileinfo() | |||
1596 | unsigned char* data; | 1597 | unsigned char* data; |
1597 | reader->setSaveData(data, dlen, fd.content(), fd.length()); | 1598 | reader->setSaveData(data, dlen, fd.content(), fd.length()); |
1598 | pOpenlist->push_front(Bkmk(nm, data, dlen, reader->pagelocate())); | 1599 | pOpenlist->push_front(Bkmk(nm, data, dlen, reader->pagelocate())); |
1599 | //qDebug("Filedata(2):%u, %u", fd.length(), dlen); | 1600 | // odebug << "Filedata(2):" << fd.length() << ", " << dlen << "" << oendl; |
1600 | delete [] data; | 1601 | delete [] data; |
1601 | } | 1602 | } |
1602 | delete [] nm; | 1603 | delete [] nm; |
@@ -1611,7 +1612,7 @@ void QTReaderApp::fileOpen() | |||
1611 | if (regVisible) regBar->hide(); | 1612 | if (regVisible) regBar->hide(); |
1612 | if (searchVisible) searchBar->hide(); | 1613 | if (searchVisible) searchBar->hide(); |
1613 | */ | 1614 | */ |
1614 | // qDebug("fileOpen"); | 1615 | // odebug << "fileOpen" << oendl; |
1615 | // if (!reader->m_lastfile.isEmpty()) | 1616 | // if (!reader->m_lastfile.isEmpty()) |
1616 | updatefileinfo(); | 1617 | updatefileinfo(); |
1617 | fileOpen2(); | 1618 | fileOpen2(); |
@@ -1652,7 +1653,7 @@ void QTReaderApp::fileOpen2() | |||
1652 | reader->setFocus(); | 1653 | reader->setFocus(); |
1653 | } | 1654 | } |
1654 | // reader->refresh(); | 1655 | // reader->refresh(); |
1655 | // qDebug("HEIGHT:%d", reader->m_lastheight); | 1656 | // odebug << "HEIGHT:" << reader->m_lastheight << "" << oendl; |
1656 | } | 1657 | } |
1657 | 1658 | ||
1658 | QString QTReaderApp::usefilebrowser() | 1659 | QString QTReaderApp::usefilebrowser() |
@@ -1672,7 +1673,7 @@ QString QTReaderApp::usefilebrowser() | |||
1672 | { | 1673 | { |
1673 | fn = fb->getCurrentFile(); | 1674 | fn = fb->getCurrentFile(); |
1674 | } | 1675 | } |
1675 | // qDebug("Selected %s", (const char*)fn); | 1676 | // odebug << "Selected " << fn << "" << oendl; |
1676 | delete fb; | 1677 | delete fb; |
1677 | showEditTools(); | 1678 | showEditTools(); |
1678 | return fn; | 1679 | return fn; |
@@ -1803,7 +1804,7 @@ void QTReaderApp::showprefs() | |||
1803 | reader->bpeanut = true; | 1804 | reader->bpeanut = true; |
1804 | break; | 1805 | break; |
1805 | default: | 1806 | default: |
1806 | qDebug("Format out of range"); | 1807 | odebug << "Format out of range" << oendl; |
1807 | } | 1808 | } |
1808 | reader->bdepluck = prefwin->Depluck(); | 1809 | reader->bdepluck = prefwin->Depluck(); |
1809 | reader->bdejpluck = prefwin->Dejpluck(); | 1810 | reader->bdejpluck = prefwin->Dejpluck(); |
@@ -1863,7 +1864,7 @@ void QTReaderApp::showtoolbarprefs() | |||
1863 | QDir d = QDir::home(); // "/" | 1864 | QDir d = QDir::home(); // "/" |
1864 | if ( !d.cd(APPDIR) ) | 1865 | if ( !d.cd(APPDIR) ) |
1865 | { // "/tmp" | 1866 | { // "/tmp" |
1866 | qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); | 1867 | owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl; |
1867 | d = QDir::home(); | 1868 | d = QDir::home(); |
1868 | d.mkdir(APPDIR); | 1869 | d.mkdir(APPDIR); |
1869 | d.cd(APPDIR); | 1870 | d.cd(APPDIR); |
@@ -1900,7 +1901,7 @@ void QTReaderApp::showtoolbarprefs() | |||
1900 | QDir d = QDir::home(); // "/" | 1901 | QDir d = QDir::home(); // "/" |
1901 | if ( !d.cd(APPDIR) ) | 1902 | if ( !d.cd(APPDIR) ) |
1902 | { // "/tmp" | 1903 | { // "/tmp" |
1903 | qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); | 1904 | owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl; |
1904 | d = QDir::home(); | 1905 | d = QDir::home(); |
1905 | d.mkdir(APPDIR); | 1906 | d.mkdir(APPDIR); |
1906 | d.cd(APPDIR); | 1907 | d.cd(APPDIR); |
@@ -2175,7 +2176,7 @@ void QTReaderApp::editFind() | |||
2175 | 2176 | ||
2176 | void QTReaderApp::findNext() | 2177 | void QTReaderApp::findNext() |
2177 | { | 2178 | { |
2178 | // // qDebug("findNext called\n"); | 2179 | // // odebug << "findNext called\n" << oendl; |
2179 | #ifdef __ISEARCH | 2180 | #ifdef __ISEARCH |
2180 | QString arg = searchEdit->text(); | 2181 | QString arg = searchEdit->text(); |
2181 | #else | 2182 | #else |
@@ -2271,12 +2272,12 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg) | |||
2271 | return false; | 2272 | return false; |
2272 | } | 2273 | } |
2273 | } | 2274 | } |
2274 | // qDebug("Found it at %u:%u", pos, offset); | 2275 | // odebug << "Found it at " << pos << ":" << offset << "" << oendl; |
2275 | pbar->hide(); | 2276 | pbar->hide(); |
2276 | // qDebug("Hid"); | 2277 | // odebug << "Hid" << oendl; |
2277 | reader->locate(pos+offset); | 2278 | reader->locate(pos+offset); |
2278 | // qDebug("Loacted"); | 2279 | // odebug << "Loacted" << oendl; |
2279 | // qDebug("page up"); | 2280 | // odebug << "page up" << oendl; |
2280 | ret = true; | 2281 | ret = true; |
2281 | } | 2282 | } |
2282 | else | 2283 | else |
@@ -2333,7 +2334,7 @@ void QTReaderApp::search() | |||
2333 | 2334 | ||
2334 | void QTReaderApp::openFile( const QString &f ) | 2335 | void QTReaderApp::openFile( const QString &f ) |
2335 | { | 2336 | { |
2336 | // qDebug("File:%s", (const char*)f); | 2337 | // odebug << "File:" << f << "" << oendl; |
2337 | // openFile(DocLnk(f)); | 2338 | // openFile(DocLnk(f)); |
2338 | //} | 2339 | //} |
2339 | // | 2340 | // |
@@ -2380,7 +2381,7 @@ void QTReaderApp::resizeEvent(QResizeEvent* e) | |||
2380 | */ | 2381 | */ |
2381 | void QTReaderApp::handlekey(QKeyEvent* e) | 2382 | void QTReaderApp::handlekey(QKeyEvent* e) |
2382 | { | 2383 | { |
2383 | // qDebug("Keypress event"); | 2384 | // odebug << "Keypress event" << oendl; |
2384 | timeb now; | 2385 | timeb now; |
2385 | ftime(&now); | 2386 | ftime(&now); |
2386 | unsigned long etime = (1000*(now.time - m_lastkeytime.time) + now.millitm)-m_lastkeytime.millitm; | 2387 | unsigned long etime = (1000*(now.time - m_lastkeytime.time) + now.millitm)-m_lastkeytime.millitm; |
@@ -2392,7 +2393,7 @@ void QTReaderApp::handlekey(QKeyEvent* e) | |||
2392 | switch(e->key()) | 2393 | switch(e->key()) |
2393 | { | 2394 | { |
2394 | case Key_Escape: | 2395 | case Key_Escape: |
2395 | // qDebug("escape event"); | 2396 | // odebug << "escape event" << oendl; |
2396 | if (m_disableesckey) | 2397 | if (m_disableesckey) |
2397 | { | 2398 | { |
2398 | m_disableesckey = false; | 2399 | m_disableesckey = false; |
@@ -2407,7 +2408,7 @@ void QTReaderApp::handlekey(QKeyEvent* e) | |||
2407 | } | 2408 | } |
2408 | else | 2409 | else |
2409 | { | 2410 | { |
2410 | // qDebug("escape action"); | 2411 | // odebug << "escape action" << oendl; |
2411 | doAction(m_escapeTarget, e); | 2412 | doAction(m_escapeTarget, e); |
2412 | } | 2413 | } |
2413 | } | 2414 | } |
@@ -2506,11 +2507,11 @@ void QTReaderApp::showEditTools() | |||
2506 | } | 2507 | } |
2507 | else | 2508 | else |
2508 | { | 2509 | { |
2509 | //qDebug("him"); | 2510 | // odebug << "him" << oendl; |
2510 | #ifdef USEQPE | 2511 | #ifdef USEQPE |
2511 | Global::hideInputMethod(); | 2512 | Global::hideInputMethod(); |
2512 | #endif | 2513 | #endif |
2513 | //qDebug("eb"); | 2514 | // odebug << "eb" << oendl; |
2514 | menubar->show(); | 2515 | menubar->show(); |
2515 | if (fileBar != NULL) fileBar->show(); | 2516 | if (fileBar != NULL) fileBar->show(); |
2516 | if (viewBar != NULL) viewBar->show(); | 2517 | if (viewBar != NULL) viewBar->show(); |
@@ -2532,20 +2533,20 @@ void QTReaderApp::showEditTools() | |||
2532 | regBar->show(); | 2533 | regBar->show(); |
2533 | } | 2534 | } |
2534 | if (m_fontVisible) m_fontBar->show(); | 2535 | if (m_fontVisible) m_fontBar->show(); |
2535 | //qDebug("sn"); | 2536 | // odebug << "sn" << oendl; |
2536 | showNormal(); | 2537 | showNormal(); |
2537 | //qDebug("sm"); | 2538 | // odebug << "sm" << oendl; |
2538 | #ifdef USEQPE | 2539 | #ifdef USEQPE |
2539 | showMaximized(); | 2540 | showMaximized(); |
2540 | #endif | 2541 | #endif |
2541 | //setCentralWidget(reader); | 2542 | //setCentralWidget(reader); |
2542 | } | 2543 | } |
2543 | 2544 | ||
2544 | // qDebug("uc"); | 2545 | // odebug << "uc" << oendl; |
2545 | updateCaption(); | 2546 | updateCaption(); |
2546 | // qDebug("rw"); | 2547 | // odebug << "rw" << oendl; |
2547 | editorStack->raiseWidget( reader ); | 2548 | editorStack->raiseWidget( reader ); |
2548 | // qDebug("sf"); | 2549 | // odebug << "sf" << oendl; |
2549 | reader->setFocus(); | 2550 | reader->setFocus(); |
2550 | reader->refresh(); | 2551 | reader->refresh(); |
2551 | } | 2552 | } |
@@ -2614,7 +2615,7 @@ void QTReaderApp::setDocument(const QString& fileref) | |||
2614 | 2615 | ||
2615 | void QTReaderApp::closeEvent( QCloseEvent *e ) | 2616 | void QTReaderApp::closeEvent( QCloseEvent *e ) |
2616 | { | 2617 | { |
2617 | // qDebug("Close event"); | 2618 | // odebug << "Close event" << oendl; |
2618 | if (m_fullscreen) | 2619 | if (m_fullscreen) |
2619 | { | 2620 | { |
2620 | m_fullscreen = false; | 2621 | m_fullscreen = false; |
@@ -2631,7 +2632,7 @@ void QTReaderApp::closeEvent( QCloseEvent *e ) | |||
2631 | { | 2632 | { |
2632 | if ((m_escapeTarget != cesNone) && m_bcloseDisabled) | 2633 | if ((m_escapeTarget != cesNone) && m_bcloseDisabled) |
2633 | { | 2634 | { |
2634 | //qDebug("Close disabled"); | 2635 | // odebug << "Close disabled" << oendl; |
2635 | m_bcloseDisabled = false; | 2636 | m_bcloseDisabled = false; |
2636 | e->ignore(); | 2637 | e->ignore(); |
2637 | } | 2638 | } |
@@ -2709,7 +2710,7 @@ bool QTReaderApp::listbkmk(CList<Bkmk>* plist, const QString& _lab) | |||
2709 | for (CList<Bkmk>::iterator i = plist->begin(); i != plist->end(); i++) | 2710 | for (CList<Bkmk>::iterator i = plist->begin(); i != plist->end(); i++) |
2710 | { | 2711 | { |
2711 | #ifdef _UNICODE | 2712 | #ifdef _UNICODE |
2712 | // qDebug("Item:%s", (const char*)toQString(i->name())); | 2713 | // odebug << "Item:" << toQString(i->name()) << "" << oendl; |
2713 | bkmkselector->insertItem(toQString(i->name())); | 2714 | bkmkselector->insertItem(toQString(i->name())); |
2714 | #else | 2715 | #else |
2715 | bkmkselector->insertItem(i->name()); | 2716 | bkmkselector->insertItem(i->name()); |
@@ -2738,9 +2739,9 @@ void QTReaderApp::do_regedit() | |||
2738 | { | 2739 | { |
2739 | // fileBar->hide(); | 2740 | // fileBar->hide(); |
2740 | reader->bDoUpdates = false; | 2741 | reader->bDoUpdates = false; |
2741 | // qDebug("Showing regbar"); | 2742 | // odebug << "Showing regbar" << oendl; |
2742 | regBar->show(); | 2743 | regBar->show(); |
2743 | // qDebug("Showing kbd"); | 2744 | // odebug << "Showing kbd" << oendl; |
2744 | #ifdef USEQPE | 2745 | #ifdef USEQPE |
2745 | Global::showInputMethod(); | 2746 | Global::showInputMethod(); |
2746 | #endif | 2747 | #endif |
@@ -2756,10 +2757,10 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk) | |||
2756 | QString fn = toQString( | 2757 | QString fn = toQString( |
2757 | CFiledata(bk->anno()).name() | 2758 | CFiledata(bk->anno()).name() |
2758 | ); | 2759 | ); |
2759 | //qDebug("fileinfo"); | 2760 | // odebug << "fileinfo" << oendl; |
2760 | if (!fn.isEmpty() && QFileInfo(fn).isFile()) | 2761 | if (!fn.isEmpty() && QFileInfo(fn).isFile()) |
2761 | { | 2762 | { |
2762 | //qDebug("Opening"); | 2763 | // odebug << "Opening" << oendl; |
2763 | openFile(fn); | 2764 | openFile(fn); |
2764 | struct stat fnstat; | 2765 | struct stat fnstat; |
2765 | stat((const char *)reader->m_lastfile, &fnstat); | 2766 | stat((const char *)reader->m_lastfile, &fnstat); |
@@ -2781,7 +2782,7 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk) | |||
2781 | { | 2782 | { |
2782 | QMessageBox::warning(this, PROGNAME, "Not all file data used\nNew version?"); | 2783 | QMessageBox::warning(this, PROGNAME, "Not all file data used\nNew version?"); |
2783 | } | 2784 | } |
2784 | // qDebug("updating"); | 2785 | // odebug << "updating" << oendl; |
2785 | // showEditTools(); | 2786 | // showEditTools(); |
2786 | reader->locate(bk->value()); | 2787 | reader->locate(bk->value()); |
2787 | } | 2788 | } |
@@ -2812,7 +2813,7 @@ void QTReaderApp::gotobkmk(int ind) | |||
2812 | reader->locate((*pBkmklist)[ind]->value()); | 2813 | reader->locate((*pBkmklist)[ind]->value()); |
2813 | break; | 2814 | break; |
2814 | case cDelBkmk: | 2815 | case cDelBkmk: |
2815 | //// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); | 2816 | //// odebug << "Deleting:" << (*pBkmklist)[ind]->name() << "\n" << oendl; |
2816 | pBkmklist->erase(ind); | 2817 | pBkmklist->erase(ind); |
2817 | m_fBkmksChanged = true; | 2818 | m_fBkmksChanged = true; |
2818 | // pBkmklist->sort(); | 2819 | // pBkmklist->sort(); |
@@ -2912,7 +2913,7 @@ void QTReaderApp::gotobkmk(int ind) | |||
2912 | /* | 2913 | /* |
2913 | CFileSelector *f = new CFileSelector("text/html", this, NULL, !m_bFloatingDialog, TRUE, TRUE ); | 2914 | CFileSelector *f = new CFileSelector("text/html", this, NULL, !m_bFloatingDialog, TRUE, TRUE ); |
2914 | int ret = f->exec(); | 2915 | int ret = f->exec(); |
2915 | qDebug("Return:%d", ret); | 2916 | odebug << "Return:" << ret << "" << oendl; |
2916 | DocLnk* doc = f->getDoc(); | 2917 | DocLnk* doc = f->getDoc(); |
2917 | if (doc != NULL) | 2918 | if (doc != NULL) |
2918 | { | 2919 | { |
@@ -2932,11 +2933,11 @@ void QTReaderApp::gotobkmk(int ind) | |||
2932 | } | 2933 | } |
2933 | FileManager fm; | 2934 | FileManager fm; |
2934 | fm.saveFile( *doc, rt ); | 2935 | fm.saveFile( *doc, rt ); |
2935 | qDebug("YES"); | 2936 | odebug << "YES" << oendl; |
2936 | } | 2937 | } |
2937 | else | 2938 | else |
2938 | { | 2939 | { |
2939 | qDebug("NO"); | 2940 | odebug << "NO" << oendl; |
2940 | } | 2941 | } |
2941 | delete f; | 2942 | delete f; |
2942 | */ | 2943 | */ |
@@ -3009,7 +3010,7 @@ void QTReaderApp::do_regaction() | |||
3009 | break; | 3010 | break; |
3010 | #endif | 3011 | #endif |
3011 | case cSetConfigName: | 3012 | case cSetConfigName: |
3012 | // qDebug("Saving config"); | 3013 | // odebug << "Saving config" << oendl; |
3013 | do_saveconfig(regEdit->text(), false); | 3014 | do_saveconfig(regEdit->text(), false); |
3014 | break; | 3015 | break; |
3015 | } | 3016 | } |
@@ -3101,7 +3102,7 @@ void QTReaderApp::setfontHelper(const QString& lcn, int size) | |||
3101 | 3102 | ||
3102 | void QTReaderApp::do_setencoding(int i) | 3103 | void QTReaderApp::do_setencoding(int i) |
3103 | { | 3104 | { |
3104 | // qDebug("setencoding:%d", i); | 3105 | // odebug << "setencoding:" << i << "" << oendl; |
3105 | if (m_fontAction == cChooseEncoding) | 3106 | if (m_fontAction == cChooseEncoding) |
3106 | { | 3107 | { |
3107 | reader->setencoding(i); | 3108 | reader->setencoding(i); |
@@ -3109,9 +3110,9 @@ void QTReaderApp::do_setencoding(int i) | |||
3109 | reader->refresh(); | 3110 | reader->refresh(); |
3110 | m_fontBar->hide(); | 3111 | m_fontBar->hide(); |
3111 | m_fontVisible = false; | 3112 | m_fontVisible = false; |
3112 | // qDebug("showedit"); | 3113 | // odebug << "showedit" << oendl; |
3113 | if (reader->isVisible()) showEditTools(); | 3114 | if (reader->isVisible()) showEditTools(); |
3114 | // qDebug("showeditdone"); | 3115 | // odebug << "showeditdone" << oendl; |
3115 | } | 3116 | } |
3116 | 3117 | ||
3117 | void QTReaderApp::do_setfont(const QString& lcn) | 3118 | void QTReaderApp::do_setfont(const QString& lcn) |
@@ -3123,17 +3124,17 @@ void QTReaderApp::do_setfont(const QString& lcn) | |||
3123 | reader->refresh(); | 3124 | reader->refresh(); |
3124 | m_fontBar->hide(); | 3125 | m_fontBar->hide(); |
3125 | m_fontVisible = false; | 3126 | m_fontVisible = false; |
3126 | // qDebug("showedit"); | 3127 | // odebug << "showedit" << oendl; |
3127 | //if (reader->isVisible()) | 3128 | //if (reader->isVisible()) |
3128 | showEditTools(); | 3129 | showEditTools(); |
3129 | // qDebug("showeditdone"); | 3130 | // odebug << "showeditdone" << oendl; |
3130 | } | 3131 | } |
3131 | 3132 | ||
3132 | void QTReaderApp::do_autogen(const QString& regText) | 3133 | void QTReaderApp::do_autogen(const QString& regText) |
3133 | { | 3134 | { |
3134 | unsigned long fs, ts; | 3135 | unsigned long fs, ts; |
3135 | reader->sizes(fs,ts); | 3136 | reader->sizes(fs,ts); |
3136 | // // qDebug("Reg:%s\n", (const tchar*)(regEdit->text())); | 3137 | // // odebug << "Reg:" << (const tchar*)(regEdit->text()) << "\n" << oendl; |
3137 | m_autogenstr = regText; | 3138 | m_autogenstr = regText; |
3138 | QRegExp re(regText); | 3139 | QRegExp re(regText); |
3139 | CBuffer buff; | 3140 | CBuffer buff; |
@@ -3180,7 +3181,7 @@ void QTReaderApp::do_autogen(const QString& regText) | |||
3180 | 3181 | ||
3181 | void QTReaderApp::saveprefs() | 3182 | void QTReaderApp::saveprefs() |
3182 | { | 3183 | { |
3183 | // qDebug("saveprefs"); | 3184 | // odebug << "saveprefs" << oendl; |
3184 | // reader->saveprefs("uqtreader"); | 3185 | // reader->saveprefs("uqtreader"); |
3185 | // if (!m_loadedconfig) | 3186 | // if (!m_loadedconfig) |
3186 | do_saveconfig( APPDIR, true ); | 3187 | do_saveconfig( APPDIR, true ); |
@@ -3261,11 +3262,11 @@ void QTReaderApp::saveprefs() | |||
3261 | /* | 3262 | /* |
3262 | void QTReaderApp::oldFile() | 3263 | void QTReaderApp::oldFile() |
3263 | { | 3264 | { |
3264 | // qDebug("oldFile called"); | 3265 | // odebug << "oldFile called" << oendl; |
3265 | reader->setText(true); | 3266 | reader->setText(true); |
3266 | // qDebug("settext called"); | 3267 | // odebug << "settext called" << oendl; |
3267 | showEditTools(); | 3268 | showEditTools(); |
3268 | // qDebug("showedit called"); | 3269 | // odebug << "showedit called" << oendl; |
3269 | } | 3270 | } |
3270 | */ | 3271 | */ |
3271 | 3272 | ||
@@ -3341,10 +3342,10 @@ void QTReaderApp::readfilelist() | |||
3341 | #else /* USEQPE */ | 3342 | #else /* USEQPE */ |
3342 | BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles")); | 3343 | BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles")); |
3343 | #endif /* USEQPE */ | 3344 | #endif /* USEQPE */ |
3344 | // qDebug("Reading open files"); | 3345 | // odebug << "Reading open files" << oendl; |
3345 | pOpenlist = bf.readall(); | 3346 | pOpenlist = bf.readall(); |
3346 | // if (pOpenlist != NULL) qDebug("...with success"); | 3347 | // if (pOpenlist != NULL) odebug << "...with success" << oendl; |
3347 | // else qDebug("...without success!"); | 3348 | // else odebug << "...without success!" << oendl; |
3348 | } | 3349 | } |
3349 | 3350 | ||
3350 | void QTReaderApp::savefilelist() | 3351 | void QTReaderApp::savefilelist() |
@@ -3359,7 +3360,7 @@ void QTReaderApp::savefilelist() | |||
3359 | #else /* USEQPE */ | 3360 | #else /* USEQPE */ |
3360 | BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles"), true); | 3361 | BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles"), true); |
3361 | #endif /* USEQPE */ | 3362 | #endif /* USEQPE */ |
3362 | //qDebug("Writing open files"); | 3363 | // odebug << "Writing open files" << oendl; |
3363 | bf.write(*pOpenlist); | 3364 | bf.write(*pOpenlist); |
3364 | } | 3365 | } |
3365 | } | 3366 | } |
@@ -3469,7 +3470,7 @@ void QTReaderApp::showAnnotation() | |||
3469 | 3470 | ||
3470 | void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& line) | 3471 | void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& line) |
3471 | { | 3472 | { |
3472 | //// qDebug("OnWordSelected(%u):%s", posn, (const char*)wrd); | 3473 | //// odebug << "OnWordSelected(" << posn << "):" << wrd << "" << oendl; |
3473 | 3474 | ||
3474 | if (m_doClipboard) | 3475 | if (m_doClipboard) |
3475 | { | 3476 | { |
@@ -3519,7 +3520,7 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) | |||
3519 | else | 3520 | else |
3520 | { | 3521 | { |
3521 | e->accept(); | 3522 | e->accept(); |
3522 | //qDebug("Accepted"); | 3523 | // odebug << "Accepted" << oendl; |
3523 | switch (a) | 3524 | switch (a) |
3524 | { | 3525 | { |
3525 | case cesOpenFile: | 3526 | case cesOpenFile: |
@@ -3582,7 +3583,7 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) | |||
3582 | gotoEnd(); | 3583 | gotoEnd(); |
3583 | break; | 3584 | break; |
3584 | default: | 3585 | default: |
3585 | qDebug("Unknown ActionType:%u", a); | 3586 | odebug << "Unknown ActionType:" << a << "" << oendl; |
3586 | break; | 3587 | break; |
3587 | } | 3588 | } |
3588 | } | 3589 | } |
@@ -3600,7 +3601,7 @@ void QTReaderApp::SaveConfig() | |||
3600 | 3601 | ||
3601 | void QTReaderApp::do_saveconfig(const QString& _txt, bool full) | 3602 | void QTReaderApp::do_saveconfig(const QString& _txt, bool full) |
3602 | { | 3603 | { |
3603 | // qDebug("do_saveconfig:%s", (const char*)_txt); | 3604 | // odebug << "do_saveconfig:" << _txt << "" << oendl; |
3604 | #ifdef USEQPE | 3605 | #ifdef USEQPE |
3605 | QString configname; | 3606 | QString configname; |
3606 | Config::Domain dom; | 3607 | Config::Domain dom; |
@@ -3623,11 +3624,11 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) | |||
3623 | QFileInfo fi; | 3624 | QFileInfo fi; |
3624 | if (full) | 3625 | if (full) |
3625 | { | 3626 | { |
3626 | // qDebug("full:%s", (const char*)_txt); | 3627 | // odebug << "full:" << _txt << "" << oendl; |
3627 | QDir d = QDir::home(); // "/" | 3628 | QDir d = QDir::home(); // "/" |
3628 | if ( !d.cd(_txt) ) | 3629 | if ( !d.cd(_txt) ) |
3629 | { // "/tmp" | 3630 | { // "/tmp" |
3630 | qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); | 3631 | owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl; |
3631 | d = QDir::home(); | 3632 | d = QDir::home(); |
3632 | d.mkdir(_txt); | 3633 | d.mkdir(_txt); |
3633 | d.cd(_txt); | 3634 | d.cd(_txt); |
@@ -3639,14 +3640,14 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) | |||
3639 | QDir d = QDir::home(); // "/" | 3640 | QDir d = QDir::home(); // "/" |
3640 | if ( !d.cd(APPDIR) ) | 3641 | if ( !d.cd(APPDIR) ) |
3641 | { // "/tmp" | 3642 | { // "/tmp" |
3642 | qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); | 3643 | owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; |
3643 | d = QDir::home(); | 3644 | d = QDir::home(); |
3644 | d.mkdir(APPDIR); | 3645 | d.mkdir(APPDIR); |
3645 | d.cd(APPDIR); | 3646 | d.cd(APPDIR); |
3646 | } | 3647 | } |
3647 | if ( !d.cd("configs") ) | 3648 | if ( !d.cd("configs") ) |
3648 | { // "/tmp" | 3649 | { // "/tmp" |
3649 | qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); | 3650 | owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl; |
3650 | d = QDir::home(); | 3651 | d = QDir::home(); |
3651 | d.cd(APPDIR); | 3652 | d.cd(APPDIR); |
3652 | d.mkdir("configs"); | 3653 | d.mkdir("configs"); |
@@ -3654,7 +3655,7 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) | |||
3654 | } | 3655 | } |
3655 | fi.setFile(d, _txt); | 3656 | fi.setFile(d, _txt); |
3656 | } | 3657 | } |
3657 | //qDebug("Path:%s", (const char*)fi.absFilePath()); | 3658 | // odebug << "Path:" << fi.absFilePath() << "" << oendl; |
3658 | Config config(fi.absFilePath()); | 3659 | Config config(fi.absFilePath()); |
3659 | #endif | 3660 | #endif |
3660 | 3661 | ||
@@ -3934,7 +3935,7 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false) | |||
3934 | QDir d = QDir::home(); // "/" | 3935 | QDir d = QDir::home(); // "/" |
3935 | if ( !d.cd(_txt) ) | 3936 | if ( !d.cd(_txt) ) |
3936 | { // "/tmp" | 3937 | { // "/tmp" |
3937 | qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); | 3938 | owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl; |
3938 | d = QDir::home(); | 3939 | d = QDir::home(); |
3939 | d.mkdir(_txt); | 3940 | d.mkdir(_txt); |
3940 | d.cd(_txt); | 3941 | d.cd(_txt); |
@@ -3946,14 +3947,14 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false) | |||
3946 | QDir d = QDir::home(); // "/" | 3947 | QDir d = QDir::home(); // "/" |
3947 | if ( !d.cd(APPDIR) ) | 3948 | if ( !d.cd(APPDIR) ) |
3948 | { // "/tmp" | 3949 | { // "/tmp" |
3949 | qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); | 3950 | owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; |
3950 | d = QDir::home(); | 3951 | d = QDir::home(); |
3951 | d.mkdir(APPDIR); | 3952 | d.mkdir(APPDIR); |
3952 | d.cd(APPDIR); | 3953 | d.cd(APPDIR); |
3953 | } | 3954 | } |
3954 | if ( !d.cd("configs") ) | 3955 | if ( !d.cd("configs") ) |
3955 | { // "/tmp" | 3956 | { // "/tmp" |
3956 | qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); | 3957 | owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl; |
3957 | d = QDir::home(); | 3958 | d = QDir::home(); |
3958 | d.mkdir("configs"); | 3959 | d.mkdir("configs"); |
3959 | d.cd("configs"); | 3960 | d.cd("configs"); |
@@ -4061,13 +4062,13 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) | |||
4061 | 4062 | ||
4062 | QDir d = QDir::home(); // "/" | 4063 | QDir d = QDir::home(); // "/" |
4063 | if ( !d.cd(APPDIR) ) { // "/tmp" | 4064 | if ( !d.cd(APPDIR) ) { // "/tmp" |
4064 | qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); | 4065 | owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; |
4065 | d = QDir::home(); | 4066 | d = QDir::home(); |
4066 | d.mkdir(APPDIR); | 4067 | d.mkdir(APPDIR); |
4067 | d.cd(APPDIR); | 4068 | d.cd(APPDIR); |
4068 | } | 4069 | } |
4069 | if ( !d.cd(tgtdir) ) { // "/tmp" | 4070 | if ( !d.cd(tgtdir) ) { // "/tmp" |
4070 | qWarning( "Cannot find the \"~/" APPDIR "/%s\" directory", tgtdir ); | 4071 | owarn << "Cannot find the \"~/" APPDIR "/" << tgtdir << "\" directory" << oendl; |
4071 | d = QDir::home(); | 4072 | d = QDir::home(); |
4072 | d.mkdir(tgtdir); | 4073 | d.mkdir(tgtdir); |
4073 | d.cd(tgtdir); | 4074 | d.cd(tgtdir); |
@@ -4084,7 +4085,7 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) | |||
4084 | bkmkselector->insertItem(fi->fileName()); | 4085 | bkmkselector->insertItem(fi->fileName()); |
4085 | cnt++; | 4086 | cnt++; |
4086 | 4087 | ||
4087 | //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); | 4088 | //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl; |
4088 | ++it; // goto next list element | 4089 | ++it; // goto next list element |
4089 | } | 4090 | } |
4090 | 4091 | ||
@@ -4168,7 +4169,7 @@ void QTReaderApp::OnURLSelected(const QString& href) | |||
4168 | { | 4169 | { |
4169 | QClipboard* cb = QApplication::clipboard(); | 4170 | QClipboard* cb = QApplication::clipboard(); |
4170 | cb->setText(href); | 4171 | cb->setText(href); |
4171 | qDebug("<a href=\"%s\">%s</a>", (const char*)href, (const char*)href); | 4172 | odebug << "<a href=\"" << href << "\">" << href << "</a>" << oendl; |
4172 | } | 4173 | } |
4173 | if (m_url_localfile) | 4174 | if (m_url_localfile) |
4174 | { | 4175 | { |
@@ -4192,14 +4193,14 @@ void QTReaderApp::writeUrl(const QString& file, const QString& href) | |||
4192 | QDir d = QDir::home(); // "/" | 4193 | QDir d = QDir::home(); // "/" |
4193 | if ( !d.cd(APPDIR) ) | 4194 | if ( !d.cd(APPDIR) ) |
4194 | { // "/tmp" | 4195 | { // "/tmp" |
4195 | qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); | 4196 | owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; |
4196 | d = QDir::home(); | 4197 | d = QDir::home(); |
4197 | d.mkdir(APPDIR); | 4198 | d.mkdir(APPDIR); |
4198 | d.cd(APPDIR); | 4199 | d.cd(APPDIR); |
4199 | } | 4200 | } |
4200 | if ( !d.cd("urls") ) | 4201 | if ( !d.cd("urls") ) |
4201 | { // "/tmp" | 4202 | { // "/tmp" |
4202 | qWarning( "Cannot find the \"~/" APPDIR "/urls\" directory" ); | 4203 | owarn << "Cannot find the \"~/" APPDIR "/urls\" directory" << oendl; |
4203 | d = QDir::home(); | 4204 | d = QDir::home(); |
4204 | d.cd(APPDIR); | 4205 | d.cd(APPDIR); |
4205 | d.mkdir("urls"); | 4206 | d.mkdir("urls"); |
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 | |||
@@ -6,7 +6,7 @@ GraphicLink::~GraphicLink() { delete graphic; } | |||
6 | 6 | ||
7 | pmstore::~pmstore() | 7 | pmstore::~pmstore() |
8 | { | 8 | { |
9 | //// qDebug("Deleting image"); | 9 | //// odebug << "Deleting image" << oendl; |
10 | delete graphic; | 10 | delete graphic; |
11 | } | 11 | } |
12 | 12 | ||
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 | |||
@@ -132,7 +132,7 @@ fileBrowser::~fileBrowser() | |||
132 | void fileBrowser::populateList() | 132 | void fileBrowser::populateList() |
133 | { | 133 | { |
134 | ListView->clear(); | 134 | ListView->clear(); |
135 | ////qDebug(currentDir.canonicalPath()); | 135 | ////odebug << currentDir.canonicalPath() << oendl; |
136 | // currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::NoSymLinks ); | 136 | // currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::NoSymLinks ); |
137 | currentDir.setFilter( filterspec ); | 137 | currentDir.setFilter( filterspec ); |
138 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 138 | currentDir.setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
@@ -156,7 +156,7 @@ void fileBrowser::populateList() | |||
156 | } | 156 | } |
157 | else | 157 | else |
158 | { | 158 | { |
159 | //// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL); | 159 | //// odebug << "Not a dir: "+currentDir.canonicalPath()+fileL << oendl; |
160 | } | 160 | } |
161 | new QListViewItem( ListView,fileL,fileS ); | 161 | new QListViewItem( ListView,fileL,fileS ); |
162 | } | 162 | } |
@@ -169,7 +169,7 @@ void fileBrowser::populateList() | |||
169 | 169 | ||
170 | void fileBrowser::upDir() | 170 | void fileBrowser::upDir() |
171 | { | 171 | { |
172 | //// qDebug(currentDir.canonicalPath()); | 172 | //// odebug << currentDir.canonicalPath() << oendl; |
173 | } | 173 | } |
174 | 174 | ||
175 | void fileBrowser::listClicked(QListViewItem *selectedItem) | 175 | void fileBrowser::listClicked(QListViewItem *selectedItem) |
@@ -177,7 +177,7 @@ void fileBrowser::listClicked(QListViewItem *selectedItem) | |||
177 | if (selectedItem == NULL) return; | 177 | if (selectedItem == NULL) return; |
178 | QString strItem=selectedItem->text(0); | 178 | QString strItem=selectedItem->text(0); |
179 | 179 | ||
180 | //// qDebug("%s", (const char*)strItem); | 180 | //// odebug << "" << strItem << "" << oendl; |
181 | 181 | ||
182 | 182 | ||
183 | QString strSize=selectedItem->text(1); | 183 | QString strSize=selectedItem->text(1); |
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 | |||
@@ -85,7 +85,7 @@ TARGET = reader | |||
85 | 85 | ||
86 | INCLUDEPATH+= $(OPIEDIR)/include | 86 | INCLUDEPATH+= $(OPIEDIR)/include |
87 | DEPENDPATH+= $(OPIEDIR)/include | 87 | DEPENDPATH+= $(OPIEDIR)/include |
88 | LIBS += -lqpe | 88 | LIBS += -lqpe -lopiecore2 |
89 | 89 | ||
90 | include ( $(OPIEDIR)/include.pro ) | 90 | include ( $(OPIEDIR)/include.pro ) |
91 | 91 | ||
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 | |||
@@ -57,19 +57,19 @@ int CPlucker::bgetch() | |||
57 | { | 57 | { |
58 | if (!m_continuous) return EOF; | 58 | if (!m_continuous) return EOF; |
59 | if (bufferrec >= ntohs(head.recordList.numRecords) - 1) return EOF; | 59 | if (bufferrec >= ntohs(head.recordList.numRecords) - 1) return EOF; |
60 | ////qDebug("Passing through %u", currentpos); | 60 | ////odebug << "Passing through " << currentpos << "" << oendl; |
61 | if (!expand(bufferrec+1)) return EOF; | 61 | if (!expand(bufferrec+1)) return EOF; |
62 | mystyle.unset(); | 62 | mystyle.unset(); |
63 | if (m_ParaOffsets[m_nextParaIndex] == 0) | 63 | if (m_ParaOffsets[m_nextParaIndex] == 0) |
64 | { | 64 | { |
65 | while (m_ParaOffsets[m_nextParaIndex+1] == 0) | 65 | while (m_ParaOffsets[m_nextParaIndex+1] == 0) |
66 | { | 66 | { |
67 | // qDebug("Skipping extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); | 67 | // odebug << "Skipping extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; |
68 | m_nextParaIndex++; | 68 | m_nextParaIndex++; |
69 | } | 69 | } |
70 | } | 70 | } |
71 | mystyle.setExtraSpace((m_ParaAttrs[m_nextParaIndex]&7)*2); | 71 | mystyle.setExtraSpace((m_ParaAttrs[m_nextParaIndex]&7)*2); |
72 | //qDebug("Using extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); | 72 | //odebug << "Using extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; |
73 | ch = 10; | 73 | ch = 10; |
74 | EOPPhase = 4; | 74 | EOPPhase = 4; |
75 | } | 75 | } |
@@ -79,7 +79,7 @@ int CPlucker::bgetch() | |||
79 | { | 79 | { |
80 | UInt16 attr = m_ParaAttrs[m_nextParaIndex]; | 80 | UInt16 attr = m_ParaAttrs[m_nextParaIndex]; |
81 | m_nextParaIndex++; | 81 | m_nextParaIndex++; |
82 | // qDebug("Skipping extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); | 82 | // odebug << "Skipping extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; |
83 | if (m_nextParaIndex == m_nParas) | 83 | if (m_nextParaIndex == m_nParas) |
84 | { | 84 | { |
85 | m_nextPara = -1; | 85 | m_nextPara = -1; |
@@ -91,7 +91,7 @@ int CPlucker::bgetch() | |||
91 | } | 91 | } |
92 | mystyle.unset(); | 92 | mystyle.unset(); |
93 | mystyle.setExtraSpace((m_ParaAttrs[m_nextParaIndex]&7)*2); | 93 | mystyle.setExtraSpace((m_ParaAttrs[m_nextParaIndex]&7)*2); |
94 | //qDebug("Using extraspace:%d", m_ParaAttrs[m_nextParaIndex]&7); | 94 | //odebug << "Using extraspace:" << m_ParaAttrs[m_nextParaIndex]&7 << "" << oendl; |
95 | if (m_lastBreak == locate()) | 95 | if (m_lastBreak == locate()) |
96 | { | 96 | { |
97 | currentpos++; | 97 | currentpos++; |
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,24 +1,32 @@ | |||
1 | |||
2 | |||
1 | #include "useqpe.h" | 3 | #include "useqpe.h" |
2 | #include <stdio.h> | 4 | #include "plucker_base.h" |
3 | #include <string.h> | 5 | #include "Aportis.h" |
6 | #include "Palm2QImage.h" | ||
7 | |||
8 | /* OPIE */ | ||
9 | #include <opie2/odebug.h> | ||
4 | #ifdef USEQPE | 10 | #ifdef USEQPE |
5 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
6 | #endif /* USEQPE */ | ||
7 | #ifdef LOCALPICTURES | ||
8 | #include <qscrollview.h> | ||
9 | #endif | ||
10 | #ifdef USEQPE | ||
11 | #include <qpe/global.h> | 12 | #include <qpe/global.h> |
12 | #endif /* USEQPE */ | 13 | #endif /* USEQPE */ |
14 | |||
13 | #ifndef USEQPE | 15 | #ifndef USEQPE |
14 | #include <qapplication.h> | 16 | #include <qapplication.h> |
15 | #else /* USEQPE */ | 17 | #else /* USEQPE */ |
16 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
17 | #endif /* USEQPE */ | 19 | #endif /* USEQPE */ |
18 | 20 | ||
19 | #include "plucker_base.h" | 21 | /* QT */ |
20 | #include "Aportis.h" | 22 | #ifdef LOCALPICTURES |
21 | #include "Palm2QImage.h" | 23 | #include <qscrollview.h> |
24 | #endif | ||
25 | |||
26 | /* STD */ | ||
27 | #include <stdio.h> | ||
28 | #include <string.h> | ||
29 | |||
22 | 30 | ||
23 | CPlucker_base::CPlucker_base() : | 31 | CPlucker_base::CPlucker_base() : |
24 | #ifdef LOCALPICTURES | 32 | #ifdef LOCALPICTURES |
@@ -93,7 +101,7 @@ char* CPlucker_base::geturl(UInt16 tgt) | |||
93 | gotorecordnumber(0); | 101 | gotorecordnumber(0); |
94 | fread(&hdr0, 1, 6, fin); | 102 | fread(&hdr0, 1, 6, fin); |
95 | unsigned int nrecs = ntohs(hdr0.nRecords); | 103 | unsigned int nrecs = ntohs(hdr0.nRecords); |
96 | //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs); | 104 | //odebug << "Version " << ntohs(hdr0.version) << ", no. recs " << nrecs << "" << oendl; |
97 | UInt16 urlid = 0; | 105 | UInt16 urlid = 0; |
98 | bool urlsfound = false; | 106 | bool urlsfound = false; |
99 | char* urls = NULL; | 107 | char* urls = NULL; |
@@ -103,14 +111,14 @@ char* CPlucker_base::geturl(UInt16 tgt) | |||
103 | UInt16 id, name; | 111 | UInt16 id, name; |
104 | fread(&name, 1, sizeof(name), fin); | 112 | fread(&name, 1, sizeof(name), fin); |
105 | fread(&id, 1, sizeof(id), fin); | 113 | fread(&id, 1, sizeof(id), fin); |
106 | //qDebug("N:%d, I:%d", ntohs(name), ntohs(id)); | 114 | //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl; |
107 | if (ntohs(name) == 2) | 115 | if (ntohs(name) == 2) |
108 | { | 116 | { |
109 | urlsfound = true; | 117 | urlsfound = true; |
110 | urlid = id; | 118 | urlid = id; |
111 | //qDebug("Found url index:%d", ntohs(urlid)); | 119 | //odebug << "Found url index:" << ntohs(urlid) << "" << oendl; |
112 | } | 120 | } |
113 | ////qDebug("%x", id); | 121 | // //odebug << "" << id << "" << oendl; |
114 | } | 122 | } |
115 | if (urlsfound) | 123 | if (urlsfound) |
116 | { | 124 | { |
@@ -129,21 +137,21 @@ char* CPlucker_base::geturl(UInt16 tgt) | |||
129 | fread(&tctr, 1, sizeof(tctr), fin); | 137 | fread(&tctr, 1, sizeof(tctr), fin); |
130 | fread(&urlid, 1, sizeof(urlid), fin); | 138 | fread(&urlid, 1, sizeof(urlid), fin); |
131 | tctr = ntohs(tctr); | 139 | tctr = ntohs(tctr); |
132 | //qDebug("tgt:%u urlctr:%u tctr:%u", tgt, urlctr, tctr); | 140 | //odebug << "tgt:" << tgt << " urlctr:" << urlctr << " tctr:" << tctr << "" << oendl; |
133 | if (tctr >= tgt) | 141 | if (tctr >= tgt) |
134 | { | 142 | { |
135 | break; | 143 | break; |
136 | } | 144 | } |
137 | urlctr = tctr; | 145 | urlctr = tctr; |
138 | } | 146 | } |
139 | //qDebug("urls are in %d", ntohs(urlid)); | 147 | //odebug << "urls are in " << ntohs(urlid) << "" << oendl; |
140 | recptr = finduid(ntohs(urlid)); | 148 | recptr = finduid(ntohs(urlid)); |
141 | if (recptr != 0) | 149 | if (recptr != 0) |
142 | { | 150 | { |
143 | UInt32 reclen = recordlength(recptr) - HeaderSize(); | 151 | UInt32 reclen = recordlength(recptr) - HeaderSize(); |
144 | gotorecordnumber(recptr); | 152 | gotorecordnumber(recptr); |
145 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 153 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
146 | //qDebug("Found urls:%x",thishdr_type); | 154 | //odebug << "Found urls:" << thishdr_type << "" << oendl; |
147 | urlsize = thishdr_size; | 155 | urlsize = thishdr_size; |
148 | urls = new char[urlsize]; | 156 | urls = new char[urlsize]; |
149 | Expand(reclen, thishdr_type, (UInt8*)urls, urlsize); | 157 | Expand(reclen, thishdr_type, (UInt8*)urls, urlsize); |
@@ -153,7 +161,7 @@ char* CPlucker_base::geturl(UInt16 tgt) | |||
153 | { | 161 | { |
154 | if (rn == tgt) | 162 | if (rn == tgt) |
155 | { | 163 | { |
156 | //qDebug("URL:%s", ptr); | 164 | //odebug << "URL:" << ptr << "" << oendl; |
157 | int len = strlen(ptr)+1; | 165 | int len = strlen(ptr)+1; |
158 | pRet = new char[len]; | 166 | pRet = new char[len]; |
159 | memcpy(pRet, ptr, len); | 167 | memcpy(pRet, ptr, len); |
@@ -250,7 +258,7 @@ void CPlucker_base::locate(unsigned int n) | |||
250 | { | 258 | { |
251 | recptr--; | 259 | recptr--; |
252 | gotorecordnumber(recptr); | 260 | gotorecordnumber(recptr); |
253 | //qDebug("recptr:%u", recptr); | 261 | //odebug << "recptr:" << recptr << "" << oendl; |
254 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 262 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
255 | if (thishdr_type < 2) | 263 | if (thishdr_type < 2) |
256 | { | 264 | { |
@@ -275,7 +283,7 @@ void CPlucker_base::locate(unsigned int n) | |||
275 | } | 283 | } |
276 | } | 284 | } |
277 | } | 285 | } |
278 | // qDebug("Time(1): %u", clock()-start); | 286 | // odebug << "Time(1): " << clock()-start << "" << oendl; |
279 | /* | 287 | /* |
280 | expand(recptr); | 288 | expand(recptr); |
281 | mystyle.unset(); | 289 | mystyle.unset(); |
@@ -321,10 +329,10 @@ void CPlucker_base::locate(unsigned int n) | |||
321 | } | 329 | } |
322 | } while (locpos + bs <= n); | 330 | } while (locpos + bs <= n); |
323 | 331 | ||
324 | // qDebug("Time(2): %u", clock()-start); | 332 | // odebug << "Time(2): " << clock()-start << "" << oendl; |
325 | if (recptr != thisrec) | 333 | if (recptr != thisrec) |
326 | { | 334 | { |
327 | qDebug("Disaster:recptr:%u thisrec:%u", recptr, thisrec); | 335 | odebug << "Disaster:recptr:" << recptr << " thisrec:" << thisrec << "" << oendl; |
328 | UInt16 thishdr_uid, thishdr_nParagraphs; | 336 | UInt16 thishdr_uid, thishdr_nParagraphs; |
329 | UInt32 thishdr_size = buffercontent; | 337 | UInt32 thishdr_size = buffercontent; |
330 | UInt8 thishdr_type, thishdr_reserved; | 338 | UInt8 thishdr_type, thishdr_reserved; |
@@ -332,7 +340,7 @@ void CPlucker_base::locate(unsigned int n) | |||
332 | { | 340 | { |
333 | gotorecordnumber(recptr); | 341 | gotorecordnumber(recptr); |
334 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 342 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
335 | // 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); | 343 | // odebug << "UID:" << thishdr_uid << " Paras:" << thishdr_nParagraphs << " Size:" << thishdr_size << " Type:" << (unsigned int)thishdr_type << " Reserved:" << (unsigned int)thishdr_reserved << "" << oendl; |
336 | } | 344 | } |
337 | //QApplication::exit ( 100 ); | 345 | //QApplication::exit ( 100 ); |
338 | } | 346 | } |
@@ -371,16 +379,16 @@ bool CPlucker_base::expand(int thisrec) | |||
371 | while (1) | 379 | while (1) |
372 | { | 380 | { |
373 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 381 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
374 | //qDebug("This (%d) type is %d, uid is %u", thisrec, thishdr_type, thishdr_uid); | 382 | //odebug << "This (" << thisrec << ") type is " << thishdr_type << ", uid is " << thishdr_uid << "" << oendl; |
375 | if (thishdr_type < 2) break; | 383 | if (thishdr_type < 2) break; |
376 | //qDebug("Skipping paragraph of type %d", thishdr_type); | 384 | //odebug << "Skipping paragraph of type " << thishdr_type << "" << oendl; |
377 | if (++thisrec >= ntohs(head.recordList.numRecords) - 1) return false; | 385 | if (++thisrec >= ntohs(head.recordList.numRecords) - 1) return false; |
378 | reclen = recordlength(thisrec); | 386 | reclen = recordlength(thisrec); |
379 | gotorecordnumber(thisrec); | 387 | gotorecordnumber(thisrec); |
380 | } | 388 | } |
381 | m_nParas = thishdr_nParagraphs; | 389 | m_nParas = thishdr_nParagraphs; |
382 | m_bufferisreserved = (thishdr_reserved != 0); | 390 | m_bufferisreserved = (thishdr_reserved != 0); |
383 | //qDebug("It has %u paragraphs and is %u bytes", thishdr_nParagraphs, thishdr_size); | 391 | //odebug << "It has " << thishdr_nParagraphs << " paragraphs and is " << thishdr_size << " bytes" << oendl; |
384 | uid = thishdr_uid; | 392 | uid = thishdr_uid; |
385 | // gotorecordnumber(thisrec); | 393 | // gotorecordnumber(thisrec); |
386 | // fread(expandedtextbuffer,1,10,fin); | 394 | // fread(expandedtextbuffer,1,10,fin); |
@@ -391,12 +399,12 @@ bool CPlucker_base::expand(int thisrec) | |||
391 | fread(&attrs, 1, sizeof(attrs), fin); | 399 | fread(&attrs, 1, sizeof(attrs), fin); |
392 | m_ParaOffsets[i] = ntohs(ubytes); | 400 | m_ParaOffsets[i] = ntohs(ubytes); |
393 | m_ParaAttrs[i] = ntohs(attrs); | 401 | m_ParaAttrs[i] = ntohs(attrs); |
394 | ////qDebug("Bytes %u, Attr %x", ntohs(ubytes), ntohs(attrs)); | 402 | // //odebug << "Bytes " << ntohs(ubytes) << ", Attr " << ntohs(attrs) << "" << oendl; |
395 | } | 403 | } |
396 | if (m_nParas > 0) | 404 | if (m_nParas > 0) |
397 | { | 405 | { |
398 | m_nextPara = m_ParaOffsets[0]; | 406 | m_nextPara = m_ParaOffsets[0]; |
399 | //qDebug("First offset = %u", m_nextPara); | 407 | //odebug << "First offset = " << m_nextPara << "" << oendl; |
400 | m_nextParaIndex = 0; | 408 | m_nextParaIndex = 0; |
401 | } | 409 | } |
402 | else | 410 | else |
@@ -418,7 +426,7 @@ bool CPlucker_base::expand(int thisrec) | |||
418 | Expand(reclen, thishdr_type, expandedtextbuffer, buffercontent); | 426 | Expand(reclen, thishdr_type, expandedtextbuffer, buffercontent); |
419 | bufferpos = 0; | 427 | bufferpos = 0; |
420 | bufferrec = thisrec; | 428 | bufferrec = thisrec; |
421 | //qDebug("BC:%u, HS:%u", buffercontent, thishdr_size); | 429 | //odebug << "BC:" << buffercontent << ", HS:" << thishdr_size << "" << oendl; |
422 | return true; | 430 | return true; |
423 | } | 431 | } |
424 | 432 | ||
@@ -452,7 +460,7 @@ void CPlucker_base::UnZip(UInt8* compressedbuffer, size_t reclen, UInt8* tgtbuff | |||
452 | 460 | ||
453 | err = inflate( &zstream, Z_SYNC_FLUSH ); | 461 | err = inflate( &zstream, Z_SYNC_FLUSH ); |
454 | 462 | ||
455 | ////qDebug("err:%d - %u", err, zstream.avail_in); | 463 | // //odebug << "err:" << err << " - " << zstream.avail_in << "" << oendl; |
456 | 464 | ||
457 | } while ( err == Z_OK ); | 465 | } while ( err == Z_OK ); |
458 | 466 | ||
@@ -534,9 +542,9 @@ CList<Bkmk>* CPlucker_base::getbkmklist() | |||
534 | UInt16 n; | 542 | UInt16 n; |
535 | fread(&n, 1, sizeof(n), fin); | 543 | fread(&n, 1, sizeof(n), fin); |
536 | n = ntohs(n); | 544 | n = ntohs(n); |
537 | //qDebug("Found %u bookmarks", n); | 545 | //odebug << "Found " << n << " bookmarks" << oendl; |
538 | } | 546 | } |
539 | //qDebug("Found:%d, %u", i , thishdr_type); | 547 | //odebug << "Found:" << i << ", " << thishdr_type << "" << oendl; |
540 | } | 548 | } |
541 | */ | 549 | */ |
542 | return NULL; | 550 | return NULL; |
@@ -592,7 +600,7 @@ QImage* CPlucker_base::getPicture(unsigned long tgt) | |||
592 | #include <qpe/global.h> | 600 | #include <qpe/global.h> |
593 | void CPlucker_base::showimg(UInt16 tgt) | 601 | void CPlucker_base::showimg(UInt16 tgt) |
594 | { | 602 | { |
595 | //qDebug("Crassssssh!"); | 603 | //odebug << "Crassssssh!" << oendl; |
596 | QPixmap* qimage = expandimg(tgt); | 604 | QPixmap* qimage = expandimg(tgt); |
597 | m_picture->setFixedSize(qimage->size()); | 605 | m_picture->setFixedSize(qimage->size()); |
598 | m_picture->setBackgroundPixmap(*qimage); | 606 | m_picture->setBackgroundPixmap(*qimage); |
@@ -603,14 +611,14 @@ void CPlucker_base::showimg(UInt16 tgt) | |||
603 | char tmp[] = "uqtreader.XXXXXX"; | 611 | char tmp[] = "uqtreader.XXXXXX"; |
604 | QImage* qimage = getimg(tgt); | 612 | QImage* qimage = getimg(tgt); |
605 | QPixmap* image = new QPixmap(0,0); | 613 | QPixmap* image = new QPixmap(0,0); |
606 | // //qDebug("New image"); | 614 | // //odebug << "New image" << oendl; |
607 | image->convertFromImage(*qimage); | 615 | image->convertFromImage(*qimage); |
608 | delete qimage; | 616 | delete qimage; |
609 | char tmpfile[sizeof(tmp)+1]; | 617 | char tmpfile[sizeof(tmp)+1]; |
610 | strcpy(tmpfile,tmp); | 618 | strcpy(tmpfile,tmp); |
611 | int f = mkstemp(tmpfile); | 619 | int f = mkstemp(tmpfile); |
612 | close(f); | 620 | close(f); |
613 | //qDebug("TMPFILE:%s", tmpfile); | 621 | //odebug << "TMPFILE:" << tmpfile << "" << oendl; |
614 | if (image->save(tmpfile,"PNG")) | 622 | if (image->save(tmpfile,"PNG")) |
615 | { | 623 | { |
616 | QCopEnvelope e("QPE/Application/showimg", "setDocument(QString)"); | 624 | QCopEnvelope e("QPE/Application/showimg", "setDocument(QString)"); |
@@ -627,7 +635,7 @@ void CPlucker_base::showimg(UInt16 tgt) | |||
627 | 635 | ||
628 | unsigned short CPlucker_base::finduid(unsigned short urlid) | 636 | unsigned short CPlucker_base::finduid(unsigned short urlid) |
629 | { | 637 | { |
630 | // //qDebug("Finding %u", urlid); | 638 | // //odebug << "Finding " << urlid << "" << oendl; |
631 | unsigned short jmin = 1, jmax = ntohs(head.recordList.numRecords); | 639 | unsigned short jmin = 1, jmax = ntohs(head.recordList.numRecords); |
632 | unsigned short jmid = (jmin+jmax) >> 1; | 640 | unsigned short jmid = (jmin+jmax) >> 1; |
633 | while (jmax - jmin > 1) | 641 | while (jmax - jmin > 1) |
@@ -638,7 +646,7 @@ unsigned short CPlucker_base::finduid(unsigned short urlid) | |||
638 | UInt8 thishdr_type, thishdr_reserved; | 646 | UInt8 thishdr_type, thishdr_reserved; |
639 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 647 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
640 | unsigned short luid = thishdr_uid; | 648 | unsigned short luid = thishdr_uid; |
641 | ////qDebug("%u %u %u : %u", jmin, jmid, jmax, urlid); | 649 | // //odebug << "" << jmin << " " << jmid << " " << jmax << " : " << urlid << "" << oendl; |
642 | if (luid == urlid) | 650 | if (luid == urlid) |
643 | { | 651 | { |
644 | return jmid; | 652 | return jmid; |
@@ -659,7 +667,7 @@ unsigned short CPlucker_base::finduid(unsigned short urlid) | |||
659 | UInt8 thishdr_type, thishdr_reserved; | 667 | UInt8 thishdr_type, thishdr_reserved; |
660 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 668 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
661 | unsigned short luid = thishdr_uid; | 669 | unsigned short luid = thishdr_uid; |
662 | //qDebug("jmin at end:%u,%u", jmin, luid); | 670 | //odebug << "jmin at end:" << jmin << "," << luid << "" << oendl; |
663 | if (luid == urlid) | 671 | if (luid == urlid) |
664 | { | 672 | { |
665 | return jmin; | 673 | return jmin; |
@@ -667,12 +675,12 @@ unsigned short CPlucker_base::finduid(unsigned short urlid) | |||
667 | gotorecordnumber(jmax); | 675 | gotorecordnumber(jmax); |
668 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 676 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
669 | luid = thishdr_uid; | 677 | luid = thishdr_uid; |
670 | //qDebug("jmax at end:%u,%u", jmax, luid); | 678 | //odebug << "jmax at end:" << jmax << "," << luid << "" << oendl; |
671 | if (luid == urlid) | 679 | if (luid == urlid) |
672 | { | 680 | { |
673 | return jmax; | 681 | return jmax; |
674 | } | 682 | } |
675 | //qDebug("Couldn't find %u", urlid); | 683 | //odebug << "Couldn't find " << urlid << "" << oendl; |
676 | return 0; // Not found! | 684 | return 0; // Not found! |
677 | } | 685 | } |
678 | 686 | ||
@@ -698,7 +706,7 @@ void CPlucker_base::setSaveData(unsigned char*& data, unsigned short& len, unsig | |||
698 | #endif | 706 | #endif |
699 | { | 707 | { |
700 | unsigned long t = *it; | 708 | unsigned long t = *it; |
701 | //qDebug("[%u]", t); | 709 | // odebug << "[" << t << "]" << oendl; |
702 | memcpy(newdata, &t, sizeof(t)); | 710 | memcpy(newdata, &t, sizeof(t)); |
703 | newdata += sizeof(t); | 711 | newdata += sizeof(t); |
704 | } | 712 | } |
@@ -721,7 +729,7 @@ void CPlucker_base::putSaveData(unsigned char*& src, unsigned short& srclen) | |||
721 | if (srclen >= sizeof(t)) | 729 | if (srclen >= sizeof(t)) |
722 | { | 730 | { |
723 | memcpy(&t, src, sizeof(t)); | 731 | memcpy(&t, src, sizeof(t)); |
724 | // qDebug("[%u]", t); | 732 | // odebug << "[" << t << "]" << oendl; |
725 | visited.push_front(t); | 733 | visited.push_front(t); |
726 | src += sizeof(t); | 734 | src += sizeof(t); |
727 | srclen -= sizeof(t); | 735 | srclen -= sizeof(t); |
@@ -751,17 +759,17 @@ int CPlucker_base::OpenFile(const char *src) | |||
751 | compressedtextbuffer = new UInt8[compressedbuffersize]; | 759 | compressedtextbuffer = new UInt8[compressedbuffersize]; |
752 | expandedtextbuffer = new UInt8[buffersize]; | 760 | expandedtextbuffer = new UInt8[buffersize]; |
753 | 761 | ||
754 | //qDebug("Total number of records:%u", ntohs(head.recordList.numRecords)); | 762 | //odebug << "Total number of records:" << ntohs(head.recordList.numRecords) << "" << oendl; |
755 | 763 | ||
756 | unsigned int nrecs = ntohs(hdr0.nRecords); | 764 | unsigned int nrecs = ntohs(hdr0.nRecords); |
757 | //qDebug("Version %u, no. recs %u", ntohs(hdr0.version), nrecs); | 765 | //odebug << "Version " << ntohs(hdr0.version) << ", no. recs " << nrecs << "" << oendl; |
758 | UInt16 homerecid = 1; | 766 | UInt16 homerecid = 1; |
759 | for (unsigned int i = 0; i < nrecs; i++) | 767 | for (unsigned int i = 0; i < nrecs; i++) |
760 | { | 768 | { |
761 | UInt16 id, name; | 769 | UInt16 id, name; |
762 | fread(&name, 1, sizeof(name), fin); | 770 | fread(&name, 1, sizeof(name), fin); |
763 | fread(&id, 1, sizeof(id), fin); | 771 | fread(&id, 1, sizeof(id), fin); |
764 | //qDebug("N:%d, I:%d", ntohs(name), ntohs(id)); | 772 | //odebug << "N:" << ntohs(name) << ", I:" << ntohs(id) << "" << oendl; |
765 | if (ntohs(name) == 0) homerecid = ntohs(id); | 773 | if (ntohs(name) == 0) homerecid = ntohs(id); |
766 | } | 774 | } |
767 | 775 | ||
@@ -819,7 +827,7 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) | |||
819 | visited.push_front(n); | 827 | visited.push_front(n); |
820 | UInt16 tuid = (n >> 16); | 828 | UInt16 tuid = (n >> 16); |
821 | n &= 0xffff; | 829 | n &= 0xffff; |
822 | // //qDebug("Hyper:<%u,%u>", tuid, n); | 830 | // //odebug << "Hyper:<" << tuid << "," << n << ">" << oendl; |
823 | UInt16 thisrec = 1; | 831 | UInt16 thisrec = 1; |
824 | currentpos = 0; | 832 | currentpos = 0; |
825 | gotorecordnumber(thisrec); | 833 | gotorecordnumber(thisrec); |
@@ -831,7 +839,7 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) | |||
831 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); | 839 | GetHeader(thishdr_uid, thishdr_nParagraphs, thishdr_size, thishdr_type, thishdr_reserved); |
832 | if (tuid == thishdr_uid) break; | 840 | if (tuid == thishdr_uid) break; |
833 | if (thishdr_type < 2) currentpos += thishdr_size; | 841 | if (thishdr_type < 2) currentpos += thishdr_size; |
834 | ////qDebug("hyper-cp:%u", currentpos); | 842 | // //odebug << "hyper-cp:" << currentpos << "" << oendl; |
835 | thisrec++; | 843 | thisrec++; |
836 | if (thisrec >= ntohs(head.recordList.numRecords)) | 844 | if (thisrec >= ntohs(head.recordList.numRecords)) |
837 | { | 845 | { |
@@ -857,7 +865,7 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) | |||
857 | } | 865 | } |
858 | #else | 866 | #else |
859 | #endif /* USEQPE */ | 867 | #endif /* USEQPE */ |
860 | //qDebug("Link:%s", (const char*)wrd); | 868 | //odebug << "Link:" << wrd << "" << oendl; |
861 | // setlink(fn, wrd); | 869 | // setlink(fn, wrd); |
862 | delete [] turl; | 870 | delete [] turl; |
863 | } | 871 | } |
@@ -926,7 +934,7 @@ linkType CPlucker_base::hyperlink(unsigned int n, QString& wrd) | |||
926 | ); | 934 | ); |
927 | return eNone; | 935 | return eNone; |
928 | } | 936 | } |
929 | //qDebug("Hyper:<%u,%u>", tuid, n); | 937 | //odebug << "Hyper:<" << tuid << "," << n << ">" << oendl; |
930 | while (bufferpos < n && bufferpos < buffercontent) getch_base(true); | 938 | while (bufferpos < n && bufferpos < buffercontent) getch_base(true); |
931 | /* // This is faster but the alignment doesn't get set | 939 | /* // This is faster but the alignment doesn't get set |
932 | mystyle.unset(); | 940 | mystyle.unset(); |
@@ -956,11 +964,11 @@ tchar CPlucker_base::getch_base(bool fast) | |||
956 | while (ch == 0) | 964 | while (ch == 0) |
957 | { | 965 | { |
958 | ch = bgetch(); | 966 | ch = bgetch(); |
959 | ////qDebug("Function:%x", ch); | 967 | // //odebug << "Function:" << ch << "" << oendl; |
960 | switch (ch) | 968 | switch (ch) |
961 | { | 969 | { |
962 | case 0x38: | 970 | case 0x38: |
963 | // //qDebug("Break:%u", locate()); | 971 | // //odebug << "Break:" << locate() << "" << oendl; |
964 | if (m_lastBreak == locate()) | 972 | if (m_lastBreak == locate()) |
965 | { | 973 | { |
966 | ch = bgetch(); | 974 | ch = bgetch(); |
@@ -980,7 +988,7 @@ tchar CPlucker_base::getch_base(bool fast) | |||
980 | { | 988 | { |
981 | int ch = bgetch(); | 989 | int ch = bgetch(); |
982 | ln = (ln << 8) + ch; | 990 | ln = (ln << 8) + ch; |
983 | // //qDebug("ch:%d, ln:%u", ch, ln); | 991 | // //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl; |
984 | } | 992 | } |
985 | if (skip == 2) | 993 | if (skip == 2) |
986 | { | 994 | { |
@@ -992,10 +1000,10 @@ tchar CPlucker_base::getch_base(bool fast) | |||
992 | { | 1000 | { |
993 | int ch = bgetch(); | 1001 | int ch = bgetch(); |
994 | ln = (ln << 8) + ch; | 1002 | ln = (ln << 8) + ch; |
995 | // //qDebug("ch:%d, ln:%u", ch, ln); | 1003 | // //odebug << "ch:" << ch << ", ln:" << ln << "" << oendl; |
996 | } | 1004 | } |
997 | } | 1005 | } |
998 | // //qDebug("ln:%u", ln); | 1006 | // //odebug << "ln:" << ln << "" << oendl; |
999 | mystyle.setLink(true); | 1007 | mystyle.setLink(true); |
1000 | mystyle.setData(ln); | 1008 | mystyle.setData(ln); |
1001 | // mystyle.setColour(255, 0, 0); | 1009 | // mystyle.setColour(255, 0, 0); |
@@ -1038,7 +1046,7 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1038 | case 0x11: | 1046 | case 0x11: |
1039 | { | 1047 | { |
1040 | ch = bgetch(); | 1048 | ch = bgetch(); |
1041 | // //qDebug("Font:%d",ch); | 1049 | // //odebug << "Font:" << ch << "" << oendl; |
1042 | mystyle.setVOffset(0); | 1050 | mystyle.setVOffset(0); |
1043 | mystyle.unsetMono(); | 1051 | mystyle.unsetMono(); |
1044 | mystyle.unsetBold(); | 1052 | mystyle.unsetBold(); |
@@ -1072,7 +1080,7 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1072 | mystyle.setBold(); | 1080 | mystyle.setBold(); |
1073 | break; | 1081 | break; |
1074 | case 8: // should be fixed width | 1082 | case 8: // should be fixed width |
1075 | //qDebug("Trying fixed width"); | 1083 | //odebug << "Trying fixed width" << oendl; |
1076 | mystyle.setMono(); | 1084 | mystyle.setMono(); |
1077 | break; | 1085 | break; |
1078 | case 9: | 1086 | case 9: |
@@ -1087,7 +1095,7 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1087 | mystyle.setVOffset(-1); | 1095 | mystyle.setVOffset(-1); |
1088 | break; | 1096 | break; |
1089 | default: | 1097 | default: |
1090 | qDebug("Unrecognised font"); | 1098 | odebug << "Unrecognised font" << oendl; |
1091 | break; | 1099 | break; |
1092 | } | 1100 | } |
1093 | ch = bgetch(); | 1101 | ch = bgetch(); |
@@ -1099,19 +1107,19 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1099 | { | 1107 | { |
1100 | case 0: | 1108 | case 0: |
1101 | mystyle.setLeftJustify(); | 1109 | mystyle.setLeftJustify(); |
1102 | // //qDebug("left"); | 1110 | // //odebug << "left" << oendl; |
1103 | break; | 1111 | break; |
1104 | case 1: | 1112 | case 1: |
1105 | mystyle.setRightJustify(); | 1113 | mystyle.setRightJustify(); |
1106 | // //qDebug("right"); | 1114 | // //odebug << "right" << oendl; |
1107 | break; | 1115 | break; |
1108 | case 2: | 1116 | case 2: |
1109 | mystyle.setCentreJustify(); | 1117 | mystyle.setCentreJustify(); |
1110 | // //qDebug("centre"); | 1118 | // //odebug << "centre" << oendl; |
1111 | break; | 1119 | break; |
1112 | case 3: | 1120 | case 3: |
1113 | mystyle.setFullJustify(); | 1121 | mystyle.setFullJustify(); |
1114 | // //qDebug("full"); | 1122 | // //odebug << "full" << oendl; |
1115 | break; | 1123 | break; |
1116 | 1124 | ||
1117 | } | 1125 | } |
@@ -1134,7 +1142,7 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1134 | ir = (ir << 8) + bgetch(); | 1142 | ir = (ir << 8) + bgetch(); |
1135 | if (hasalternate) | 1143 | if (hasalternate) |
1136 | { | 1144 | { |
1137 | //qDebug("Alternate image:%x", ir); | 1145 | //odebug << "Alternate image:" << ir << "" << oendl; |
1138 | UInt16 ir2 = bgetch(); | 1146 | UInt16 ir2 = bgetch(); |
1139 | ir2 = (ir2 << 8) + bgetch(); | 1147 | ir2 = (ir2 << 8) + bgetch(); |
1140 | if (!fast) mystyle.setPicture(true, expandimg(ir2, true), true, ir << 16); | 1148 | if (!fast) mystyle.setPicture(true, expandimg(ir2, true), true, ir << 16); |
@@ -1149,7 +1157,7 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1149 | { | 1157 | { |
1150 | if (!fast) mystyle.setPicture(true, expandimg(ir)); | 1158 | if (!fast) mystyle.setPicture(true, expandimg(ir)); |
1151 | } | 1159 | } |
1152 | // if (mystyle.getLink()) qDebug("Picture link!"); | 1160 | // if (mystyle.getLink()) odebug << "Picture link!" << oendl; |
1153 | ch = '#'; | 1161 | ch = '#'; |
1154 | } | 1162 | } |
1155 | // ch = bgetch(); | 1163 | // ch = bgetch(); |
@@ -1160,14 +1168,14 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1160 | UInt8 wc = bgetch(); | 1168 | UInt8 wc = bgetch(); |
1161 | UInt8 pc = bgetch(); | 1169 | UInt8 pc = bgetch(); |
1162 | UInt16 w = wc; | 1170 | UInt16 w = wc; |
1163 | // //qDebug("h,w,pc [%u, %u, %u]", h, w, pc); | 1171 | // //odebug << "h,w,pc [" << h << ", " << w << ", " << pc << "]" << oendl; |
1164 | if (w == 0) | 1172 | if (w == 0) |
1165 | { | 1173 | { |
1166 | w = (m_scrWidth*(unsigned long)pc)/100; | 1174 | w = (m_scrWidth*(unsigned long)pc)/100; |
1167 | } | 1175 | } |
1168 | if (w == 0) w = m_scrWidth; | 1176 | if (w == 0) w = m_scrWidth; |
1169 | mystyle.setPicture(false, hRule(w,h,mystyle.Red(),mystyle.Green(),mystyle.Blue())); | 1177 | mystyle.setPicture(false, hRule(w,h,mystyle.Red(),mystyle.Green(),mystyle.Blue())); |
1170 | // if (mystyle.getLink()) //qDebug("hRule link!"); | 1178 | // if (mystyle.getLink()) //odebug << "hRule link!" << oendl; |
1171 | ch = '#'; | 1179 | ch = '#'; |
1172 | } | 1180 | } |
1173 | break; | 1181 | break; |
@@ -1182,10 +1190,10 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1182 | case 0x22: | 1190 | case 0x22: |
1183 | ch = bgetch(); | 1191 | ch = bgetch(); |
1184 | mystyle.setLeftMargin(ch); | 1192 | mystyle.setLeftMargin(ch); |
1185 | // //qDebug("Left margin:%d", ch); | 1193 | // //odebug << "Left margin:" << ch << "" << oendl; |
1186 | ch = bgetch(); | 1194 | ch = bgetch(); |
1187 | mystyle.setRightMargin(ch); | 1195 | mystyle.setRightMargin(ch); |
1188 | // //qDebug("Right margin:%d", ch); | 1196 | // //odebug << "Right margin:" << ch << "" << oendl; |
1189 | ch = bgetch(); | 1197 | ch = bgetch(); |
1190 | break; | 1198 | break; |
1191 | case 0x70: | 1199 | case 0x70: |
@@ -1203,18 +1211,18 @@ tchar CPlucker_base::getch_base(bool fast) | |||
1203 | ch <<= 8; | 1211 | ch <<= 8; |
1204 | ch |= (tchar)bgetch(); | 1212 | ch |= (tchar)bgetch(); |
1205 | for (int i = 0; i < tlen; i++) bgetch(); | 1213 | for (int i = 0; i < tlen; i++) bgetch(); |
1206 | //qDebug("Function 83"); | 1214 | //odebug << "Function 83" << oendl; |
1207 | } | 1215 | } |
1208 | break; | 1216 | break; |
1209 | case 0x85: | 1217 | case 0x85: |
1210 | default: | 1218 | default: |
1211 | qDebug("Function:%x NOT IMPLEMENTED", ch); | 1219 | odebug << "Function:" << ch << " NOT IMPLEMENTED" << oendl; |
1212 | { | 1220 | { |
1213 | int skip = ch & 7; | 1221 | int skip = ch & 7; |
1214 | for (int i = 0; i < skip; i++) | 1222 | for (int i = 0; i < skip; i++) |
1215 | { | 1223 | { |
1216 | ch = bgetch(); | 1224 | ch = bgetch(); |
1217 | //qDebug("Arg %d, %d", i, ch); | 1225 | //odebug << "Arg " << i << ", " << ch << "" << oendl; |
1218 | } | 1226 | } |
1219 | ch = bgetch(); | 1227 | ch = bgetch(); |
1220 | } | 1228 | } |