-rw-r--r-- | noncore/apps/opie-reader/Bkmks.cpp | 182 | ||||
-rw-r--r-- | noncore/apps/opie-reader/BuffDoc.cpp | 86 | ||||
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 942 |
3 files changed, 605 insertions, 605 deletions
diff --git a/noncore/apps/opie-reader/Bkmks.cpp b/noncore/apps/opie-reader/Bkmks.cpp index 92ed69f..0cb9ea9 100644 --- a/noncore/apps/opie-reader/Bkmks.cpp +++ b/noncore/apps/opie-reader/Bkmks.cpp @@ -20,4 +20,4 @@ Bkmk::Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p) : m_position(_ { - m_anno = new tchar[1]; - m_anno[0] = 0; + m_anno = new tchar[1]; + m_anno[0] = 0; } @@ -25,5 +25,5 @@ Bkmk::Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p) : m_position(_ { - len = ustrlen(_anno)+1; - m_anno = new tchar[len]; - for (int i = 0; i < len; i++) m_anno[i] = _anno[i]; + len = ustrlen(_anno)+1; + m_anno = new tchar[len]; + for (int i = 0; i < len; i++) m_anno[i] = _anno[i]; } @@ -43,4 +43,4 @@ Bkmk& Bkmk::operator=(const Bkmk& rhs) { - delete [] m_name; - m_name = NULL; + delete [] m_name; + m_name = NULL; } @@ -48,4 +48,4 @@ Bkmk& Bkmk::operator=(const Bkmk& rhs) { - delete [] m_anno; - m_anno = NULL; + delete [] m_anno; + m_anno = NULL; } @@ -53,16 +53,16 @@ Bkmk& Bkmk::operator=(const Bkmk& rhs) { - int len = ustrlen(rhs.m_name)+1; - m_name = new tchar[len]; - for (int i = 0; i < len; i++) m_name[i] = rhs.m_name[i]; + int len = ustrlen(rhs.m_name)+1; + m_name = new tchar[len]; + for (int i = 0; i < len; i++) m_name[i] = rhs.m_name[i]; } else - m_name = NULL; + m_name = NULL; if (rhs.m_anno != NULL) { - int len = ustrlen(rhs.m_anno)+1; - m_anno = new tchar[len]; - for (int i = 0; i < len; i++) m_anno[i] = rhs.m_anno[i]; + int len = ustrlen(rhs.m_anno)+1; + m_anno = new tchar[len]; + for (int i = 0; i < len; i++) m_anno[i] = rhs.m_anno[i]; } else - m_anno = NULL; + m_anno = NULL; m_position = rhs.m_position; @@ -80,4 +80,4 @@ void Bkmk::setAnno(tchar* t) { - delete [] m_anno; - m_anno = NULL; + delete [] m_anno; + m_anno = NULL; } @@ -85,8 +85,8 @@ void Bkmk::setAnno(tchar* t) { - int len = ustrlen(t)+1; - m_anno = new tchar[len]; - for (int i = 0; i < len; i++) m_anno[i] = t[i]; + int len = ustrlen(t)+1; + m_anno = new tchar[len]; + for (int i = 0; i < len; i++) m_anno[i] = t[i]; } else - m_anno = NULL; + m_anno = NULL; } @@ -99,3 +99,3 @@ BkmkFile::BkmkFile(const char *fnm, bool w = false) { - f = fopen(fnm, "wb"); + f = fopen(fnm, "wb"); } @@ -103,3 +103,3 @@ BkmkFile::BkmkFile(const char *fnm, bool w = false) { - f = fopen(fnm, "rb"); + f = fopen(fnm, "rb"); } @@ -116,9 +116,9 @@ void BkmkFile::write(tchar* nm, tchar* an, const unsigned int& pos) { - unsigned short ln = ustrlen(nm); - fwrite(&ln,sizeof(ln),1,f); - fwrite(nm,sizeof(tchar),ln,f); - ln = ustrlen(an); - fwrite(&ln,sizeof(ln),1,f); - if (ln > 0) fwrite(an,sizeof(tchar),ln,f); - fwrite(&pos,sizeof(pos),1,f); + unsigned short ln = ustrlen(nm); + fwrite(&ln,sizeof(ln),1,f); + fwrite(nm,sizeof(tchar),ln,f); + ln = ustrlen(an); + fwrite(&ln,sizeof(ln),1,f); + if (ln > 0) fwrite(an,sizeof(tchar),ln,f); + fwrite(&pos,sizeof(pos),1,f); } @@ -132,7 +132,7 @@ void BkmkFile::write(CList<Bkmk>& bl) { - fwrite(&magic, sizeof(magic), 1, f); - for (CList<Bkmk>::iterator i = bl.begin(); i != bl.end(); i++) - { - write(*i); - } + fwrite(&magic, sizeof(magic), 1, f); + for (CList<Bkmk>::iterator i = bl.begin(); i != bl.end(); i++) + { + write(*i); + } } @@ -145,16 +145,16 @@ Bkmk* BkmkFile::read() { - unsigned short ln; - if (fread(&ln,sizeof(ln),1,f) == 1) - { - b = new Bkmk; - b->m_name = new tchar[ln+1]; - fread(b->m_name,sizeof(tchar),ln,f); - b->m_name[ln] = 0; - - fread(&ln,sizeof(ln),1,f); - b->m_anno = new tchar[ln+1]; - if (ln > 0) fread(b->m_anno,sizeof(tchar),ln,f); - b->m_anno[ln] = 0; - fread(&b->m_position,sizeof(b->m_position),1,f); - } + unsigned short ln; + if (fread(&ln,sizeof(ln),1,f) == 1) + { + b = new Bkmk; + b->m_name = new tchar[ln+1]; + fread(b->m_name,sizeof(tchar),ln,f); + b->m_name[ln] = 0; + + fread(&ln,sizeof(ln),1,f); + b->m_anno = new tchar[ln+1]; + if (ln > 0) fread(b->m_anno,sizeof(tchar),ln,f); + b->m_anno[ln] = 0; + fread(&b->m_position,sizeof(b->m_position),1,f); + } } @@ -168,22 +168,22 @@ CList<Bkmk>* BkmkFile::readall() { - unsigned long newmagic; - fread(&newmagic, sizeof(newmagic), 1, f); - if (newmagic != magic) - { - if (QMessageBox::warning(NULL, "Old bookmark file!", "Which version of QTReader\ndid you upgrade from?", "0_4*", "Any other version") == 0) - { - fseek(f,0,SEEK_SET); - bl = readall04(); - } - else - { - fseek(f,0,SEEK_SET); - bl = readall03(); - } - isUpgraded = true; - } - else - { - bl = readall04(); - } + unsigned long newmagic; + fread(&newmagic, sizeof(newmagic), 1, f); + if (newmagic != magic) + { + if (QMessageBox::warning(NULL, "Old bookmark file!", "Which version of OpieReader\ndid you upgrade from?", "0_4*", "Any other version") == 0) + { + fseek(f,0,SEEK_SET); + bl = readall04(); + } + else + { + fseek(f,0,SEEK_SET); + bl = readall03(); + } + isUpgraded = true; + } + else + { + bl = readall04(); + } } @@ -197,6 +197,6 @@ CList<Bkmk>* BkmkFile::readall04() { - Bkmk* b = read(); - if (b == NULL) break; - bl->push_back(*b); - delete b; + Bkmk* b = read(); + if (b == NULL) break; + bl->push_back(*b); + delete b; } @@ -210,6 +210,6 @@ CList<Bkmk>* BkmkFile::readall03() { - Bkmk* b = read03(); - if (b == NULL) break; - bl->push_back(*b); - delete b; + Bkmk* b = read03(); + if (b == NULL) break; + bl->push_back(*b); + delete b; } @@ -223,16 +223,16 @@ Bkmk* BkmkFile::read03() { - unsigned short ln; - if (fread(&ln,sizeof(ln),1,f) == 1) - { - b = new Bkmk; - b->m_name = new tchar[ln+1]; - fread(b->m_name,sizeof(tchar),ln,f); - b->m_name[ln] = 0; + unsigned short ln; + if (fread(&ln,sizeof(ln),1,f) == 1) + { + b = new Bkmk; + b->m_name = new tchar[ln+1]; + fread(b->m_name,sizeof(tchar),ln,f); + b->m_name[ln] = 0; - ln = 0; - b->m_anno = new tchar[ln+1]; - b->m_anno[ln] = 0; + ln = 0; + b->m_anno = new tchar[ln+1]; + b->m_anno[ln] = 0; - fread(&b->m_position,sizeof(b->m_position),1,f); - } + fread(&b->m_position,sizeof(b->m_position),1,f); + } } diff --git a/noncore/apps/opie-reader/BuffDoc.cpp b/noncore/apps/opie-reader/BuffDoc.cpp index e37b136..d4541ea 100644 --- a/noncore/apps/opie-reader/BuffDoc.cpp +++ b/noncore/apps/opie-reader/BuffDoc.cpp @@ -15,4 +15,4 @@ bool BuffDoc::hyperlink(unsigned int n) { - bRet = exp->hyperlink(n); - lastsizes[0] = laststartline = exp->locate(); + bRet = exp->hyperlink(n); + lastsizes[0] = laststartline = exp->locate(); } @@ -39,5 +39,5 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w) { -// (*buff)[0] = '\0'; - buff->empty(); - return false; +// (*buff)[0] = '\0'; + buff->empty(); + return false; } @@ -56,5 +56,5 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w) for ( ; len > 0; len--) - { - if (buff->width(len) < w) break; - } + { + if (buff->width(len) < w) break; + } // lastword = buff->data() + len - 1; @@ -90,6 +90,6 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w) { - len++; - buff->addch(ch,cs); - allsizes[len] = exp->locate(); - getch(ch, cs); + len++; + buff->addch(ch,cs); + allsizes[len] = exp->locate(); + getch(ch, cs); } @@ -102,4 +102,4 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w) { - lastcheck = len; - break; + lastcheck = len; + break; } @@ -132,3 +132,3 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w, int cw) { - return false; + return false; } @@ -139,6 +139,6 @@ bool BuffDoc::getline(CDrawBuffer* buff, int w, int cw) { - getch(ch, cs); - if (ch == '\12' || ch == UEOF) break; - buff->addch(ch,cs); - i++; + getch(ch, cs); + if (ch == '\12' || ch == UEOF) break; + buff->addch(ch,cs); + i++; } @@ -166,5 +166,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) { - delete exp; - exp = NULL; - return ret; + delete exp; + exp = NULL; + return ret; } @@ -173,5 +173,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) - delete exp; - exp = new ztxt; - ret = exp->openfile(src); + delete exp; + exp = new ztxt; + ret = exp->openfile(src); } @@ -180,5 +180,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) - delete exp; - exp = new CPlucker; - ret = exp->openfile(src); + delete exp; + exp = new CPlucker; + ret = exp->openfile(src); } @@ -187,14 +187,14 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) { - delete exp; - qDebug("Trying ppms"); - exp = new ppm_expander; - ret = exp->openfile(src); + delete exp; + qDebug("Trying ppms"); + exp = new ppm_expander; + ret = exp->openfile(src); } - + if (ret != 0) { - delete exp; - exp = new Text; -// qDebug("Trying text"); - ret = exp->openfile(src); + delete exp; + exp = new Text; +// qDebug("Trying text"); + ret = exp->openfile(src); } @@ -203,5 +203,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) { - delete exp; - exp = new Text; - ret = exp->openfile(src); + delete exp; + exp = new Text; + ret = exp->openfile(src); } @@ -210,5 +210,5 @@ int BuffDoc::openfile(QWidget* _parent, const char *src) { - delete exp; - QMessageBox::information(_parent, "QTReader", "Unknown file compression type","Try another file"); - return ret; + delete exp; + QMessageBox::information(_parent, "OpieReader", "Unknown file compression type","Try another file"); + return ret; } diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp index 0608b66..ef1f4f1 100644 --- a/noncore/apps/opie-reader/QTReaderApp.cpp +++ b/noncore/apps/opie-reader/QTReaderApp.cpp @@ -76,12 +76,12 @@ void QTReaderApp::listBkmkFiles() { - struct dirent* de; - struct stat buf; - de = readdir(d); - if (de == NULL) break; + struct dirent* de; + struct stat buf; + de = readdir(d); + if (de == NULL) break; - if (lstat((const char *)Global::applicationFileName("uqtreader",de->d_name),&buf) == 0 && S_ISREG(buf.st_mode)) - { - bkmkselector->insertItem(de->d_name); - cnt++; - } + if (lstat((const char *)Global::applicationFileName("uqtreader",de->d_name),&buf) == 0 && S_ISREG(buf.st_mode)) + { + bkmkselector->insertItem(de->d_name); + cnt++; + } } @@ -97,3 +97,3 @@ void QTReaderApp::listBkmkFiles() if (searchVisible) searchBar->hide(); - m_nRegAction = cRmBkmkFile; + m_nRegAction = cRmBkmkFile; editorStack->raiseWidget( bkmkselector ); @@ -101,3 +101,3 @@ void QTReaderApp::listBkmkFiles() else - QMessageBox::information(this, "QTReader", "No bookmark files"); + QMessageBox::information(this, "OpieReader", "No bookmark files"); } @@ -113,3 +113,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) - m_fBkmksChanged = false; + m_fBkmksChanged = false; @@ -117,6 +117,6 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) - m_autogenstr = "^ *[A-Z].*[a-z] *$"; + m_autogenstr = "^ *[A-Z].*[a-z] *$"; setToolBarsMovable( FALSE ); - setIcon( Resource::loadPixmap( "uqtreader" ) ); + setIcon( Resource::loadPixmap( "opie-reader/uqtreader" ) ); @@ -257,3 +257,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) - a = m_scrollButton = new QAction( tr( "Scroll" ), Resource::loadPixmap( "panel-arrow-down" ), QString::null, 0, this, 0, true ); + a = m_scrollButton = new QAction( tr( "Scroll" ), Resource::loadPixmap( "opie-reader/panel-arrow-down" ), QString::null, 0, this, 0, true ); // connect( a, SIGNAL( activated() ), this, SLOT( autoScroll() ) ); @@ -539,6 +539,6 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) connect( searchEdit, SIGNAL( textChanged( const QString & ) ), - this, SLOT( search( const QString& ) ) ); + this, SLOT( search( const QString& ) ) ); #else connect( searchEdit, SIGNAL( returnPressed( ) ), - this, SLOT( search( ) ) ); + this, SLOT( search( ) ) ); #endif @@ -565,3 +565,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) connect( regEdit, SIGNAL( returnPressed( ) ), - this, SLOT( do_regaction() ) ); + this, SLOT( do_regaction() ) ); @@ -584,16 +584,16 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) { - FontDatabase f; - QStringList flist = f.families(); - m_fontSelector->insertStringList(flist); - - bool realfont = false; - for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) - { - if (reader->m_fontname == *nm) - { - realfont = true; - break; - } - } - if (!realfont) reader->m_fontname = flist[0]; + FontDatabase f; + QStringList flist = f.families(); + m_fontSelector->insertStringList(flist); + + bool realfont = false; + for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) + { + if (reader->m_fontname == *nm) + { + realfont = true; + break; + } + } + if (!realfont) reader->m_fontname = flist[0]; } // delete the FontDatabase!!! @@ -601,3 +601,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) connect( m_fontSelector, SIGNAL( activated(const QString& ) ), - this, SLOT( do_setfont(const QString&) ) ); + this, SLOT( do_setfont(const QString&) ) ); @@ -607,3 +607,3 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ), - this, SLOT( msgHandler(const QCString&, const QByteArray&) ) ); + this, SLOT( msgHandler(const QCString&, const QByteArray&) ) ); @@ -613,4 +613,4 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) { - openFile( reader->m_lastfile ); - doc = new DocLnk(reader->m_lastfile); + openFile( reader->m_lastfile ); + doc = new DocLnk(reader->m_lastfile); } @@ -630,5 +630,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString info; - stream >> info; - QMessageBox::information(this, "QTReader", info); + QString info; + stream >> info; + QMessageBox::information(this, "OpieReader", info); } @@ -636,5 +636,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString info; - stream >> info; - QMessageBox::warning(this, "QTReader", info); + QString info; + stream >> info; + QMessageBox::warning(this, "OpieReader", info); } @@ -644,4 +644,4 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - m_dontSave = true; - close(); + m_dontSave = true; + close(); } @@ -649,3 +649,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - reader->dopagedn(); + reader->dopagedn(); } @@ -653,3 +653,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - reader->dopageup(); + reader->dopageup(); } @@ -657,3 +657,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - reader->lineDown(); + reader->lineDown(); } @@ -661,3 +661,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - reader->lineUp(); + reader->lineUp(); } @@ -665,3 +665,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - showEditTools(); + showEditTools(); } @@ -669,5 +669,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString info; - stream >> info; - openFile( info ); + QString info; + stream >> info; + openFile( info ); } @@ -675,3 +675,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - showinfo(); + showinfo(); } @@ -679,3 +679,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - editMark(); + editMark(); } @@ -683,3 +683,3 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - editCopy(); + editCopy(); } @@ -687,5 +687,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - autoScroll(info); + int info; + stream >> info; + autoScroll(info); } @@ -693,5 +693,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - reader->locate(info); + int info; + stream >> info; + reader->locate(info); } @@ -699,5 +699,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - pagemode(info); + int info; + stream >> info; + pagemode(info); } @@ -705,5 +705,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - reader->m_overlap = info; + int info; + stream >> info; + reader->m_overlap = info; } @@ -711,5 +711,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString info; - stream >> info; - do_settarget(info); + QString info; + stream >> info; + do_settarget(info); } @@ -717,5 +717,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - setTwoTouch(info); + int info; + stream >> info; + setTwoTouch(info); } @@ -723,5 +723,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - OnAnnotation(info); + int info; + stream >> info; + OnAnnotation(info); } @@ -729,5 +729,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - OnDictionary(info); + int info; + stream >> info; + OnDictionary(info); } @@ -735,5 +735,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - OnClipboard(info); + int info; + stream >> info; + OnClipboard(info); } @@ -741,20 +741,20 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString info; - stream >> info; - QRegExp arg(info); - size_t pos = reader->pagelocate(); - size_t start = pos; - CDrawBuffer test(&(reader->m_fontControl)); - reader->buffdoc.getline(&test,reader->width()); - while (arg.match(toQString(test.data())) == -1) - { - pos = reader->locate(); - if (!reader->buffdoc.getline(&test,reader->width())) - { - QMessageBox::information(this, "QTReader", QString("Can't find\n")+info); - pos = start; - break; - } - } - reader->locate(pos); + QString info; + stream >> info; + QRegExp arg(info); + size_t pos = reader->pagelocate(); + size_t start = pos; + CDrawBuffer test(&(reader->m_fontControl)); + reader->buffdoc.getline(&test,reader->width()); + while (arg.match(toQString(test.data())) == -1) + { + pos = reader->locate(); + if (!reader->buffdoc.getline(&test,reader->width())) + { + QMessageBox::information(this, "OpieReader", QString("Can't find\n")+info); + pos = start; + break; + } + } + reader->locate(pos); } @@ -762,5 +762,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - stripcr(info); + int info; + stream >> info; + stripcr(info); } @@ -768,5 +768,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - autofmt(info); + int info; + stream >> info; + autofmt(info); } @@ -774,5 +774,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - textfmt(info); + int info; + stream >> info; + textfmt(info); } @@ -780,5 +780,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - striphtml(info); + int info; + stream >> info; + striphtml(info); } @@ -786,5 +786,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - peanut(info); + int info; + stream >> info; + peanut(info); } @@ -792,5 +792,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - dehyphen(info); + int info; + stream >> info; + dehyphen(info); } @@ -798,5 +798,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - unindent(info); + int info; + stream >> info; + unindent(info); } @@ -804,5 +804,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - repara(info); + int info; + stream >> info; + repara(info); } @@ -810,5 +810,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - dblspce(info); + int info; + stream >> info; + dblspce(info); } @@ -816,6 +816,6 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - reader->bindenter = info; - reader->setfilter(reader->getfilter()); + int info; + stream >> info; + reader->bindenter = info; + reader->setfilter(reader->getfilter()); } @@ -823,5 +823,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - remap(info); + int info; + stream >> info; + remap(info); } @@ -829,5 +829,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - embolden(info); + int info; + stream >> info; + embolden(info); } @@ -835,5 +835,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - monospace(info); + int info; + stream >> info; + monospace(info); } @@ -841,7 +841,7 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - int info; - stream >> info; - reader->m_charpc = info; - reader->setfont(); - reader->refresh(); + int info; + stream >> info; + reader->m_charpc = info; + reader->setfont(); + reader->refresh(); } @@ -849,5 +849,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString info; - stream >> info; - reader->setencoding(EncNameToInt(info)); + QString info; + stream >> info; + reader->setencoding(EncNameToInt(info)); } @@ -855,7 +855,7 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString fontname; - int size; - stream >> fontname; - stream >> size; - setfontHelper(fontname, size); + QString fontname; + int size; + stream >> fontname; + stream >> size; + setfontHelper(fontname, size); } @@ -863,5 +863,5 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { - QString info; - stream >> info; - do_autogen(info); + QString info; + stream >> info; + do_autogen(info); } @@ -873,3 +873,3 @@ ActionTypes QTReaderApp::ActNameToInt(const QString& _enc) { - if (m_buttonAction[i]->text() == _enc) return (ActionTypes)i; + if (m_buttonAction[i]->text() == _enc) return (ActionTypes)i; } @@ -882,3 +882,3 @@ int QTReaderApp::EncNameToInt(const QString& _enc) { - if (m_EncodingAction[i]->text() == _enc) return i; + if (m_EncodingAction[i]->text() == _enc) return i; } @@ -916,3 +916,3 @@ void QTReaderApp::TBD() { - QMessageBox::information(this, "QTReader", "Not yet implemented", 1); + QMessageBox::information(this, "OpieReader", "Not yet implemented", 1); } @@ -921,3 +921,3 @@ void QTReaderApp::TBDzoom() { - QMessageBox::information(this, "QTReader", "Zooming is done interactively\nTry left/right cursor keys", 1); + QMessageBox::information(this, "OpieReader", "Zooming is done interactively\nTry left/right cursor keys", 1); } @@ -926,5 +926,5 @@ void QTReaderApp::clearBkmkList() { - delete pBkmklist; - pBkmklist = NULL; - m_fBkmksChanged = false; + delete pBkmklist; + pBkmklist = NULL; + m_fBkmksChanged = false; } @@ -941,10 +941,10 @@ void QTReaderApp::fileOpen() { - if (m_fBkmksChanged) - { - if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0) - savebkmks(); - } - delete pBkmklist; - pBkmklist = NULL; - m_fBkmksChanged = false; + if (m_fBkmksChanged) + { + if (QMessageBox::warning(this, "OpieReader", "Save bookmarks?", "Save", "Don't bother") == 0) + savebkmks(); + } + delete pBkmklist; + pBkmklist = NULL; + m_fBkmksChanged = false; } @@ -955,6 +955,6 @@ void QTReaderApp::fileOpen() */ - fileBrowser* fb = new fileBrowser(this,"QTReader",TRUE, - 0, -// WStyle_Customize | WStyle_NoBorderEx, - "*", QFileInfo(reader->m_lastfile).dirPath(true)); + fileBrowser* fb = new fileBrowser(this,"OpieReader",TRUE, + 0, +// WStyle_Customize | WStyle_NoBorderEx, + "*", QFileInfo(reader->m_lastfile).dirPath(true)); @@ -962,5 +962,5 @@ void QTReaderApp::fileOpen() { - QString fn(fb->fileList[0]); + QString fn(fb->fileList[0]); // fb->populateList(); - if (!fn.isEmpty() && QFileInfo(fn).isFile()) openFile(fn); + if (!fn.isEmpty() && QFileInfo(fn).isFile()) openFile(fn); } @@ -975,3 +975,3 @@ void QTReaderApp::showinfo() { - QMessageBox::information(this, "QTReader", "No file loaded", 1); + QMessageBox::information(this, "OpieReader", "No file loaded", 1); } @@ -979,11 +979,11 @@ void QTReaderApp::showinfo() { - reader->sizes(fs,ts); - pl = reader->pagelocate(); - m_infoWin->setFileSize(fs); - m_infoWin->setTextSize(ts); - m_infoWin->setRatio(100-(100*fs + (ts >> 1))/ts); - m_infoWin->setLocation(pl); - m_infoWin->setRead((100*pl + (ts >> 1))/ts); - editorStack->raiseWidget( m_infoWin ); - m_infoWin->setFocus(); + reader->sizes(fs,ts); + pl = reader->pagelocate(); + m_infoWin->setFileSize(fs); + m_infoWin->setTextSize(ts); + m_infoWin->setRatio(100-(100*fs + (ts >> 1))/ts); + m_infoWin->setLocation(pl); + m_infoWin->setRead((100*pl + (ts >> 1))/ts); + editorStack->raiseWidget( m_infoWin ); + m_infoWin->setFocus(); } @@ -999,3 +999,3 @@ void QTReaderApp::addAnno(const QString& name, const QString& text, size_t posn) { - buff[i] = name[i].unicode(); + buff[i] = name[i].unicode(); } @@ -1005,3 +1005,3 @@ void QTReaderApp::addAnno(const QString& name, const QString& text, size_t posn) { - buff2[i] = text[i].unicode(); + buff2[i] = text[i].unicode(); } @@ -1020,11 +1020,11 @@ void QTReaderApp::addAnno(const QString& name, const QString& text) { - if (name.isEmpty()) - { - QMessageBox::information(this, "QTReader", "Need a name for the bookmark\nPlease try again", 1); - } - else - { - addAnno(name, text, m_annoWin->getPosn()); - } - showEditTools(); + if (name.isEmpty()) + { + QMessageBox::information(this, "OpieReader", "Need a name for the bookmark\nPlease try again", 1); + } + else + { + addAnno(name, text, m_annoWin->getPosn()); + } + showEditTools(); } @@ -1032,24 +1032,24 @@ void QTReaderApp::addAnno(const QString& name, const QString& text) { - if (m_annoWin->edited()) - { - CBuffer buff(text.length()+1); - int i; - for (i = 0; i < text.length(); i++) - { - buff[i] = text[i].unicode(); - } - buff[i] = 0; - m_fBkmksChanged = true; - m_anno->setAnno(buff.data()); - } - bool found = findNextBookmark(m_anno->value()+1); - if (found) - { - m_annoWin->setName(toQString(m_anno->name())); - m_annoWin->setAnno(toQString(m_anno->anno())); - } - else - { - showEditTools(); - } + if (m_annoWin->edited()) + { + CBuffer buff(text.length()+1); + int i; + for (i = 0; i < text.length(); i++) + { + buff[i] = text[i].unicode(); + } + buff[i] = 0; + m_fBkmksChanged = true; + m_anno->setAnno(buff.data()); + } + bool found = findNextBookmark(m_anno->value()+1); + if (found) + { + m_annoWin->setName(toQString(m_anno->name())); + m_annoWin->setAnno(toQString(m_anno->anno())); + } + else + { + showEditTools(); + } } @@ -1062,11 +1062,11 @@ bool QTReaderApp::findNextBookmark(size_t start) { - if (iter->value() >= start) - { - if (iter->value() < reader->locate()) - { - found = true; - m_anno = iter.pContent(); - } - break; - } + if (iter->value() >= start) + { + if (iter->value() < reader->locate()) + { + found = true; + m_anno = iter.pContent(); + } + break; + } } @@ -1079,3 +1079,3 @@ void QTReaderApp::addanno() { - QMessageBox::information(this, "QTReader", "No file loaded", 1); + QMessageBox::information(this, "OpieReader", "No file loaded", 1); } @@ -1083,8 +1083,8 @@ void QTReaderApp::addanno() { - m_annoWin->setName(""); - m_annoWin->setAnno(""); - m_annoWin->setPosn(reader->pagelocate()); - m_annoIsEditing = true; - editorStack->raiseWidget( m_annoWin ); - m_annoWin->setFocus(); + m_annoWin->setName(""); + m_annoWin->setAnno(""); + m_annoWin->setPosn(reader->pagelocate()); + m_annoIsEditing = true; + editorStack->raiseWidget( m_annoWin ); + m_annoWin->setFocus(); } @@ -1118,14 +1118,14 @@ void QTReaderApp::editCopy() { - QClipboard* cb = QApplication::clipboard(); - QString text; - int ch; - unsigned long currentpos = reader->pagelocate(); - unsigned long endpos = reader->locate(); - reader->jumpto(m_savedpos); - while (reader->explocate() < endpos && (ch = reader->getch()) != UEOF) - { - text += ch; - } - cb->setText(text); - reader->locate(currentpos); + QClipboard* cb = QApplication::clipboard(); + QString text; + int ch; + unsigned long currentpos = reader->pagelocate(); + unsigned long endpos = reader->locate(); + reader->jumpto(m_savedpos); + while (reader->explocate() < endpos && (ch = reader->getch()) != UEOF) + { + text += ch; + } + cb->setText(text); + reader->locate(currentpos); } @@ -1218,4 +1218,4 @@ void QTReaderApp::settarget() QString text = ((m_targetapp.isEmpty()) ? QString("") : m_targetapp) - + "/" - + ((m_targetmsg.isEmpty()) ? QString("") : m_targetmsg); + + "/" + + ((m_targetmsg.isEmpty()) ? QString("") : m_targetmsg); regEdit->setText(text); @@ -1230,6 +1230,6 @@ void QTReaderApp::do_overlap(const QString& lcn) { - reader->m_overlap = ulcn; + reader->m_overlap = ulcn; } else - QMessageBox::information(this, "QTReader", "Must be a number"); + QMessageBox::information(this, "OpieReader", "Must be a number"); } @@ -1242,9 +1242,9 @@ void QTReaderApp::do_mono(const QString& lcn) { - reader->m_charpc = ulcn; - reader->setfont(); - reader->refresh(); -// reader->setmono(true); + reader->m_charpc = ulcn; + reader->setfont(); + reader->refresh(); +// reader->setmono(true); } else - QMessageBox::information(this, "QTReader", "Must be a number"); + QMessageBox::information(this, "OpieReader", "Must be a number"); } @@ -1334,11 +1334,11 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg) if (!reader->buffdoc.getline(&test,reader->width())) - { - if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2) - pos = searchStart; - else - pos = start; - ret = false; - findClose(); - break; - } + { + if (QMessageBox::warning(this, "Can't find", searchEdit->text(), 1, 2) == 2) + pos = searchStart; + else + pos = start; + ret = false; + findClose(); + break; + } } @@ -1420,5 +1420,5 @@ void QTReaderApp::openFile( const DocLnk &f ) { - QMessageBox::information(this, "QTReader", "File does not exist"); + QMessageBox::information(this, "OpieReader", "File does not exist"); } - + } @@ -1428,3 +1428,3 @@ void QTReaderApp::showEditTools() if ( !doc ) - close(); + close(); // fileSelector->hide(); @@ -1433,5 +1433,5 @@ void QTReaderApp::showEditTools() if ( searchVisible ) - searchBar->show(); + searchBar->show(); if ( regVisible ) - regBar->show(); + regBar->show(); if (m_fontVisible) m_fontBar->show(); @@ -1446,5 +1446,5 @@ void QTReaderApp::save() if ( !doc ) - return; + return; if ( !editor->edited() ) - return; + return; @@ -1454,15 +1454,15 @@ void QTReaderApp::save() if ( doc->name().isEmpty() ) { - unsigned ispace = pt.find( ' ' ); - unsigned ienter = pt.find( '\n' ); - int i = (ispace < ienter) ? ispace : ienter; - QString docname; - if ( i == -1 ) { - if ( pt.isEmpty() ) - docname = "Empty Text"; - else - docname = pt; - } else { - docname = pt.left( i ); - } - doc->setName(docname); + unsigned ispace = pt.find( ' ' ); + unsigned ienter = pt.find( '\n' ); + int i = (ispace < ienter) ? ispace : ienter; + QString docname; + if ( i == -1 ) { + if ( pt.isEmpty() ) + docname = "Empty Text"; + else + docname = pt; + } else { + docname = pt.left( i ); + } + doc->setName(docname); } @@ -1478,5 +1478,5 @@ void QTReaderApp::clear() // QMessageBox::information(this, "QTReader", "Deleting doc", 1); - delete doc; + delete doc; // QMessageBox::information(this, "QTReader", "Deleted doc", 1); - doc = 0; + doc = 0; } @@ -1488,8 +1488,8 @@ void QTReaderApp::updateCaption() if ( !doc ) - setCaption( tr("QTReader") ); + setCaption( tr("OpieReader") ); else { - QString s = doc->name(); - if ( s.isEmpty() ) - s = tr( "Unnamed" ); - setCaption( s + " - " + tr("QTReader") ); + QString s = doc->name(); + if ( s.isEmpty() ) + s = tr( "Unnamed" ); + setCaption( s + " - " + tr("OpieReader") ); } @@ -1509,3 +1509,3 @@ void QTReaderApp::closeEvent( QCloseEvent *e ) { - e->accept(); + e->accept(); } @@ -1513,37 +1513,37 @@ void QTReaderApp::closeEvent( QCloseEvent *e ) { - if (editorStack->visibleWidget() == reader) - { - if (m_fontVisible) - { - m_fontBar->hide(); - m_fontVisible = false; - } - if (regVisible) - { - regBar->hide(); - regVisible = false; - return; - } - if (searchVisible) - { - searchBar->hide(); - searchVisible = false; - return; - } - if (m_fBkmksChanged && pBkmklist != NULL) - { - if (QMessageBox::warning(this, "QTReader", "Save bookmarks?", "Save", "Don't bother") == 0) - savebkmks(); - delete pBkmklist; - pBkmklist = NULL; - m_fBkmksChanged = false; - } - bFromDocView = FALSE; - saveprefs(); - e->accept(); - } - else - { - showEditTools(); - } + if (editorStack->visibleWidget() == reader) + { + if (m_fontVisible) + { + m_fontBar->hide(); + m_fontVisible = false; + } + if (regVisible) + { + regBar->hide(); + regVisible = false; + return; + } + if (searchVisible) + { + searchBar->hide(); + searchVisible = false; + return; + } + if (m_fBkmksChanged && pBkmklist != NULL) + { + if (QMessageBox::warning(this, "OpieReader", "Save bookmarks?", "Save", "Don't bother") == 0) + savebkmks(); + delete pBkmklist; + pBkmklist = NULL; + m_fBkmksChanged = false; + } + bFromDocView = FALSE; + saveprefs(); + e->accept(); + } + else + { + showEditTools(); + } } @@ -1569,11 +1569,11 @@ void QTReaderApp::listbkmk() { - for (CList<Bkmk>::iterator i = pBkmklist->begin(); i != pBkmklist->end(); i++) - { + for (CList<Bkmk>::iterator i = pBkmklist->begin(); i != pBkmklist->end(); i++) + { #ifdef _UNICODE - bkmkselector->insertItem(toQString(i->name())); + bkmkselector->insertItem(toQString(i->name())); #else - bkmkselector->insertItem(i->name()); + bkmkselector->insertItem(i->name()); #endif - cnt++; - } + cnt++; + } } @@ -1589,3 +1589,3 @@ void QTReaderApp::listbkmk() else - QMessageBox::information(this, "QTReader", "No bookmarks in memory"); + QMessageBox::information(this, "OpieReader", "No bookmarks in memory"); } @@ -1611,14 +1611,14 @@ void QTReaderApp::gotobkmk(int ind) { - case cGotoBkmk: - reader->locate((*pBkmklist)[ind]->value()); - break; - case cDelBkmk: -// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); - pBkmklist->erase(ind); - m_fBkmksChanged = true; -// pBkmklist->sort(); - break; - case cRmBkmkFile: - unlink((const char *)Global::applicationFileName("uqtreader",bkmkselector->text(ind))); - break; + case cGotoBkmk: + reader->locate((*pBkmklist)[ind]->value()); + break; + case cDelBkmk: +// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); + pBkmklist->erase(ind); + m_fBkmksChanged = true; +// pBkmklist->sort(); + break; + case cRmBkmkFile: + unlink((const char *)Global::applicationFileName("uqtreader",bkmkselector->text(ind))); + break; } @@ -1646,5 +1646,5 @@ void QTReaderApp::do_jump(const QString& lcn) if (ok) - reader->locate(ulcn); + reader->locate(ulcn); else - QMessageBox::information(this, "QTReader", "Must be a number"); + QMessageBox::information(this, "OpieReader", "Must be a number"); } @@ -1658,19 +1658,19 @@ void QTReaderApp::do_regaction() case cAutoGen: - do_autogen(regEdit->text()); - break; + do_autogen(regEdit->text()); + break; case cAddBkmk: - do_addbkmk(regEdit->text()); - break; + do_addbkmk(regEdit->text()); + break; case cJump: - do_jump(regEdit->text()); - break; + do_jump(regEdit->text()); + break; case cMonoSpace: - do_mono(regEdit->text()); - break; + do_mono(regEdit->text()); + break; case cOverlap: - do_overlap(regEdit->text()); - break; + do_overlap(regEdit->text()); + break; case cSetTarget: - do_settarget(regEdit->text()); - break; + do_settarget(regEdit->text()); + break; } @@ -1686,5 +1686,5 @@ void QTReaderApp::do_settarget(const QString& _txt) { - m_targetapp = ""; - m_targetmsg = ""; - QMessageBox::information(this, "QTReader", "Format is\nappname/messagename"); + m_targetapp = ""; + m_targetmsg = ""; + QMessageBox::information(this, "OpieReader", "Format is\nappname/messagename"); } @@ -1692,4 +1692,4 @@ void QTReaderApp::do_settarget(const QString& _txt) { - m_targetapp = _txt.left(ind); - m_targetmsg = _txt.right(_txt.length()-ind-1); + m_targetapp = _txt.left(ind); + m_targetmsg = _txt.right(_txt.length()-ind-1); } @@ -1701,7 +1701,7 @@ void QTReaderApp::setfont() { - if (m_fontSelector->text(i) == reader->m_fontname) - { - m_fontSelector->setCurrentItem(i); - break; - } + if (m_fontSelector->text(i) == reader->m_fontname) + { + m_fontSelector->setCurrentItem(i); + break; + } } @@ -1722,3 +1722,3 @@ void QTReaderApp::setfontHelper(const QString& lcn, int size = 0) { - reader->ChangeFont(size); + reader->ChangeFont(size); } @@ -1761,5 +1761,5 @@ pbar->resize(width(), editBar->height()); pbar->setProgress(pc); - qApp->processEvents(); - if (reader->locate() != lcn) reader->jumpto(lcn); - reader->setFocus(); + qApp->processEvents(); + if (reader->locate() != lcn) reader->jumpto(lcn); + reader->setFocus(); lastpc = pc; @@ -1772,3 +1772,3 @@ pbar->resize(width(), editBar->height()); #endif - pBkmklist->push_back(Bkmk(buff.data(), NULL, lcn)); + pBkmklist->push_back(Bkmk(buff.data(), NULL, lcn)); } @@ -1846,14 +1846,14 @@ void info_cb(Fl_Widget* o, void* _data) { - - infowin = new Fl_Window(160,240); - filename = new Fl_Output(45,5,110,14,"Filename"); - filesize = new Fl_Output(45,25,110,14,"Filesize"); - textsize = new Fl_Output(45,45,110,14,"Textsize"); - comprat = new CBar(45,65,110,14,"Ratio %"); - posn = new Fl_Output(45,85,110,14,"Location"); - frcn = new CBar(45,105,110,14,"% Read"); - about = new Fl_Multiline_Output(5,125,150,90); - about->value("TWReader - $Name$\n\nA file reader program for the Agenda\n\nReads text, PalmDoc and ppms format files"); - Fl_Button *jump_accept = new Fl_Button(62,220,35,14,"Okay"); - infowin->set_modal(); + + infowin = new Fl_Window(160,240); + filename = new Fl_Output(45,5,110,14,"Filename"); + filesize = new Fl_Output(45,25,110,14,"Filesize"); + textsize = new Fl_Output(45,45,110,14,"Textsize"); + comprat = new CBar(45,65,110,14,"Ratio %"); + posn = new Fl_Output(45,85,110,14,"Location"); + frcn = new CBar(45,105,110,14,"% Read"); + about = new Fl_Multiline_Output(5,125,150,90); + about->value("TWReader - $Name$\n\nA file reader program for the Agenda\n\nReads text, PalmDoc and ppms format files"); + Fl_Button *jump_accept = new Fl_Button(62,220,35,14,"Okay"); + infowin->set_modal(); } @@ -1861,21 +1861,21 @@ void info_cb(Fl_Widget* o, void* _data) { - unsigned long fs,ts; - tchar sz[20]; - ((reader_ui *)_data)->input->sizes(fs,ts); - unsigned long pl = ((reader_ui *)_data)->input->locate(); + unsigned long fs,ts; + tchar sz[20]; + ((reader_ui *)_data)->input->sizes(fs,ts); + unsigned long pl = ((reader_ui *)_data)->input->locate(); - filename->value(((reader_ui *)_data)->g_filename); + filename->value(((reader_ui *)_data)->g_filename); - sprintf(sz,"%u",fs); - filesize->value(sz); + sprintf(sz,"%u",fs); + filesize->value(sz); - sprintf(sz,"%u",ts); - textsize->value(sz); + sprintf(sz,"%u",ts); + textsize->value(sz); - comprat->value(100-(100*fs + (ts >> 1))/ts); + comprat->value(100-(100*fs + (ts >> 1))/ts); - sprintf(sz,"%u",pl); - posn->value(sz); + sprintf(sz,"%u",pl); + posn->value(sz); - frcn->value((100*pl + (ts >> 1))/ts); + frcn->value((100*pl + (ts >> 1))/ts); } @@ -1889,6 +1889,6 @@ void QTReaderApp::savebkmks() { - BkmkFile bf((const char *)Global::applicationFileName("uqtreader",reader->m_string), true); - bf.write(*pBkmklist); + BkmkFile bf((const char *)Global::applicationFileName("uqtreader",reader->m_string), true); + bf.write(*pBkmklist); } - m_fBkmksChanged = false; + m_fBkmksChanged = false; } @@ -1899,3 +1899,3 @@ void QTReaderApp::readbkmks() { - delete pBkmklist; + delete pBkmklist; } @@ -1906,6 +1906,6 @@ void QTReaderApp::readbkmks() { - pBkmklist = reader->getbkmklist(); + pBkmklist = reader->getbkmklist(); } if (pBkmklist != NULL) - pBkmklist->sort(); + pBkmklist->sort(); } @@ -1921,24 +1921,24 @@ void QTReaderApp::do_addbkmk(const QString& text) { - if (text.isEmpty()) - { - QMessageBox::information(this, "QTReader", "Need a name for the bookmark\nSelect add again", 1); - } - else - { - if (pBkmklist == NULL) pBkmklist = new CList<Bkmk>; + if (text.isEmpty()) + { + QMessageBox::information(this, "OpieReader", "Need a name for the bookmark\nSelect add again", 1); + } + else + { + if (pBkmklist == NULL) pBkmklist = new CList<Bkmk>; #ifdef _UNICODE - CBuffer buff; - int i = 0; - for (i = 0; i < text.length(); i++) - { - buff[i] = text[i].unicode(); - } - buff[i] = 0; - pBkmklist->push_front(Bkmk(buff.data(), NULL, reader->pagelocate())); + CBuffer buff; + int i = 0; + for (i = 0; i < text.length(); i++) + { + buff[i] = text[i].unicode(); + } + buff[i] = 0; + pBkmklist->push_front(Bkmk(buff.data(), NULL, reader->pagelocate())); #else - pBkmklist->push_front(Bkmk((const tchar*)text,reader->pagelocate())); + pBkmklist->push_front(Bkmk((const tchar*)text,reader->pagelocate())); #endif - m_fBkmksChanged = true; - pBkmklist->sort(); - } + m_fBkmksChanged = true; + pBkmklist->sort(); + } } @@ -1949,4 +1949,4 @@ void QTReaderApp::OnRedraw() { - bool found = findNextBookmark(reader->pagelocate()); - m_bkmkAvail->setEnabled(found); + bool found = findNextBookmark(reader->pagelocate()); + m_bkmkAvail->setEnabled(found); } @@ -1969,12 +1969,12 @@ void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& { - QClipboard* cb = QApplication::clipboard(); - cb->setText(wrd); - if (wrd.length() > 10) - { - Global::statusMessage(wrd.left(8) + ".."); - } - else - { - Global::statusMessage(wrd); - } + QClipboard* cb = QApplication::clipboard(); + cb->setText(wrd); + if (wrd.length() > 10) + { + Global::statusMessage(wrd.left(8) + ".."); + } + else + { + Global::statusMessage(wrd); + } } @@ -1982,8 +1982,8 @@ void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& { -// addAnno(wrd, "Need to be able to edit this", posn); - m_annoWin->setName(line); - m_annoWin->setAnno(""); - m_annoWin->setPosn(posn); - m_annoIsEditing = true; - editorStack->raiseWidget( m_annoWin ); +// addAnno(wrd, "Need to be able to edit this", posn); + m_annoWin->setName(line); + m_annoWin->setAnno(""); + m_annoWin->setPosn(posn); + m_annoIsEditing = true; + editorStack->raiseWidget( m_annoWin ); } @@ -1991,7 +1991,7 @@ void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& { - if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty()) - { - QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8()); - e << wrd; - } + if (!m_targetapp.isEmpty() && !m_targetmsg.isEmpty()) + { + QCopEnvelope e(("QPE/Application/"+m_targetapp).utf8(), (m_targetmsg+"(QString)").utf8()); + e << wrd; + } } @@ -2003,23 +2003,23 @@ void QTReaderApp::OnActionPressed() { - case cesOpenFile: - { - fileOpen(); - } - break; - case cesAutoScroll: - { - reader->setautoscroll(!reader->m_autoScroll); - setScrollState(reader->m_autoScroll); - } - break; - case cesActionMark: - { - addbkmk(); - } - break; - default: - { - qDebug("Unknown ActionType:%u", m_spaceTarget); - } - break; + case cesOpenFile: + { + fileOpen(); + } + break; + case cesAutoScroll: + { + reader->setautoscroll(!reader->m_autoScroll); + setScrollState(reader->m_autoScroll); + } + break; + case cesActionMark: + { + addbkmk(); + } + break; + default: + { + qDebug("Unknown ActionType:%u", m_spaceTarget); + } + break; } |