Diffstat (limited to 'noncore/apps/opie-reader/QTReader.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReader.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
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 | ||