summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReader.cpp766
-rw-r--r--noncore/apps/opie-reader/opie-reader.control4
2 files changed, 385 insertions, 385 deletions
diff --git a/noncore/apps/opie-reader/QTReader.cpp b/noncore/apps/opie-reader/QTReader.cpp
index 6251812..fc9cffb 100644
--- a/noncore/apps/opie-reader/QTReader.cpp
+++ b/noncore/apps/opie-reader/QTReader.cpp
@@ -81,44 +81,44 @@ void QTReader::mouseReleaseEvent( QMouseEvent* _e )
{
-// printf("(%u, %u)\n", _e->x(), _e->y());
- QString wrd = QString::null;
- int lineno = _e->y()/m_linespacing;
- if (m_bMonoSpaced)
- {
- int chno = _e->x()/m_charWidth;
- if (chno < ustrlen(textarray[lineno]->data()))
- {
- wrd[0] = textarray[lineno]->data()[chno];
- }
- }
- else
- {
- CBuffer* t = textarray[lineno];
- int first = 0;
- while (1)
- {
- int i = first+1;
-// while ((*t)[i] != ' ' && (*t)[i] != 0) i++;
- while (QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
- if (m_fm->width(toQString(t->data()), i) > _e->x())
- {
- wrd = toQString(t->data()+first, i - first);
- break;
- }
-// while ((*t)[i] == ' ' && (*t)[i] != 0) i++;
- while (!QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
- if ((*t)[i] == 0) break;
- first = i;
- }
- }
- if (!wrd.isEmpty())
- {
- QClipboard* cb = QApplication::clipboard();
- cb->setText(wrd);
- Global::statusMessage(wrd);
- if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty())
- {
- QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8());
- e << wrd;
- }
- }
+// printf("(%u, %u)\n", _e->x(), _e->y());
+ QString wrd = QString::null;
+ int lineno = _e->y()/m_linespacing;
+ if (m_bMonoSpaced)
+ {
+ int chno = _e->x()/m_charWidth;
+ if (chno < ustrlen(textarray[lineno]->data()))
+ {
+ wrd[0] = textarray[lineno]->data()[chno];
+ }
+ }
+ else
+ {
+ CBuffer* t = textarray[lineno];
+ int first = 0;
+ while (1)
+ {
+ int i = first+1;
+// while ((*t)[i] != ' ' && (*t)[i] != 0) i++;
+ while (QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
+ if (m_fm->width(toQString(t->data()), i) > _e->x())
+ {
+ wrd = toQString(t->data()+first, i - first);
+ break;
+ }
+// while ((*t)[i] == ' ' && (*t)[i] != 0) i++;
+ while (!QChar((*t)[i]).isLetter() && (*t)[i] != 0) i++;
+ if ((*t)[i] == 0) break;
+ first = i;
+ }
+ }
+ if (!wrd.isEmpty())
+ {
+ QClipboard* cb = QApplication::clipboard();
+ cb->setText(wrd);
+ Global::statusMessage(wrd);
+ if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty())
+ {
+ QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8());
+ e << wrd;
+ }
+ }
}
@@ -136,4 +136,4 @@ void QTReader::focusOutEvent(QFocusEvent* e)
{
- timer->stop();
- m_scrolldy = 0;
+ timer->stop();
+ m_scrolldy = 0;
}
@@ -149,3 +149,3 @@ void QTReader::goDown()
{
- dopagedn();
+ dopagedn();
}
@@ -153,3 +153,3 @@ void QTReader::goDown()
{
- lineDown();
+ lineDown();
}
@@ -161,3 +161,3 @@ void QTReader::goUp()
{
- dopageup();
+ dopageup();
}
@@ -165,3 +165,3 @@ void QTReader::goUp()
{
- lineUp();
+ lineUp();
}
@@ -174,42 +174,42 @@ void QTReader::keyPressEvent(QKeyEvent* e)
case Key_Down:
- {
- e->accept();
- if (m_autoScroll)
- {
- if (m_delay < 59049)
- {
- m_delay = (3*m_delay)/2;
- timer->changeInterval(real_delay());
- }
- else
- {
- m_delay = 59049;
- }
- }
- else
- {
- goDown();
- }
- }
+ {
+ e->accept();
+ if (m_autoScroll)
+ {
+ if (m_delay < 59049)
+ {
+ m_delay = (3*m_delay)/2;
+ timer->changeInterval(real_delay());
+ }
+ else
+ {
+ m_delay = 59049;
+ }
+ }
+ else
+ {
+ goDown();
+ }
+ }
break;
case Key_Up:
- {
- e->accept();
- if (m_autoScroll)
- {
- if (m_delay > 1024)
- {
- m_delay = (2*m_delay)/3;
- timer->changeInterval(real_delay());
- }
- else
- {
- m_delay = 1024;
- }
- }
- else
- {
- goUp();
- }
- }
+ {
+ e->accept();
+ if (m_autoScroll)
+ {
+ if (m_delay > 1024)
+ {
+ m_delay = (2*m_delay)/3;
+ timer->changeInterval(real_delay());
+ }
+ else
+ {
+ m_delay = 1024;
+ }
+ }
+ else
+ {
+ goUp();
+ }
+ }
break;
@@ -217,27 +217,27 @@ void QTReader::keyPressEvent(QKeyEvent* e)
case Key_Left:
- {
- e->accept();
- if (m_textfont > 0)
- {
- m_textfont--;
- setfont(NULL);
- locate(pagelocate());
- update();
- }
- }
+ {
+ e->accept();
+ if (m_textfont > 0)
+ {
+ m_textfont--;
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ }
+ }
break;
case Key_Right:
- {
- e->accept();
- if (fonts[++m_textfont] == 0)
- {
- m_textfont--;
- }
- else
- {
- setfont(NULL);
- locate(pagelocate());
- update();
- }
- }
+ {
+ e->accept();
+ if (fonts[++m_textfont] == 0)
+ {
+ m_textfont--;
+ }
+ else
+ {
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ }
+ }
break;
@@ -245,45 +245,45 @@ void QTReader::keyPressEvent(QKeyEvent* e)
case Key_Right:
- {
- e->accept();
- if (fontsizes[++m_textsize] == 0)
- {
- m_textsize--;
- }
- else
- {
- bool sc = m_autoScroll;
- m_autoScroll = false;
- setfont(NULL);
- locate(pagelocate());
- update();
- m_autoScroll = sc;
- if (m_autoScroll) autoscroll();
- }
- }
+ {
+ e->accept();
+ if (fontsizes[++m_textsize] == 0)
+ {
+ m_textsize--;
+ }
+ else
+ {
+ bool sc = m_autoScroll;
+ m_autoScroll = false;
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ m_autoScroll = sc;
+ if (m_autoScroll) autoscroll();
+ }
+ }
break;
case Key_Left:
- {
- e->accept();
- if (m_textsize > 0)
- {
- bool sc = m_autoScroll;
- m_autoScroll = false;
- m_textsize--;
- setfont(NULL);
- locate(pagelocate());
- update();
- m_autoScroll = sc;
- if (m_autoScroll) autoscroll();
- }
- }
+ {
+ e->accept();
+ if (m_textsize > 0)
+ {
+ bool sc = m_autoScroll;
+ m_autoScroll = false;
+ m_textsize--;
+ setfont(NULL);
+ locate(pagelocate());
+ update();
+ m_autoScroll = sc;
+ if (m_autoScroll) autoscroll();
+ }
+ }
break;
- case Key_Space:
-// case Key_Enter:
- case Key_Return:
- {
- e->accept();
- setautoscroll(!m_autoScroll);
- ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
- }
- break;
+ case Key_Space:
+// case Key_Enter:
+ case Key_Return:
+ {
+ e->accept();
+ setautoscroll(!m_autoScroll);
+ ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
+ }
+ break;
default:
@@ -298,3 +298,3 @@ void QTReader::setautoscroll(bool _sc)
{
- m_autoScroll = false;
+ m_autoScroll = false;
}
@@ -302,4 +302,4 @@ void QTReader::setautoscroll(bool _sc)
{
- m_autoScroll = true;
- autoscroll();
+ m_autoScroll = true;
+ autoscroll();
}
@@ -311,3 +311,3 @@ bool QTReader::getline(CBuffer *buff)
{
- return buffdoc.getline(buff ,width(), m_charWidth);
+ return buffdoc.getline(buff ,width(), m_charWidth);
}
@@ -315,3 +315,3 @@ bool QTReader::getline(CBuffer *buff)
{
- return buffdoc.getline(buff, width());
+ return buffdoc.getline(buff, width());
}
@@ -323,4 +323,4 @@ void QTReader::doscroll()
{
- timer->stop();
- return;
+ timer->stop();
+ return;
}
@@ -334,26 +334,26 @@ void QTReader::doscroll()
{
- setfont(&p);
- m_scrolldy = 0;
-// qDrawPlainRect(&p,0,height() - m_linespacing,width(),m_linespacing,white,1,&b);
- pagepos = locnarray[1];
- CBuffer* buff = textarray[0];
- for (int i = 1; i < numlines; i++)
- {
- textarray[i-1] = textarray[i];
- locnarray[i-1] = locnarray[i];
- }
- locnarray[numlines-1] = locate();
- if (getline(buff))
- {
- textarray[numlines-1] = buff;
- drawText( p, 0, height() - m_descent - 2, buff->data());
- mylastpos = locate();
- }
- else
- {
-// (*buff)[0] = '\0';
- textarray[numlines-1] = buff;
- m_autoScroll = false;
- ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
- }
+ setfont(&p);
+ m_scrolldy = 0;
+// qDrawPlainRect(&p,0,height() - m_linespacing,width(),m_linespacing,white,1,&b);
+ pagepos = locnarray[1];
+ CBuffer* buff = textarray[0];
+ for (int i = 1; i < numlines; i++)
+ {
+ textarray[i-1] = textarray[i];
+ locnarray[i-1] = locnarray[i];
+ }
+ locnarray[numlines-1] = locate();
+ if (getline(buff))
+ {
+ textarray[numlines-1] = buff;
+ drawText( p, 0, height() - m_descent - 2, buff->data());
+ mylastpos = locate();
+ }
+ else
+ {
+// (*buff)[0] = '\0';
+ textarray[numlines-1] = buff;
+ m_autoScroll = false;
+ ((QTReaderApp*)parent()->parent())->setScrollState(m_autoScroll);
+ }
}
@@ -366,6 +366,6 @@ void QTReader::drawText(QPainter& p, int x, int y, tchar* _text)
{
- for (int i = 0; i < text.length(); i++)
- {
- p.drawText( x+i*m_charWidth, y, QString(text[i]) );
- }
+ for (int i = 0; i < text.length(); i++)
+ {
+ p.drawText( x+i*m_charWidth, y, QString(text[i]) );
+ }
}
@@ -373,3 +373,3 @@ void QTReader::drawText(QPainter& p, int x, int y, tchar* _text)
{
- p.drawText( x, y, text );
+ p.drawText( x, y, text );
}
@@ -394,4 +394,4 @@ void QTReader::setfont(QPainter* p)
{
- m_fm = new QFontMetrics(font);
- buffdoc.setfm(m_fm);
+ m_fm = new QFontMetrics(font);
+ buffdoc.setfm(m_fm);
}
@@ -399,3 +399,3 @@ void QTReader::setfont(QPainter* p)
{
- *m_fm = QFontMetrics(font);
+ *m_fm = QFontMetrics(font);
}
@@ -419,20 +419,20 @@ void QTReader::drawFonts( QPainter *p )
{
-// qDebug("df:<%u,%u>",sl,numlines);
-
- size_t newpos = locnarray[sl];
- CBuffer** nta = new CBuffer*[sl];
- size_t* nla = new size_t[sl];
- for (int i = 0; i < sl; i++)
- {
- nta[i] = textarray[i];
- nla[i] = locnarray[i];
- }
- for (int i = sl; i < numlines; i++) delete textarray[i];
- delete [] textarray;
- delete [] locnarray;
- textarray = nta;
- locnarray = nla;
- numlines = sl;
- jumpto(mylastpos = newpos);
-// locate(pagepos);
+// qDebug("df:<%u,%u>",sl,numlines);
+
+ size_t newpos = locnarray[sl];
+ CBuffer** nta = new CBuffer*[sl];
+ size_t* nla = new size_t[sl];
+ for (int i = 0; i < sl; i++)
+ {
+ nta[i] = textarray[i];
+ nla[i] = locnarray[i];
+ }
+ for (int i = sl; i < numlines; i++) delete textarray[i];
+ delete [] textarray;
+ delete [] locnarray;
+ textarray = nta;
+ locnarray = nla;
+ numlines = sl;
+ jumpto(mylastpos = newpos);
+// locate(pagepos);
}
@@ -440,23 +440,23 @@ void QTReader::drawFonts( QPainter *p )
{
-// qDebug("df:<%u,%u>",sl,numlines);
- CBuffer** nta = new CBuffer*[sl];
- size_t* nla = new size_t[sl];
- for (int i = 0; i < numlines; i++)
- {
- nta[i] = textarray[i];
- nla[i] = locnarray[i];
- }
- if (locate() != mylastpos) jumpto(mylastpos);
- for (int i = numlines; i < sl; i++)
- {
- nta[i] = new CBuffer;
- nla[i] = locate();
- getline(nta[i]);
- }
- mylastpos = locate();
- delete [] textarray;
- delete [] locnarray;
- textarray = nta;
- locnarray = nla;
- numlines = sl;
+// qDebug("df:<%u,%u>",sl,numlines);
+ CBuffer** nta = new CBuffer*[sl];
+ size_t* nla = new size_t[sl];
+ for (int i = 0; i < numlines; i++)
+ {
+ nta[i] = textarray[i];
+ nla[i] = locnarray[i];
+ }
+ if (locate() != mylastpos) jumpto(mylastpos);
+ for (int i = numlines; i < sl; i++)
+ {
+ nta[i] = new CBuffer;
+ nla[i] = locate();
+ getline(nta[i]);
+ }
+ mylastpos = locate();
+ delete [] textarray;
+ delete [] locnarray;
+ textarray = nta;
+ locnarray = nla;
+ numlines = sl;
}
@@ -466,17 +466,17 @@ void QTReader::drawFonts( QPainter *p )
{
- drawText( *p, 0, ypos += m_linespacing, textarray[i]->data());
+ drawText( *p, 0, ypos += m_linespacing, textarray[i]->data());
}
/*
-
-
-
- int nlines = height()/(fontmetric.ascent()+fontmetric.descent());
- tchar buffer[1024];
- for (int i = 0; i < nlines; i++)
- {
- y += fontmetric.ascent();
- sprintf(buffer, "%d:%d:%s[%d]:Lines %d:%s", i+1, m_textfont, fonts[m_textfont], m_fs, nlines, (const tchar*)m_string);
- drawText( *p, 0, y, buffer );
- y += fontmetric.descent();
- }
+
+
+
+ int nlines = height()/(fontmetric.ascent()+fontmetric.descent());
+ tchar buffer[1024];
+ for (int i = 0; i < nlines; i++)
+ {
+ y += fontmetric.ascent();
+ sprintf(buffer, "%d:%d:%s[%d]:Lines %d:%s", i+1, m_textfont, fonts[m_textfont], m_fs, nlines, (const tchar*)m_string);
+ drawText( *p, 0, y, buffer );
+ y += fontmetric.descent();
+ }
*/
@@ -490,3 +490,3 @@ QString QTReader::firstword()
{
- return toQString(textarray[0]->data());
+ return toQString(textarray[0]->data());
}
@@ -494,19 +494,19 @@ QString QTReader::firstword()
{
- int start, end, len, j;
- for (j = 0; j < numlines; j++)
- {
- len = textarray[j]->length();
- for (start = 0; start < len && !isalpha((*textarray[j])[start]); start++);
- if (start < len) break;
- }
- if (j < numlines)
- {
- QString ret = "";
- for (end = start; end < len && isalpha((*textarray[j])[end]); end++)
- ret += (*textarray[j])[end];
- if (ret.isEmpty()) ret = "Current position";
- return ret;
- }
- else
- return "Current position";
+ int start, end, len, j;
+ for (j = 0; j < numlines; j++)
+ {
+ len = textarray[j]->length();
+ for (start = 0; start < len && !isalpha((*textarray[j])[start]); start++);
+ if (start < len) break;
+ }
+ if (j < numlines)
+ {
+ QString ret = "";
+ for (end = start; end < len && isalpha((*textarray[j])[end]); end++)
+ ret += (*textarray[j])[end];
+ if (ret.isEmpty()) ret = "Current position";
+ return ret;
+ }
+ else
+ return "Current position";
}
@@ -529,3 +529,3 @@ void QTReader::ChangeFont(int tgt)
{
- printf( "%s \n", (*it).latin1() );
+ printf( "%s \n", (*it).latin1() );
}
@@ -540,8 +540,8 @@ void QTReader::ChangeFont(int tgt)
{
- fontsizes[i] = (*it)/10;
- if (abs(tgt-fontsizes[i]) < abs(tgt-fontsizes[best]))
- {
- best = i;
- }
- i++;
+ fontsizes[i] = (*it)/10;
+ if (abs(tgt-fontsizes[i]) < abs(tgt-fontsizes[best]))
+ {
+ best = i;
+ }
+ i++;
}
@@ -553,4 +553,4 @@ void QTReader::ChangeFont(int tgt)
{
- m_fm = new QFontMetrics(font);
- buffdoc.setfm(m_fm);
+ m_fm = new QFontMetrics(font);
+ buffdoc.setfm(m_fm);
}
@@ -576,4 +576,4 @@ void QTReader::init()
{
- m_string = DocLnk(m_lastfile).name();
- load_file(m_lastfile);
+ m_string = DocLnk(m_lastfile).name();
+ load_file(m_lastfile);
}
@@ -684,7 +684,7 @@ bool QTReader::fillbuffer() {
if (textarray != NULL)
- {
- for (int i = 0; i < numlines; i++) delete textarray[i];
- delete [] textarray;
+ {
+ for (int i = 0; i < numlines; i++) delete textarray[i];
+ delete [] textarray;
delete [] locnarray;
- }
+ }
numlines = delta;
@@ -706,12 +706,12 @@ bool QTReader::fillbuffer() {
if (!ch)
- {
- if (i == 0)
- {
- pagepos = oldpagepos;
- return false;
- }
- else
- {
- ret = true;
- for (int j = i+1; j < delta; j++)
+ {
+ if (i == 0)
+ {
+ locate(oldpagepos);
+ return false;
+ }
+ else
+ {
+ ret = true;
+ for (int j = i+1; j < delta; j++)
{
@@ -720,5 +720,5 @@ bool QTReader::fillbuffer() {
}
- break;
- }
- }
+ break;
+ }
+ }
if (ch == '\012') ret = true;
@@ -735,3 +735,3 @@ void QTReader::dopagedn()
{
- if (locate() != mylastpos) jumpto(mylastpos);
+ if (locate() != mylastpos) jumpto(mylastpos);
}
@@ -739,4 +739,4 @@ void QTReader::dopagedn()
{
- if (m_overlap >= screenlines()) m_overlap = screenlines()/2;
- jumpto(locnarray[screenlines()-m_overlap]);
+ if (m_overlap >= screenlines()) m_overlap = screenlines()/2;
+ jumpto(locnarray[screenlines()-m_overlap]);
}
@@ -744,3 +744,3 @@ void QTReader::dopagedn()
{
- update();
+ update();
}
@@ -763,34 +763,34 @@ void QTReader::dopageup()
do
- {
- delta <<= 1;
- if (delta >= target)
- {
- delta = target;
- jumpto(0);
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
- }
- break;
- }
- jumpto(target-delta);
- do
- {
- getline(buff[0]);
+ {
+ delta <<= 1;
+ if (delta >= target)
+ {
+ delta = target;
+ jumpto(0);
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ getline(buff[i]);
+ }
+ break;
+ }
+ jumpto(target-delta);
+ do
+ {
+ getline(buff[0]);
#ifdef WS
- //printf("Trying:%s\n",buff[0]);
+ //printf("Trying:%s\n",buff[0]);
#endif
- if (locate() > target) continue;
- }
- while (!buffdoc.iseol());
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
+ if (locate() > target) continue;
+ }
+ while (!buffdoc.iseol());
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ getline(buff[i]);
#ifdef WS
- //printf("Filling:%s\n",buff[i]);
+ //printf("Filling:%s\n",buff[i]);
#endif
- }
- }
+ }
+ }
while (locate() >= target && delta < 4096);
@@ -804,6 +804,6 @@ void QTReader::dopageup()
for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
- }
+ {
+ loc[i] = locate();
+ getline(buff[i]);
+ }
}
@@ -864,4 +864,4 @@ void QTReader::lineDown()
{
- textarray[i-1] = textarray[i];
- locnarray[i-1] = locnarray[i];
+ textarray[i-1] = textarray[i];
+ locnarray[i-1] = locnarray[i];
}
@@ -870,4 +870,4 @@ void QTReader::lineDown()
{
- textarray[numlines-1] = buff;
- mylastpos = locate();
+ textarray[numlines-1] = buff;
+ mylastpos = locate();
}
@@ -875,3 +875,3 @@ void QTReader::lineDown()
{
- textarray[numlines-1] = buff;
+ textarray[numlines-1] = buff;
}
@@ -892,34 +892,34 @@ void QTReader::lineUp()
do
- {
- delta <<= 1;
- if (delta >= target)
- {
- delta = target;
- jumpto(0);
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- getline(buff[i]);
- }
- break;
- }
- jumpto(target-delta);
- do
- {
- buffdoc.getline(buff[0],width());
+ {
+ delta <<= 1;
+ if (delta >= target)
+ {
+ delta = target;
+ jumpto(0);
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ getline(buff[i]);
+ }
+ break;
+ }
+ jumpto(target-delta);
+ do
+ {
+ buffdoc.getline(buff[0],width());
#ifdef WS
- //printf("Trying:%s\n",buff[0]);
+ //printf("Trying:%s\n",buff[0]);
#endif
- if (locate() > target) continue;
- }
- while (!buffdoc.iseol());
- for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- buffdoc.getline(buff[i],width());
+ if (locate() > target) continue;
+ }
+ while (!buffdoc.iseol());
+ for (int i = 0; i < numlines; i++)
+ {
+ loc[i] = locate();
+ buffdoc.getline(buff[i],width());
#ifdef WS
- //printf("Filling:%s\n",buff[i]);
+ //printf("Filling:%s\n",buff[i]);
#endif
- }
- }
+ }
+ }
while (locate() >= target && delta < 4096);
@@ -933,6 +933,6 @@ void QTReader::lineUp()
for (int i = 0; i < numlines; i++)
- {
- loc[i] = locate();
- buffdoc.getline(buff[i],width());
- }
+ {
+ loc[i] = locate();
+ buffdoc.getline(buff[i],width());
+ }
}
@@ -975,28 +975,28 @@ void QTReader::lineUp()
do
- {
- delta <<= 1;
- if (delta >= target)
- {
- delta = target;
- jumpto(0);
- for (int i = 0; i < numlines; i++)
- {
- loc = locate();
- getline(buff);
- }
- break;
- }
- jumpto(target-delta);
- do
- {
- getline(buff);
+ {
+ delta <<= 1;
+ if (delta >= target)
+ {
+ delta = target;
+ jumpto(0);
+ for (int i = 0; i < numlines; i++)
+ {
+ loc = locate();
+ getline(buff);
+ }
+ break;
+ }
+ jumpto(target-delta);
+ do
+ {
+ getline(buff);
#ifdef WS
- //printf("Trying:%s\n",buff[0]);
+ //printf("Trying:%s\n",buff[0]);
#endif
- if (locate() > target) continue;
- }
- while (!buffdoc.iseol());
- loc = locate();
- getline(buff);
- }
+ if (locate() > target) continue;
+ }
+ while (!buffdoc.iseol());
+ loc = locate();
+ getline(buff);
+ }
while (locate() >= target && delta < 4096);
diff --git a/noncore/apps/opie-reader/opie-reader.control b/noncore/apps/opie-reader/opie-reader.control
index e8c98bb..1c28648 100644
--- a/noncore/apps/opie-reader/opie-reader.control
+++ b/noncore/apps/opie-reader/opie-reader.control
@@ -5,4 +5,4 @@ Maintainer: Tim Wentford <timwentford@hotmail.com>
Architecture: arm
-Version: 0_3r_beta_UTF8
-Depends:
+Version: $QPE_VERSION-$SUB_VERSION
+Depends: zlib
License: GPL