1 diff --git a/Aportis.cpp b/Aportis.cpp
2 index 37dcc99..03c26ea 100644
5 @@ -443,8 +443,7 @@ unsuspend();
6 gotorecordnumber(tgtrec);
7 UInt8* imgbuffer = new UInt8[reclen];
8 fread(imgbuffer, 1, reclen, fin);
10 - arr.assign((const char*)imgbuffer, reclen);
11 + QByteArray arr((const char*)imgbuffer, reclen);
13 QImage* qimage = new QImage(arr);
14 fseek(fin, cur, SEEK_SET);
15 diff --git a/Bkmks.cpp b/Bkmks.cpp
16 index 45aa045..c67db9e 100644
19 @@ -32,8 +32,7 @@ Bkmk::Bkmk(const Bkmk& rhs) :
23 - init(rhs.name(), sizeof(tchar)*(ustrlen(rhs.name())+1), rhs.anno(),
24 - sizeof(tchar)*(ustrlen(rhs.anno())+1), rhs.value());
28 Bkmk::Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p) : m_position(_p)
29 diff --git a/BuffDoc.cpp b/BuffDoc.cpp
30 index 355d14d..170ed43 100644
37 +#include "uqtcommon.h"
40 linkType BuffDoc::hyperlink(unsigned int n, unsigned int noff, QString& wrd, QString& nm)
42 @@ -674,35 +676,19 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
44 // //qDebug("Doing final open:%x:%x",exp,filt);
48 - QString codecpath(getenv("OPIEDIR"));
50 - QString codecpath(getenv("QTDIR"));
52 - codecpath += "/plugins/reader/codecs";
54 - QString codecpath(getenv("READERDIR"));
55 - codecpath += "/codecs";
57 - QDir d(codecpath, "*.so");
58 + QDir d(uqt_codecspath(), "*.so");
63 - const QFileInfoList *list = d.entryInfoList();
64 - QFileInfoListIterator it( *list ); // create list iterator
65 - QFileInfo *fi; // pointer for traversing
67 + QFileInfoList list = d.entryInfoList();
69 - while ( ret != 0 && (fi=it.current()) )
70 - { // for each file...
71 + for(QFileInfoListIterator it=list.begin();ret && it!=list.end();++it) {
72 if (exp != NULL) delete exp;
73 - qDebug("Trying %s", (const char*)fi->fileName());
74 - exp = new ebookcodec(fi->fileName());
75 + qDebug("Trying %s", (const char*)it->fileName());
76 + exp = new ebookcodec(it->fileName());
77 ret = exp->openfile(src);
81 qDebug("Buffdoc:Finished opening");
84 diff --git a/ButtonPrefs.cpp b/ButtonPrefs.cpp
85 index 762de55..2c4cad7 100644
90 #include <qwhatsthis.h>
91 #include <qbuttongroup.h>
92 -#include <qmultilineedit.h>
93 +#include <Qt3Support/Q3MultiLineEdit>
95 #include <qcombobox.h>
98 #include <qfontdatabase.h>
100 #include <qlistview.h>
101 +#include <Qt3Support/Q3ListViewItem>
102 +#include <QtGui/QKeyEvent>
104 -class MyQListViewItem : public QListViewItem
105 +class MyQListViewItem : public Q3ListViewItem
109 - MyQListViewItem(const orKey& _o, QListView* p, const QString& c1, const QString& c2, const QString& c3) : QListViewItem(p, c1, c2, c3), o(_o) { }
110 + MyQListViewItem(const orKey& _o, Q3ListView* p, const QString& c1, const QString& c2, const QString& c3) : Q3ListViewItem(p, c1, c2, c3), o(_o) { }
111 orKey getKey() { return o; }
114 @@ -43,7 +45,7 @@ void CButtonPrefs::mapkey(Qt::ButtonState st, int _key)
115 void CButtonPrefs::mapkey(Qt::ButtonState st, int _key, int act)
117 orKey key(st, _key, ((act == cesScrollMore) || (act == cesScrollLess)));
118 - QMap<orKey,QListViewItem*>::Iterator iter = listmap.find(key);
119 + QMap<orKey,Q3ListViewItem*>::Iterator iter = listmap.find(key);
120 if (iter != listmap.end())
122 lb->takeItem(iter.data());
123 @@ -112,7 +114,7 @@ CButtonPrefs::CButtonPrefs( QMap<orKey, int>* _kmap, QWidget* parent, const cha
125 QVBoxLayout* vo = new QVBoxLayout(this);
126 QHBoxLayout* lo = new QHBoxLayout();
127 - setFocusPolicy(QWidget::StrongFocus);
128 + setFocusPolicy(Qt::StrongFocus);
130 action = new QComboBox( this );
132 @@ -123,17 +125,17 @@ CButtonPrefs::CButtonPrefs( QMap<orKey, int>* _kmap, QWidget* parent, const cha
136 - QMultiLineEdit* TextLabel1 = new QMultiLineEdit( this );
137 + Q3MultiLineEdit* TextLabel1 = new Q3MultiLineEdit( this );
138 TextLabel1->setText( tr( "Press the key(s) you want assigned to the highlighted function.\n\nPress the delete button to unmap the key.\n\nUse the \"Close\" button (not the [x]) to finish." ) );
139 TextLabel1->setReadOnly(true);
140 - TextLabel1->setWordWrap(QMultiLineEdit::WidgetWidth);
141 + TextLabel1->setWordWrap(Q3MultiLineEdit::WidgetWidth);
143 // lo->addWidget(TextLabel, 0, Qt::AlignTop);
144 // lo->addWidget(action, 0, Qt::AlignTop);
145 lo->addWidget(TextLabel1);
146 lo->addWidget(action);
148 - lb = new QListView(this);
149 + lb = new Q3ListView(this);
150 lb->addColumn( tr( "Key" ) );
151 lb->addColumn( tr( "Function" ) );
152 lb->addColumn( tr( "Scroll" ) );
153 diff --git a/ButtonPrefs.h b/ButtonPrefs.h
154 index 9af04e1..f09ad02 100644
159 #include <qvariant.h>
161 -#include <qtabdialog.h>
162 +#include <Qt3Support/Q3TabDialog>
163 #include <qtabwidget.h>
164 #include <qspinbox.h>
165 #include <qcheckbox.h>
166 #include <qlineedit.h>
167 +#include <qnamespace.h>
172 @@ -33,18 +35,18 @@ class QGridLayout;
176 -class QListViewItem;
177 +class Q3ListViewItem;
180 -class QListViewItem;
182 +class Q3ListViewItem;
184 class CButtonPrefs : public QWidget
188 QMap<orKey, int> *kmap;
189 - QMap<orKey, QListViewItem*> listmap;
191 + QMap<orKey, Q3ListViewItem*> listmap;
193 void keyPressEvent(QKeyEvent* e);
195 void populate(QComboBox*);
196 diff --git a/CAnnoEdit.cpp b/CAnnoEdit.cpp
197 index 35821ed..6ee1321 100644
200 @@ -83,8 +83,8 @@ CAnnoEdit::CAnnoEdit(QWidget *parent, const char *name, WFlags f) :
202 QVBoxLayout* grid = new QVBoxLayout(this);
203 m_name = new QLineEdit(this, "Name");
204 - m_anno = new QMultiLineEdit(this, "Annotation");
205 - m_anno->setWordWrap(QMultiLineEdit::WidgetWidth);
206 + m_anno = new Q3MultiLineEdit(this, "Annotation");
207 + m_anno->setWordWrap(Q3MultiLineEdit::WidgetWidth);
208 QPushButton* exitButton = new QPushButton("Okay", this);
209 connect(exitButton, SIGNAL( clicked() ), this, SLOT( slotOkay() ) );
210 QPushButton* cancelButton = new QPushButton("Cancel", this);
211 diff --git a/CAnnoEdit.h b/CAnnoEdit.h
212 index 78d3eeb..c74c560 100644
217 #include <qpushbutton.h>
218 #include <qlineedit.h>
219 -#include <qmultilineedit.h>
220 +#include <Qt3Support/Q3MultiLineEdit>
221 #include <qcombobox.h>
222 +#include <qnamespace.h>
225 class CAnnoEdit : public QWidget
230 - QMultiLineEdit* m_anno;
231 + Q3MultiLineEdit* m_anno;
232 size_t m_posn, m_posn2;
235 diff --git a/CFilter.cpp b/CFilter.cpp
236 index a4ea60a..84fa451 100644
240 #include "CDrawBuffer.h"
243 +#include "uqtcommon.h"
247 @@ -665,17 +666,8 @@ class ErrorFilter : public CFilter
249 ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NULL), handle(NULL)
253 - QString filterpath(getenv("OPIEDIR"));
255 - QString filterpath(getenv("QTDIR"));
257 - filterpath += "/plugins/reader/filters/lib";
259 - QString filterpath(getenv("READERDIR"));
260 - filterpath += "/filters/lib";
262 + QString filterpath = uqt_filterspath();
263 + filterpath += "lib";
266 if (QFile::exists(filterpath))
267 diff --git a/CHM.cpp b/CHM.cpp
268 index ace5abc..3c325bb 100644
271 @@ -335,7 +335,7 @@ int CHM::getch() {
273 QChar letter = chmBuffer[bufpos++];
275 - return (int)(char)letter;
276 + return letter.unicode();
279 void CHM::getch(tchar& ch, CStyle& sty)
280 diff --git a/CloseDialog.cpp b/CloseDialog.cpp
281 index 741fa67..62ae906 100644
282 --- a/CloseDialog.cpp
283 +++ b/CloseDialog.cpp
284 @@ -5,7 +5,7 @@ CCloseDialog::CCloseDialog(const QString& fname, bool fs, QWidget* parent, const
286 setCaption(tr("Tidy-up"));
287 QVBoxLayout *tmp = new QVBoxLayout(this);
288 - QVButtonGroup* vb = new QVButtonGroup(tr("Delete"), this);
289 + Q3VButtonGroup* vb = new Q3VButtonGroup(tr("Delete"), this);
291 QString filestring = tr("Delete") + " " + fname;
292 file = new QCheckBox(filestring, vb);
293 diff --git a/CloseDialog.h b/CloseDialog.h
294 index 54aaf1c..84609f5 100644
299 #include <qvariant.h>
301 -#include <qtabdialog.h>
302 +#include <Qt3Support/Q3TabDialog>
303 #include <qtabwidget.h>
304 #include <qspinbox.h>
305 #include <qcheckbox.h>
306 #include <qcombobox.h>
307 #include <qlineedit.h>
308 //#include <qpe/menubutton.h>
309 -#include <qvbuttongroup.h>
310 +#include <Qt3Support/Q3VButtonGroup>
311 +#include <QtGui/QKeyEvent>
312 +#include <qnamespace.h>
317 diff --git a/FontControl.cpp b/FontControl.cpp
318 index 08b8c52..0be54ba 100644
319 --- a/FontControl.cpp
320 +++ b/FontControl.cpp
322 #include <qfontdatabase.h>
323 +#include <Qt3Support/Q3ValueList>
325 #include "FontControl.h"
327 @@ -33,9 +34,9 @@ int FontControl::gzoom()
329 bool FontControl::ChangeFont(QString& n, int tgt)
331 - QValueList<int>::Iterator it;
332 + Q3ValueList<int>::Iterator it;
334 - QValueList<int> sizes = fdb.pointSizes(n);
335 + Q3ValueList<int> sizes = fdb.pointSizes(n);
336 if (sizes.count() == 0)
339 @@ -65,3 +66,25 @@ bool FontControl::ChangeFont(QString& n, int tgt)
344 +void FontControl::setCourier() {
345 + setCourier(m_fontname);
347 +void FontControl::setCourier(const QString fn) {
349 + QStringList fl = fdb.families();
352 +void FontControl::setCourier(const QString fn,const QStringList fl) {
354 + int sp = fn.indexOf(' ');
355 + if(sp>=0) fp = fn.left(sp);
356 + for(QStringList::const_iterator i=fl.begin();i!=fl.end();++i) {
358 + ( i->startsWith(fn,Qt::CaseInsensitive)
359 + || ( (!fp.isEmpty()) && i->startsWith(fp,Qt::CaseInsensitive) ) )
360 + && ( i->endsWith("mono",Qt::CaseInsensitive)
361 + || i->endsWith("Fixed") ) )
362 + hasCourier(true,*i);
365 diff --git a/FontControl.h b/FontControl.h
366 index 563e1a8..c7a54ab 100644
370 #define __FONTCONTROL_H
372 #include <qfontmetrics.h>
373 +#include <QFontDatabase>
374 #include "StyleConsts.h"
377 @@ -32,6 +33,7 @@ class FontControl
378 m_fontsizes(NULL), m_hasCourier(false), m_leading(0), m_extraspace(0), m_fixgraphics(true)
385 @@ -167,6 +169,10 @@ class FontControl
391 + void setCourier(const QString fn);
392 + void setCourier(const QString fn,const QStringList fl);
396 diff --git a/GraphicWin.h b/GraphicWin.h
397 index 70d5f7e..a6c556a 100644
401 #ifndef __GRAPHICWIN_H
402 #define __GRAPHICWIN_H
404 -#include <qscrollview.h>
405 +#include <Qt3Support/Q3ScrollView>
408 #include <qpushbutton.h>
410 #include <qwmatrix.h>
411 +#include <qnamespace.h>
414 -class GraphicScroll : public QScrollView
415 +class GraphicScroll : public Q3ScrollView
419 @@ -19,7 +21,7 @@ class GraphicScroll : public QScrollView
422 GraphicScroll( QWidget *parent=0, const char *name=0, WFlags f = 0)
423 - : QScrollView(parent, name, f)
424 + : Q3ScrollView(parent, name, f)
426 m_picture = new QWidget(viewport());
428 diff --git a/Prefs.cpp b/Prefs.cpp
429 index 6c4d45b..d20dc00 100644
433 ** WARNING! All changes made in this file will be lost!
434 ****************************************************************************/
436 +#include "uqtcommon.h"
441 #include <qpe/menubutton.h>
443 #include <qfontdatabase.h>
444 +#include <Qt3Support/Q3ButtonGroup>
447 void populate_colours(QComboBox *mb)
448 @@ -58,7 +60,7 @@ CLayoutPrefs::CLayoutPrefs( QWidget* parent, const char* name, WFlags fl )
449 : QWidget( parent, name, fl )
451 QHBoxLayout* hb = new QHBoxLayout(this);
452 - QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Text", this);
453 + Q3ButtonGroup* bg = new Q3ButtonGroup(2, Qt::Horizontal, "Text", this);
456 StripCR = new QCheckBox( bg );
457 @@ -592,7 +594,7 @@ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl )
461 - QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Select Action", this);
462 + Q3GroupBox* gb = new Q3GroupBox(1, Qt::Horizontal, "Select Action", this);
465 annotation = new QCheckBox( gb );
466 @@ -607,7 +609,7 @@ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl )
467 boutput = new QCheckBox( gb );
468 boutput->setText( tr( "Output" ) );
470 - QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Plucker", this);
471 + Q3ButtonGroup* bg = new Q3ButtonGroup(1, Qt::Horizontal, "Plucker", this);
474 Depluck = new QCheckBox( bg );
475 @@ -618,7 +620,7 @@ CMiscPrefs::CMiscPrefs( QWidget* parent, const char* name, WFlags fl )
477 Continuous = new QCheckBox( bg );
478 Continuous->setText( tr( "Continuous" ) );
479 - bg = new QButtonGroup(2, Qt::Horizontal, "Background", this);
480 + bg = new Q3ButtonGroup(2, Qt::Horizontal, "Background", this);
483 // QLabel* TextLabel = new QLabel( bg );
484 @@ -662,7 +664,7 @@ CScrollPrefs::CScrollPrefs( QWidget* parent, const char* name, WFlags fl )
488 - QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Scroll", this);
489 + Q3ButtonGroup* bg = new Q3ButtonGroup(2, Qt::Horizontal, "Scroll", this);
492 // scrollinplace = new QCheckBox( bg );
493 @@ -707,18 +709,8 @@ CScrollPrefs::CScrollPrefs( QWidget* parent, const char* name, WFlags fl )
495 outcodec = new MenuButton( this);
499 - QString codecpath(getenv("OPIEDIR"));
501 - QString codecpath(getenv("QTDIR"));
503 - codecpath += "/plugins/reader/outcodecs";
505 - QString codecpath(getenv("READERDIR"));
506 - codecpath += "/outcodecs";
508 - QDir ocd(codecpath, "lib*.so");
509 + QString codecpath = uqt_outcodecspath();
510 + QDir ocd(uqt_outcodecspath(), "lib*.so");
511 for (int i = 0; i < ocd.count(); ++i)
514 @@ -772,7 +764,7 @@ CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl )
516 QHBoxLayout* hb = new QHBoxLayout(this);
518 - QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("International"), this);
519 + Q3GroupBox* gb = new Q3GroupBox(1, Qt::Horizontal, tr("International"), this);
523 @@ -784,7 +776,7 @@ CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl )
524 TextLabel = new QLabel( gb );
525 TextLabel->setText( tr( "Ideogram Width" ) );
526 ideogramwidth = new QSpinBox( gb );
527 - ideogramwidth->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
528 + // ideogramwidth->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
529 ideogramwidth->setRange(1,200);
531 propfontchange = new QCheckBox( gb );
532 @@ -809,7 +801,7 @@ CInterPrefs::CInterPrefs( QWidget* parent, const char* name, WFlags fl )
534 QVBoxLayout* vb = new QVBoxLayout;
536 - gb = new QGroupBox(1, Qt::Horizontal, "Dictionary", this);
537 + gb = new Q3GroupBox(1, Qt::Horizontal, "Dictionary", this);
539 TextLabel = new QLabel( gb );
540 TextLabel->setText( tr( "Application" ) );
541 diff --git a/Prefs.h b/Prefs.h
542 index 103484e..a499506 100644
547 #include <qvariant.h>
549 -#include <qtabdialog.h>
550 +#include <Qt3Support/Q3TabDialog>
551 #include <qtabwidget.h>
552 #include <qspinbox.h>
553 #include <qcheckbox.h>
554 #include <qlineedit.h>
555 +#include <qnamespace.h>
557 +#include <QtGui/QKeyEvent>
561 diff --git a/QFloatBar.h b/QFloatBar.h
562 index cc98233..0144fce 100644
566 #ifndef __QFLOATBAR_H
567 #define __QFLOATBAR_H
569 -#include <qtoolbar.h>
570 -#include <qmainwindow.h>
571 +#include <Qt3Support/Q3ToolBar>
572 +#include <Qt3Support/Q3MainWindow>
573 +#include <qnamespace.h>
575 -class QFloatBar : public QToolBar
576 +class QFloatBar : public Q3ToolBar
579 virtual void hideEvent(QHideEvent* e)
580 @@ -12,7 +13,7 @@ class QFloatBar : public QToolBar
581 /*if (e->spontaneous())*/ emit OnHide();
584 - QFloatBar(char* t, QMainWindow* mw, QMainWindow::ToolBarDock td, bool f) : QToolBar(t, mw, td, f) {}
585 + QFloatBar(char* t, Q3MainWindow* mw, Qt::ToolBarDock td, bool f) : Q3ToolBar(t, mw, td, f) {}
589 diff --git a/QTReader.cpp b/QTReader.cpp
590 index 75da8ac..2c698ba 100644
593 @@ -1999,6 +1999,7 @@ void QTReader::drawFonts()
601 @@ -2221,7 +2222,7 @@ void QTReader::init()
602 setBackgroundColor( m_bg );
603 buffdoc.setfilter(getfilter());
604 ChangeFont(m_textsize);
605 - setFocusPolicy(QWidget::StrongFocus);
606 + setFocusPolicy(Qt::StrongFocus);
607 timer = new QTimer(this);
608 connect(timer, SIGNAL(timeout()), this, SLOT(doscroll()));
610 @@ -3096,7 +3097,7 @@ void QTReader::blitRot(int dx, int dy, int sw, int sh, CDrawBuffer* txt)
614 - QPainter pd(&pm, this);
615 + QPainter pd(&pm); // , this);
618 pd.eraseRect(pm.rect());
619 @@ -3136,7 +3137,7 @@ void QTReader::blitRot(int dx, int dy, int sw, int sh, CDrawBuffer* txt)
621 p.drawPixmap(QPoint(dx, dy), rp);
623 - bitBlt(this, dx, dy, &rp, 0, 0, -1, -1, CopyROP);
624 + bitBlt(this, dx, dy, &rp, 0, 0, -1, -1, QPainter::CompositionMode_Source);
627 QString QTReader::about()
628 diff --git a/QTReader.h b/QTReader.h
629 index 9daa07a..6afa3e7 100644
634 #include "FontControl.h"
636 +#include <qnamespace.h>
639 //#include <qtimer.h>
642 diff --git a/QTReaderApp.cpp b/QTReaderApp.cpp
643 index b985094..529ec9e 100644
644 --- a/QTReaderApp.cpp
645 +++ b/QTReaderApp.cpp
649 #include <qclipboard.h>
650 -#include <qwidgetstack.h>
651 +#include <QStackedWidget>
652 +#include <Qt3Support/Q3Action>
653 +#include <qdesktopwidget.h>
655 #include <qpe/qpemenubar.h>
656 #include <qpe/qpetoolbar.h>
658 #include <qpe/menubutton.h>
660 #include <qcombobox.h>
661 -#include <qpopupmenu.h>
662 +#include <Qt3Support/Q3PopupMenu>
664 #include <qapplication.h>
665 #include <qlineedit.h>
666 #include <qtoolbutton.h>
667 #include <qspinbox.h>
668 -#include <qobjectlist.h>
669 #include <qstatusbar.h>
671 #include <qpe/global.h>
673 #include "FixedFont.h"
674 #include "URLDialog.h"
676 +#include "uqtcommon.h"
677 #include <qfontdatabase.h>
680 @@ -103,18 +105,10 @@ bool CheckVersion(int&, int&, char&, QWidget*);
682 #define PICDIR "opie-reader/"
684 -//#define PICDIR "/home/tim/uqtreader/pics/"
687 - QString hd(getenv("READERDIR"));
688 - return hd + "/pics";
690 -#define PICDIR picdir()
691 +#define PICDIR uqt_picspath()
695 -unsigned long QTReaderApp::m_uid = 0;
697 void QTReaderApp::setScrollState(bool _b) { m_scrollButton->setOn(_b); }
700 @@ -156,16 +150,9 @@ void QTReaderApp::listBkmkFiles()
701 d.setFilter( QDir::Files | QDir::NoSymLinks );
702 // d.setSorting( QDir::Size | QDir::Reversed );
704 - const QFileInfoList *list = d.entryInfoList();
705 - QFileInfoListIterator it( *list ); // create list iterator
706 - QFileInfo *fi; // pointer for traversing
707 - while ( (fi=it.current()) ) { // for each file...
709 - bkmkselector->insertItem(fi->fileName(), cnt++);
711 - //qDebug( "%10li %s", fi->size(), fi->fileName().data() );
712 - ++it; // goto next list element
714 + QFileInfoList list = d.entryInfoList();
715 + for(QFileInfoListIterator it=list.begin();it!=list.end();++it)
716 + bkmkselector->insertItem(it->fileName(), cnt++);
720 @@ -192,7 +179,7 @@ void QTReaderApp::listBkmkFiles()
724 - editorStack->raiseWidget( bkmkselector );
725 + editorStack->setCurrentWidget( bkmkselector );
727 m_nBkmkAction = cRmBkmkFile;
729 @@ -207,6 +194,8 @@ void QTReaderApp::hidetoolbars()
737 if (m_scrollbar != NULL) m_scrollbar->hide();
738 @@ -233,7 +222,7 @@ void QTReaderApp::hidetoolbars()
741 QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
742 - : QMainWindow( parent, name, f ), m_dontSave(false),
743 + : Q3MainWindow( parent, name, f ), m_dontSave(false),
744 fileBar(NULL), navBar(NULL), viewBar(NULL), markBar(NULL), m_scrollbar(NULL), m_localscroll(2), m_hidebars(false), m_kmapchanged(false)
747 @@ -337,41 +326,41 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
748 // QToolBar* markBar = new QToolBar("File", this);
751 - menubar = new QToolBar("Menus", this, m_tbposition);
752 + menubar = new Q3ToolBar("Menus", this, m_tbposition);
753 mb = new QPEMenuBar( menubar );
755 mb = new QMenuBar( this );
759 - QPopupMenu* tmp = new QPopupMenu(mb);
760 + Q3PopupMenu* tmp = new Q3PopupMenu(mb);
761 mb->insertItem( geticon( "AppsIcon" ), tmp );
766 - QPopupMenu *file = new QPopupMenu( mb );
767 + Q3PopupMenu *file = new Q3PopupMenu( mb );
768 tmp->insertItem( tr( "File" ), file );
770 - QPopupMenu *navigation = new QPopupMenu(mb);
771 + Q3PopupMenu *navigation = new Q3PopupMenu(mb);
772 tmp->insertItem( tr( "Navigation" ), navigation );
774 - QPopupMenu *view = new QPopupMenu( mb );
775 + Q3PopupMenu *view = new Q3PopupMenu( mb );
776 tmp->insertItem( tr( "View" ), view );
778 - QPopupMenu *marks = new QPopupMenu( this );
779 + Q3PopupMenu *marks = new Q3PopupMenu( this );
780 tmp->insertItem( tr( "Marks" ), marks );
782 - QPopupMenu *settings = new QPopupMenu( this );
783 + Q3PopupMenu *settings = new Q3PopupMenu( this );
784 tmp->insertItem( tr( "Settings" ), settings );
786 // addToolBar(menubar, "Menus",QMainWindow::Top);
787 // addToolBar(fileBar, "Toolbar",QMainWindow::Top);
789 - // QPopupMenu *edit = new QPopupMenu( this );
790 + // Q3PopupMenu *edit = new Q3PopupMenu( this );
793 - QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
794 + Q3Action *a = new Q3Action( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
795 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
798 @@ -379,34 +368,35 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
799 QWidget* widge = new QWidget(this);
800 setCentralWidget( widge );
801 QVBoxLayout* vlayout = new QVBoxLayout(widge);
802 + vlayout->setMargin(0);
803 m_layout = new QBoxLayout(QBoxLayout::LeftToRight);
804 m_prog = new QLabel(widge);
805 vlayout->addLayout(m_layout, 1);
806 vlayout->addWidget(m_prog);
808 - editorStack = new QWidgetStack( widge );
809 + editorStack = new QStackedWidget( widge );
810 // setCentralWidget( editorStack );
812 searchVisible = FALSE;
814 m_fontVisible = false;
816 - m_buttonprefs = new CButtonPrefs(&kmap, this);
817 - editorStack->addWidget(m_buttonprefs, get_unique_id());
818 + m_buttonprefs = new CButtonPrefs(&kmap, editorStack);
819 + editorStack->addWidget(m_buttonprefs);
820 connect( m_buttonprefs, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
823 m_annoWin = new CAnnoEdit(editorStack);
824 - editorStack->addWidget(m_annoWin, get_unique_id());
825 + editorStack->addWidget(m_annoWin);
826 connect( m_annoWin, SIGNAL( finished(const QString&, const QString&) ), this, SLOT( addAnno(const QString&, const QString&) ) );
827 connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) );
829 m_infoWin = new infowin(editorStack);
830 - editorStack->addWidget(m_infoWin, get_unique_id());
831 + editorStack->addWidget(m_infoWin);
832 connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) );
834 m_graphicwin = new GraphicWin(editorStack);
835 - editorStack->addWidget(m_graphicwin, get_unique_id());
836 + editorStack->addWidget(m_graphicwin);
837 connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
839 // bkmkselector = new QListBox(editorStack, "Bookmarks");
840 @@ -414,7 +404,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
841 // connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) );
842 connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) );
843 connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) );
844 - editorStack->addWidget( bkmkselector, get_unique_id() );
845 + editorStack->addWidget( bkmkselector);
848 importSelector = new FileSelector( "*", editorStack, "importselector", false );
849 @@ -572,139 +562,139 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
850 connect( reader, SIGNAL( HandleKeyRequest(QKeyEvent*) ), this, SLOT( handlekey(QKeyEvent*) ) );
851 connect( reader, SIGNAL( SetScrollState(bool) ), this, SLOT( setScrollState(bool) ) );
852 connect( reader, SIGNAL(RefreshBitmap()), this, SLOT(setBackgroundBitmap()));
853 - editorStack->addWidget( reader, get_unique_id() );
854 + editorStack->addWidget( reader );
856 - m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL);
857 + m_preferences_action = new Q3Action( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL);
858 connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) );
859 m_preferences_action->addTo( settings );
861 - m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL);
862 + m_saveconfig_action = new Q3Action( tr( "Save Config" ), QString::null, 0, this, NULL);
863 connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) );
864 m_saveconfig_action->addTo( settings );
866 - m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL);
867 + m_loadconfig_action = new Q3Action( tr( "Load Config" ), QString::null, 0, this, NULL);
868 connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) );
869 m_loadconfig_action->addTo( settings );
871 - m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL);
872 + m_tidyconfig_action = new Q3Action( tr( "Delete Config" ), QString::null, 0, this, NULL);
873 connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) );
874 m_tidyconfig_action->addTo( settings );
876 settings->insertSeparator();
877 - m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL);
878 + m_toolbarprefs_action = new Q3Action( tr( "Toolbars" ), QString::null, 0, this, NULL);
879 connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) );
880 m_toolbarprefs_action->addTo( settings );
882 - m_buttonprefs_action = new QAction( tr( "Buttons" ), QString::null, 0, this, NULL);
883 + m_buttonprefs_action = new Q3Action( tr( "Buttons" ), QString::null, 0, this, NULL);
884 connect( m_buttonprefs_action, SIGNAL( activated() ), this, SLOT( showbuttonprefs() ) );
885 m_buttonprefs_action->addTo( settings );
887 - m_loadtheme_action = new QAction( tr( "Load Theme" ), QString::null, 0, this, NULL);
888 + m_loadtheme_action = new Q3Action( tr( "Load Theme" ), QString::null, 0, this, NULL);
889 connect( m_loadtheme_action, SIGNAL( activated() ), this, SLOT( LoadTheme() ) );
890 m_loadtheme_action->addTo( settings );
892 - m_repara_action = new QAction( tr( "EOP Marker" ), QString::null, 0, this, NULL);
893 + m_repara_action = new Q3Action( tr( "EOP Marker" ), QString::null, 0, this, NULL);
894 connect( m_repara_action, SIGNAL( activated() ), this, SLOT( reparastring() ) );
895 m_repara_action->addTo(settings);
898 - m_grab_action = new QAction( tr( "Grab Buttons" ), QString::null, 0, this, NULL, true );
899 + m_grab_action = new Q3Action( tr( "Grab Buttons" ), QString::null, 0, this, NULL, true );
900 connect( m_grab_action, SIGNAL( toggled(bool) ), this, SLOT( setgrab(bool) ) );
901 m_grab_action->setOn(m_grabkeyboard);
902 m_grab_action->addTo( settings );
905 - m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 );
906 + m_open_action = new Q3Action( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 );
907 connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
908 m_open_action->addTo( file );
910 - m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 );
911 + m_close_action = new Q3Action( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 );
912 connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) );
913 m_close_action->addTo( file );
916 - a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL);
917 + a = new Q3Action( tr( "Run Script" ), QString::null, 0, this, NULL);
918 connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) );
922 - a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 );
923 + a = new Q3Action( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 );
924 connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
927 - a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 );
928 + a = new Q3Action( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 );
929 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
930 a->addTo( filebar() );
934 - m_info_action = new QAction( tr( "Info" ), geticon( "UtilsIcon" ), QString::null, 0, this, NULL);
935 + m_info_action = new Q3Action( tr( "Info" ), geticon( "UtilsIcon" ), QString::null, 0, this, NULL);
936 connect( m_info_action, SIGNAL( activated() ), this, SLOT( showinfo() ) );
937 m_info_action->addTo( file );
939 - m_touch_action = new QAction( tr( "Two/One Touch" ), geticon( "1to1" ), QString::null, 0, this, NULL, true );
940 + m_touch_action = new Q3Action( tr( "Two/One Touch" ), geticon( "1to1" ), QString::null, 0, this, NULL, true );
941 connect( m_touch_action, SIGNAL( toggled(bool) ), this, SLOT( setTwoTouch(bool) ) );
942 m_touch_action->setOn(m_twoTouch);
943 m_touch_action->addTo( file );
945 - m_find_action = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, NULL);
946 + m_find_action = new Q3Action( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, NULL);
947 connect( m_find_action, SIGNAL( activated() ), this, SLOT( editFind() ) );
948 file->insertSeparator();
950 m_find_action->addTo( file );
952 - m_exportlinks_action = new QAction( tr( "Export Links" ), QString::null, 0, this, NULL);
953 + m_exportlinks_action = new Q3Action( tr( "Export Links" ), QString::null, 0, this, NULL);
954 connect( m_exportlinks_action, SIGNAL( activated() ), this, SLOT( ExportLinks() ) );
955 m_exportlinks_action->addTo( file );
957 - m_scrollButton = new QAction( tr( "Scroll" ), getmyicon( "panel-arrow-down" ), QString::null, 0, this, 0, true );
958 + m_scrollButton = new Q3Action( tr( "Scroll" ), getmyicon( "panel-arrow-down" ), QString::null, 0, this, 0, true );
959 connect( m_scrollButton, SIGNAL( toggled(bool) ), this, SLOT( autoScroll(bool) ) );
960 m_scrollButton->addTo(navigation);
961 m_scrollButton->setOn(false);
963 - m_start_action = new QAction( tr( "Goto Start" ), geticon( "start" ), QString::null, 0, this, NULL);
964 + m_start_action = new Q3Action( tr( "Goto Start" ), geticon( "start" ), QString::null, 0, this, NULL);
965 connect( m_start_action, SIGNAL( activated() ), this, SLOT( gotoStart() ) );
966 m_start_action->addTo(navigation);
968 - m_end_action = new QAction( tr( "Goto End" ), geticon( "finish" ), QString::null, 0, this, NULL);
969 + m_end_action = new Q3Action( tr( "Goto End" ), geticon( "finish" ), QString::null, 0, this, NULL);
970 connect( m_end_action, SIGNAL( activated() ), this, SLOT( gotoEnd() ) );
971 m_end_action->addTo(navigation);
973 - m_jump_action = new QAction( tr( "Jump" ), geticon( "rotate" ), QString::null, 0, this, NULL);
974 + m_jump_action = new Q3Action( tr( "Jump" ), geticon( "rotate" ), QString::null, 0, this, NULL);
975 connect( m_jump_action, SIGNAL( activated() ), this, SLOT( jump() ) );
976 m_jump_action->addTo(navigation);
978 - m_pageline_action = new QAction( tr( "Page/Line Scroll" ), geticon( "pass" ), QString::null, 0, this, NULL, true );
979 + m_pageline_action = new Q3Action( tr( "Page/Line Scroll" ), geticon( "pass" ), QString::null, 0, this, NULL, true );
980 connect( m_pageline_action, SIGNAL( toggled(bool) ), this, SLOT( pagemode(bool) ) );
981 m_pageline_action->addTo(navigation);
982 m_pageline_action->setOn(reader->m_bpagemode);
984 - m_pageup_action = new QAction( tr( "Up" ), geticon( "up" ), QString::null, 0, this, 0 );
985 + m_pageup_action = new Q3Action( tr( "Up" ), geticon( "up" ), QString::null, 0, this, 0 );
986 connect( m_pageup_action, SIGNAL( activated() ), this, SLOT( pageup() ) );
987 m_pageup_action->addTo( navigation );
989 - m_pagedn_action = new QAction( tr( "Down" ), geticon( "down" ), QString::null, 0, this, 0 );
990 + m_pagedn_action = new Q3Action( tr( "Down" ), geticon( "down" ), QString::null, 0, this, 0 );
991 connect( m_pagedn_action, SIGNAL( activated() ), this, SLOT( pagedn() ) );
992 m_pagedn_action->addTo( navigation );
994 - m_back_action = new QAction( tr( "Back" ), geticon( "back" ), QString::null, 0, this, 0 );
995 + m_back_action = new Q3Action( tr( "Back" ), geticon( "back" ), QString::null, 0, this, 0 );
996 connect( m_back_action, SIGNAL( activated() ), reader, SLOT( goBack() ) );
997 m_back_action->addTo( navigation );
999 - m_home_action = new QAction( tr( "Home" ), geticon( "home" ), QString::null, 0, this, 0 );
1000 + m_home_action = new Q3Action( tr( "Home" ), geticon( "home" ), QString::null, 0, this, 0 );
1001 connect( m_home_action, SIGNAL( activated() ), reader, SLOT( goHome() ) );
1002 m_home_action->addTo( navigation );
1004 - m_forward_action = new QAction( tr( "Forward" ), geticon( "forward" ), QString::null, 0, this, 0 );
1005 + m_forward_action = new Q3Action( tr( "Forward" ), geticon( "forward" ), QString::null, 0, this, 0 );
1006 connect( m_forward_action, SIGNAL( activated() ), reader, SLOT( goForward() ) );
1007 m_forward_action->addTo( navigation );
1010 - a = new QAction( tr( "Find" ), QString::null, 0, this, NULL, true );
1011 + a = new Q3Action( tr( "Find" ), QString::null, 0, this, NULL, true );
1012 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
1015 - a = new QAction( tr( "Find Again" ), QString::null, 0, this, NULL, true );
1016 + a = new Q3Action( tr( "Find Again" ), QString::null, 0, this, NULL, true );
1017 // connect( a, SIGNAL( activated() ), this, SLOT( pagedn() ) );
1020 @@ -715,13 +705,13 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1022 QActionGroup* ag = new QActionGroup(this);
1023 ag->setExclusive(false);
1024 - spacemenu = new QPopupMenu(this);
1025 + spacemenu = new Q3PopupMenu(this);
1026 file->insertItem( tr( "Scrolling" ), spacemenu );
1028 - a = new QAction( tr( "Set Target" ), QString::null, 0, ag, NULL);
1029 + a = new Q3Action( tr( "Set Target" ), QString::null, 0, ag, NULL);
1030 connect( a, SIGNAL( activated() ), this, SLOT( setpipetarget() ) );
1032 - a = new QAction( tr( "Pause Paras" ), QString::null, 0, ag, NULL, true );
1033 + a = new Q3Action( tr( "Pause Paras" ), QString::null, 0, ag, NULL, true );
1034 connect( a, SIGNAL( toggled(bool) ), this, SLOT( setpause(bool) ) );
1035 a->setOn(reader->m_pauseAfterEachPara);
1037 @@ -731,64 +721,64 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1041 - a = new QAction( tr( "Import" ), QString::null, 0, this, NULL );
1042 + a = new Q3Action( tr( "Import" ), QString::null, 0, this, NULL );
1043 connect( a, SIGNAL( activated() ), this, SLOT( importFiles() ) );
1048 - a = new QAction( tr( "Paste" ), geticon( "paste" ), QString::null, 0, this, 0 );
1049 + a = new Q3Action( tr( "Paste" ), geticon( "paste" ), QString::null, 0, this, 0 );
1050 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
1051 a->addTo( fileBar );
1055 -// a = new QAction( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, 0 );
1056 +// a = new Q3Action( tr( "Find..." ), geticon( "find" ), QString::null, 0, this, 0 );
1058 m_fullscreen = false;
1059 - m_actFullscreen = new QAction( tr( "Fullscreen" ), geticon( "fullscreen" ), QString::null, 0, this, NULL, true );
1060 + m_actFullscreen = new Q3Action( tr( "Fullscreen" ), geticon( "fullscreen" ), QString::null, 0, this, NULL, true );
1061 connect( m_actFullscreen, SIGNAL( toggled(bool) ), this, SLOT( setfullscreen(bool) ) );
1062 m_actFullscreen->setOn(m_fullscreen);
1063 m_actFullscreen->addTo( view );
1065 - m_rotate_action = new QAction( tr( "Rotate" ), geticon( "repeat" ), QString::null, 0, this, NULL, true );
1066 + m_rotate_action = new Q3Action( tr( "Rotate" ), geticon( "repeat" ), QString::null, 0, this, NULL, true );
1067 connect( m_rotate_action, SIGNAL( toggled(bool) ), this, SLOT( setrotated(bool) ) );
1068 m_rotate_action->setOn(reader->m_rotated);
1069 m_rotate_action->addTo( view );
1071 - m_inverse_action = new QAction( tr( "Invert" ), getmyicon( "invert" ), QString::null, 0, this, NULL, true );
1072 + m_inverse_action = new Q3Action( tr( "Invert" ), getmyicon( "invert" ), QString::null, 0, this, NULL, true );
1073 connect( m_inverse_action, SIGNAL( toggled(bool) ), this, SLOT( setinverted(bool) ) );
1074 m_inverse_action->setOn(reader->bInverse);
1075 m_inverse_action->addTo( view );
1077 view->insertSeparator();
1079 - m_zoomin_action = new QAction( tr( "Zoom In" ), geticon( "zoom" ), QString::null, 0, this);
1080 + m_zoomin_action = new Q3Action( tr( "Zoom In" ), geticon( "zoom" ), QString::null, 0, this);
1081 connect( m_zoomin_action, SIGNAL( activated() ), this, SLOT( zoomin() ) );
1082 m_zoomin_action->addTo( view );
1084 - m_zoomout_action = new QAction( tr( "Zoom Out" ), geticon( "mag" ), QString::null, 0, this);
1085 + m_zoomout_action = new Q3Action( tr( "Zoom Out" ), geticon( "mag" ), QString::null, 0, this);
1086 connect( m_zoomout_action, SIGNAL( activated() ), this, SLOT( zoomout() ) );
1087 m_zoomout_action->addTo( view );
1089 view->insertSeparator();
1090 - m_setfont_action = new QAction( tr( "Set Font" ), getmyicon( "font" ), QString::null, 0, this);
1091 + m_setfont_action = new Q3Action( tr( "Set Font" ), getmyicon( "font" ), QString::null, 0, this);
1092 connect( m_setfont_action, SIGNAL( activated() ), this, SLOT( setfont() ) );
1093 m_setfont_action->addTo( view );
1095 view->insertSeparator();
1096 - m_setenc_action = new QAction( tr( "Set Encoding" ), getmyicon( "charset" ), QString::null, 0, this);
1097 + m_setenc_action = new Q3Action( tr( "Set Encoding" ), getmyicon( "charset" ), QString::null, 0, this);
1098 connect( m_setenc_action, SIGNAL( activated() ), this, SLOT( chooseencoding() ) );
1099 m_setenc_action->addTo( view );
1101 - m_setmono_action = new QAction( tr( "Ideogram" ), getmyicon( "ideogram" ), QString::null, 0, this, NULL, true);
1102 + m_setmono_action = new Q3Action( tr( "Ideogram" ), getmyicon( "ideogram" ), QString::null, 0, this, NULL, true);
1103 connect( m_setmono_action, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) );
1104 m_setmono_action->addTo( view );
1105 m_setmono_action->setOn(reader->m_bMonoSpaced);
1108 - // a = new QAction( tr( "Zoom" ), QString::null, 0, this, NULL, true );
1109 - // a = new QAction( tr( "Zoom" ), geticon( "mag" ), QString::null, 0, this, 0 );
1110 + // a = new Q3Action( tr( "Zoom" ), QString::null, 0, this, NULL, true );
1111 + // a = new Q3Action( tr( "Zoom" ), geticon( "mag" ), QString::null, 0, this, 0 );
1115 @@ -796,57 +786,57 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1116 // view->insertSeparator();
1119 - a = new QAction( tr( "Ideogram/Word" ), QString::null, 0, this, NULL, true );
1120 + a = new Q3Action( tr( "Ideogram/Word" ), QString::null, 0, this, NULL, true );
1121 connect( a, SIGNAL( toggled(bool) ), this, SLOT( monospace(bool) ) );
1122 a->setOn(reader->m_bMonoSpaced);
1126 - a = new QAction( tr( "Set Width" ), QString::null, 0, this, NULL);
1127 + a = new Q3Action( tr( "Set Width" ), QString::null, 0, this, NULL);
1128 connect( a, SIGNAL( activated() ), this, SLOT( setspacing() ) );
1132 - m_mark_action = new QAction( tr( "Bookmark" ), getmyicon( "bookmark" ), QString::null, 0, this, NULL);
1133 + m_mark_action = new Q3Action( tr( "Bookmark" ), getmyicon( "bookmark" ), QString::null, 0, this, NULL);
1134 connect( m_mark_action, SIGNAL( activated() ), this, SLOT( addbkmk() ) );
1135 m_mark_action->addTo( marks );
1137 - m_annotate_action = new QAction( tr( "Annotate" ), getmyicon( "annotate" ), QString::null, 0, this, NULL);
1138 + m_annotate_action = new Q3Action( tr( "Annotate" ), getmyicon( "annotate" ), QString::null, 0, this, NULL);
1139 connect( m_annotate_action, SIGNAL( activated() ), this, SLOT( addanno() ) );
1140 m_annotate_action->addTo( marks );
1142 - m_goto_action = new QAction( tr( "Goto" ), getmyicon( "bookmark_goto" ), QString::null, 0, this, NULL, false );
1143 + m_goto_action = new Q3Action( tr( "Goto" ), getmyicon( "bookmark_goto" ), QString::null, 0, this, NULL, false );
1144 connect( m_goto_action, SIGNAL( activated() ), this, SLOT( do_gotomark() ) );
1145 m_goto_action->addTo( marks );
1147 - m_delete_action = new QAction( tr( "Delete" ), getmyicon( "bookmark_delete" ), QString::null, 0, this, NULL);
1148 + m_delete_action = new Q3Action( tr( "Delete" ), getmyicon( "bookmark_delete" ), QString::null, 0, this, NULL);
1149 connect( m_delete_action, SIGNAL( activated() ), this, SLOT( do_delmark() ) );
1150 m_delete_action->addTo( marks );
1152 - m_autogen_action = new QAction( tr( "Autogen" ), geticon( "exec" ), QString::null, 0, this, NULL, false );
1153 + m_autogen_action = new Q3Action( tr( "Autogen" ), geticon( "exec" ), QString::null, 0, this, NULL, false );
1154 connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) );
1155 marks->insertSeparator();
1156 m_autogen_action->addTo( marks );
1158 - m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL);
1159 + m_clear_action = new Q3Action( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL);
1160 connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) );
1161 m_clear_action->addTo( marks );
1163 - m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL );
1164 + m_save_action = new Q3Action( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL );
1165 connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) );
1166 m_save_action->addTo( marks );
1168 - m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL);
1169 + m_tidy_action = new Q3Action( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL);
1170 connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) );
1171 marks->insertSeparator();
1172 m_tidy_action->addTo( marks );
1174 - m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL);
1175 + m_startBlock_action = new Q3Action( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL);
1176 connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) );
1177 marks->insertSeparator();
1178 m_startBlock_action->addTo( marks );
1180 - m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL);
1181 + m_endBlock_action = new Q3Action( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL);
1182 connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) );
1183 m_endBlock_action->addTo( marks );
1185 @@ -868,10 +858,10 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1189 - pbar = new QProgressBar(this);
1190 + pbar = new Q3ProgressBar(this);
1193 - searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE );
1194 + searchBar = new QFloatBar( "Search", this, Qt::Top, TRUE );
1196 searchBar->setHorizontalStretchable( TRUE );
1198 @@ -890,17 +880,17 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1199 connect( searchEdit, SIGNAL( returnPressed( ) ),
1200 this, SLOT( search( ) ) );
1202 - QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 );
1203 + Q3Action*a = new Q3Action( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 );
1204 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
1205 a->addTo( searchBar );
1207 - a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 );
1208 + a = new Q3Action( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 );
1209 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
1210 a->addTo( searchBar );
1214 - regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE );
1215 + regBar = new QFloatBar( "Autogen", this, Qt::Top, TRUE );
1216 connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
1218 regBar->setHorizontalStretchable( TRUE );
1219 @@ -913,17 +903,17 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1220 connect( regEdit, SIGNAL( returnPressed( ) ),
1221 this, SLOT( do_regaction() ) );
1223 - a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 );
1224 + a = new Q3Action( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 );
1225 connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) );
1228 - a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 );
1229 + a = new Q3Action( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 );
1230 connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) );
1235 - m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE );
1236 + m_fontBar = new Q3ToolBar( "Autogen", this, Qt::Top, TRUE );
1238 m_fontBar->setHorizontalStretchable( TRUE );
1240 @@ -940,9 +930,9 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1244 - if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm);
1246 if (!realfont) reader->m_fontname = flist[0];
1247 + reader->m_fontControl.setCourier(reader->m_fontname,flist);
1248 } // delete the FontDatabase!!!
1249 connect( m_fontSelector, SIGNAL( activated(const QString& ) ),
1250 this, SLOT( do_setfont(const QString&) ) );
1251 @@ -965,7 +955,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
1253 m_scrollbar->setVerticalStretchable( TRUE );
1255 - scrollbar = m_scrollbar = new QScrollBar(QScrollBar::Vertical, widge);
1256 + scrollbar = m_scrollbar = new QScrollBar(Qt::Vertical, widge);
1257 m_layout->addWidget(scrollbar);
1258 scrollbar->setTracking(false);
1259 // connect(scrollbar, SIGNAL(sliderMoved(int)), this, SLOT(actionscroll(int)) );
1260 @@ -1226,7 +1216,7 @@ void QTReaderApp::addtoolbars(Config* config)
1262 if (m_bkmkAvail == NULL)
1264 - m_bkmkAvail = new QAction( tr( "Annotation" ), geticon( "find" ), QString::null, 0, this, 0 );
1265 + m_bkmkAvail = new Q3Action( tr( "Annotation" ), geticon( "find" ), QString::null, 0, this, 0 );
1266 connect( m_bkmkAvail, SIGNAL( activated() ), this, SLOT( showAnnotation() ) );
1268 m_bkmkAvail->setEnabled(false);
1269 @@ -1253,7 +1243,7 @@ bool QTReaderApp::checkbar(Config* _config, const QString& key)
1273 -QToolBar* QTReaderApp::filebar()
1274 +Q3ToolBar* QTReaderApp::filebar()
1276 if (fileBar == NULL)
1278 @@ -1270,21 +1260,21 @@ QToolBar* QTReaderApp::filebar()
1281 // qDebug("Creating new file bar");
1282 - fileBar = new QToolBar("File", this, m_tbposition);
1283 + fileBar = new Q3ToolBar("File", this, m_tbposition);
1286 // fileBar->setHorizontalStretchable( true );
1290 -QToolBar* QTReaderApp::viewbar()
1291 +Q3ToolBar* QTReaderApp::viewbar()
1293 if (viewBar == NULL)
1298 - viewBar = new QToolBar("View", this, m_tbposition);
1299 + viewBar = new Q3ToolBar("View", this, m_tbposition);
1302 qDebug("Incorrect toolbar policy set");
1303 @@ -1298,7 +1288,7 @@ QToolBar* QTReaderApp::viewbar()
1307 -QToolBar* QTReaderApp::navbar()
1308 +Q3ToolBar* QTReaderApp::navbar()
1312 @@ -1306,7 +1296,7 @@ QToolBar* QTReaderApp::navbar()
1315 // qDebug("Creating new nav bar");
1316 - navBar = new QToolBar("Navigation", this, m_tbposition);
1317 + navBar = new Q3ToolBar("Navigation", this, m_tbposition);
1320 qDebug("Incorrect toolbar policy set");
1321 @@ -1321,14 +1311,14 @@ QToolBar* QTReaderApp::navbar()
1325 -QToolBar* QTReaderApp::markbar()
1326 +Q3ToolBar* QTReaderApp::markbar()
1328 if (markBar == NULL)
1333 - markBar = new QToolBar("Marks", this, m_tbposition);
1334 + markBar = new Q3ToolBar("Marks", this, m_tbposition);
1337 qDebug("Incorrect toolbar policy set");
1338 @@ -1343,26 +1333,26 @@ QToolBar* QTReaderApp::markbar()
1342 -void QTReaderApp::addfilebar(Config* _config, const QString& key, QAction* a)
1343 +void QTReaderApp::addfilebar(Config* _config, const QString& key, Q3Action* a)
1345 if (_config->readBoolEntry(key, false)) a->addTo( filebar() );
1347 -void QTReaderApp::addnavbar(Config* _config, const QString& key, QAction* a)
1348 +void QTReaderApp::addnavbar(Config* _config, const QString& key, Q3Action* a)
1350 if (_config->readBoolEntry(key, false)) a->addTo( navbar() );
1352 -void QTReaderApp::addmarkbar(Config* _config, const QString& key, QAction* a)
1353 +void QTReaderApp::addmarkbar(Config* _config, const QString& key, Q3Action* a)
1355 if (_config->readBoolEntry(key, false)) a->addTo( markbar() );
1357 -void QTReaderApp::addviewbar(Config* _config, const QString& key, QAction* a)
1358 +void QTReaderApp::addviewbar(Config* _config, const QString& key, Q3Action* a)
1360 if (_config->readBoolEntry(key, false)) a->addTo( viewbar() );
1363 void QTReaderApp::suspend() { reader->suspend(); }
1365 -void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
1366 +void QTReaderApp::msgHandler(const Q3CString& _msg, const QByteArray& _data)
1370 @@ -1787,7 +1777,7 @@ void QTReaderApp::setfullscreen(bool sfs)
1374 -void QTReaderApp::buttonActionSelected(QAction* _a)
1375 +void QTReaderApp::buttonActionSelected(Q3Action* _a)
1377 //// qDebug("es:%x : %s (%u)", _a, (const char *)(_a->text()), ActNameToInt(_a->text()));
1378 m_spaceTarget = ActNameToInt(_a->text());
1379 @@ -2007,14 +1997,14 @@ QString QTReaderApp::usefilebrowser()
1380 void QTReaderApp::showgraphic(QImage& pm)
1382 m_graphicwin->setImage(pm);
1383 - editorStack->raiseWidget( m_graphicwin );
1384 + editorStack->setCurrentWidget( m_graphicwin );
1386 m_graphicwin->setFocus();
1389 void QTReaderApp::showbuttonprefs()
1391 - editorStack->raiseWidget( m_buttonprefs );
1392 + editorStack->setCurrentWidget( m_buttonprefs );
1394 m_buttonprefs->setFocus();
1395 m_kmapchanged = true;
1396 @@ -2366,7 +2356,7 @@ void QTReaderApp::showinfo()
1398 m_infoWin->setZoom(reader->m_fontControl.currentsize()*10);
1399 m_infoWin->setAbout(QString("\nApplication (c) Tim Wentford\n")+reader->about());
1400 - editorStack->raiseWidget( m_infoWin );
1401 + editorStack->setCurrentWidget( m_infoWin );
1403 m_infoWin->setFocus();
1405 @@ -2482,7 +2472,7 @@ void QTReaderApp::addanno()
1406 m_annoWin->setAnno("");
1407 m_annoWin->setPosn(reader->pagelocate());
1408 m_annoIsEditing = true;
1409 - editorStack->raiseWidget( m_annoWin );
1410 + editorStack->setCurrentWidget( m_annoWin );
1413 Global::showInputMethod();
1414 @@ -2658,7 +2648,7 @@ void QTReaderApp::findNext()
1416 QString arg = searchEdit->text();
1418 - QRegExp arg = searchEdit->text();
1419 + QRegExp arg(searchEdit->text());
1421 CDrawBuffer test(&(reader->m_fontControl));
1422 size_t start = reader->pagelocate();
1423 @@ -2722,7 +2712,7 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg)
1424 while (strstr(test.data(),(const tchar*)arg) == NULL)
1427 - while ((offset = arg.match(toQString(test.data()))) == -1)
1428 + while ((offset = arg.exactMatch(toQString(test.data()))) == -1)
1430 while (arg.match(test.data()) == -1)
1432 @@ -2962,7 +2952,7 @@ void QTReaderApp::handlekey(QKeyEvent* e)
1433 #if defined(USEQPE) && defined(USENEWFULLSCREEN)
1434 void QTReaderApp::focusInEvent(QFocusEvent *)
1436 - if (m_usenewfullscreen && m_fullscreen && (editorStack->visibleWidget() == reader))
1437 + if (m_usenewfullscreen && m_fullscreen && (editorStack->currentWidget() == reader))
1439 m_usenewfullscreen = false;
1440 reader->bDoUpdates = false;
1441 @@ -2975,7 +2965,7 @@ void QTReaderApp::focusInEvent(QFocusEvent *)
1443 void QTReaderApp::resizeEvent(QResizeEvent *)
1445 - if (m_usenewfullscreen && m_fullscreen && (editorStack->visibleWidget() == reader))
1446 + if (m_usenewfullscreen && m_fullscreen && (editorStack->currentWidget() == reader))
1448 m_usenewfullscreen = false;
1449 reader->bDoUpdates = false;
1450 @@ -3078,7 +3068,7 @@ void QTReaderApp::showEditTools()
1454 - editorStack->raiseWidget( reader );
1455 + editorStack->setCurrentWidget( reader );
1459 @@ -3156,7 +3146,7 @@ void QTReaderApp::closeEvent( QCloseEvent *e )
1463 - else if (editorStack->visibleWidget() == m_buttonprefs)
1464 + else if (editorStack->currentWidget() == m_buttonprefs)
1466 int ret = QMessageBox::warning(this, PROGNAME,
1467 tr("Do you wish to map this key?\n\nIf you proceed you will map\nthe escape key and you will\nneed to press the close box\ntwice to exit this program\n\nContinue?"), tr("Yes"), tr("No"), QString::null, 0, 1);
1468 @@ -3172,7 +3162,7 @@ tr("Do you wish to map this key?\n\nIf you proceed you will map\nthe escape key
1472 - if (editorStack->visibleWidget() == reader)
1473 + if (editorStack->currentWidget() == reader)
1475 if ((kmap.find(orKey(Qt::NoButton,Key_Escape,false)) != kmap.end()) && m_bcloseDisabled)
1477 @@ -3277,7 +3267,7 @@ bool QTReaderApp::listbkmk(CList<Bkmk>* plist, const QString& _lab, bool presel)
1481 - editorStack->raiseWidget( bkmkselector );
1482 + editorStack->setCurrentWidget( bkmkselector );
1483 if (slt != -1) bkmkselector->setCurrentItem(slt);
1486 @@ -3799,7 +3789,7 @@ void QTReaderApp::do_autogen(const QString& regText)
1488 i = reader->buffdoc.getpara(buff);
1490 - if (re.match(toQString(buff.data())) != -1)
1491 + if (re.exactMatch(toQString(buff.data())) != -1)
1493 if (re.match(buff.data()) != -1)
1495 @@ -4113,7 +4103,7 @@ void QTReaderApp::showAnnotation()
1497 Global::showInputMethod();
1499 - editorStack->raiseWidget( m_annoWin );
1500 + editorStack->setCurrentWidget( m_annoWin );
1502 m_annoWin->setFocus();
1504 @@ -4152,7 +4142,7 @@ void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, size_t posn2,
1506 Global::showInputMethod();
1508 - editorStack->raiseWidget( m_annoWin );
1509 + editorStack->setCurrentWidget( m_annoWin );
1513 @@ -4738,17 +4728,9 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir, bool usedirs)
1514 d.setFilter( ((usedirs) ? QDir::Dirs : QDir::Files) | QDir::NoSymLinks );
1515 // d.setSorting( QDir::Size | QDir::Reversed );
1517 - const QFileInfoList *list = d.entryInfoList();
1518 - QFileInfoListIterator it( *list ); // create list iterator
1519 - QFileInfo *fi; // pointer for traversing
1521 - while ( (fi=it.current()) ) { // for each file...
1523 - bkmkselector->insertItem(fi->fileName(), cnt++);
1525 - //qDebug( "%10li %s", fi->size(), fi->fileName().data() );
1526 - ++it; // goto next list element
1528 + QFileInfoList list = d.entryInfoList();
1529 + for(QFileInfoListIterator it=list.begin();it!=list.end();++it)
1530 + bkmkselector->insertItem(it->fileName(), cnt++);
1534 @@ -4782,7 +4764,7 @@ void QTReaderApp::LoadTheme()
1536 if (PopulateConfig("Themes", true))
1538 - editorStack->raiseWidget( bkmkselector );
1539 + editorStack->setCurrentWidget( bkmkselector );
1541 m_nBkmkAction = cLdTheme;
1543 @@ -4794,7 +4776,7 @@ void QTReaderApp::LoadConfig()
1545 if (PopulateConfig("configs"))
1547 - editorStack->raiseWidget( bkmkselector );
1548 + editorStack->setCurrentWidget( bkmkselector );
1550 m_nBkmkAction = cLdConfig;
1552 @@ -4806,7 +4788,7 @@ void QTReaderApp::TidyConfig()
1554 if (PopulateConfig("configs"))
1556 - editorStack->raiseWidget( bkmkselector );
1557 + editorStack->setCurrentWidget( bkmkselector );
1559 m_nBkmkAction = cRmConfig;
1561 @@ -4818,7 +4800,7 @@ void QTReaderApp::ExportLinks()
1563 if (PopulateConfig("urls"))
1565 - editorStack->raiseWidget( bkmkselector );
1566 + editorStack->setCurrentWidget( bkmkselector );
1568 m_nBkmkAction = cExportLinks;
1570 diff --git a/QTReaderApp.h b/QTReaderApp.h
1571 index ab1b7ad..502079f 100644
1576 #include <qlineedit.h>
1578 -#include <qlistbox.h>
1579 +#include <Qt3Support/Q3ListBox>
1580 +#include <Qt3Support/Q3CString>
1581 +#include <Qt3Support/Q3ProgressBar>
1582 +#include <Qt3Support/Q3MainWindow>
1583 +#include <Qt3Support/Q3Action>
1584 +#include <QStackedWidget>
1585 +#include <qcombobox.h>
1586 +#include <qnamespace.h>
1587 +using namespace Qt;
1589 #include <qpe/qpeapplication.h>
1591 @@ -126,7 +134,7 @@ struct searchrecord
1595 -class QTReaderApp : public QMainWindow
1596 +class QTReaderApp : public Q3MainWindow
1600 @@ -180,7 +188,7 @@ class QTReaderApp : public QMainWindow
1603 void setfontHelper(const QString& lcn, int size = 0);
1604 - QAction* m_bkmkAvail, *m_actFullscreen;
1605 + Q3Action* m_bkmkAvail, *m_actFullscreen;
1606 CAnnoEdit* m_annoWin;
1608 int m_scrollcolor, m_scrollbarcolor, m_background, m_foreground;
1609 @@ -262,8 +270,8 @@ private slots:
1610 void showAnnotation();
1611 void do_setencoding(int i);
1612 void do_setfont(const QString&);
1613 - // void buttonActionSelected(QAction*);
1614 - void msgHandler(const QCString&, const QByteArray&);
1615 + // void buttonActionSelected(Q3Action*);
1616 + void msgHandler(const Q3CString&, const QByteArray&);
1617 void monospace(bool);
1619 void reparastring();
1620 @@ -346,35 +354,35 @@ private slots:
1621 void setscrollcolour();
1622 void setscrollbarcolour();
1623 void writeUrl(const QString& file, const QString& href);
1624 - QAction *m_preferences_action, *m_open_action, *m_close_action;
1625 - QAction *m_info_action, *m_touch_action, *m_find_action, *m_start_action;
1626 - QAction *m_end_action, *m_jump_action, *m_pageline_action;
1627 - QAction *m_pageup_action, *m_pagedn_action, *m_back_action;
1628 - QAction *m_home_action, *m_forward_action, *m_zoomin_action;
1629 - QAction *m_zoomout_action, *m_setfont_action, *m_mark_action;
1630 - QAction *m_annotate_action, *m_goto_action, *m_delete_action;
1631 - QAction *m_autogen_action, *m_clear_action, *m_save_action;
1632 - QAction *m_tidy_action, *m_startBlock_action, *m_endBlock_action;
1633 - QAction *m_setenc_action, *m_setmono_action, *m_saveconfig_action;
1634 - QAction *m_loadconfig_action, *m_loadtheme_action, *m_toolbarprefs_action, *m_tidyconfig_action;
1635 - QAction *m_exportlinks_action, *m_rotate_action, *m_buttonprefs_action, *m_inverse_action;
1636 - QAction *m_repara_action;
1637 + Q3Action *m_preferences_action, *m_open_action, *m_close_action;
1638 + Q3Action *m_info_action, *m_touch_action, *m_find_action, *m_start_action;
1639 + Q3Action *m_end_action, *m_jump_action, *m_pageline_action;
1640 + Q3Action *m_pageup_action, *m_pagedn_action, *m_back_action;
1641 + Q3Action *m_home_action, *m_forward_action, *m_zoomin_action;
1642 + Q3Action *m_zoomout_action, *m_setfont_action, *m_mark_action;
1643 + Q3Action *m_annotate_action, *m_goto_action, *m_delete_action;
1644 + Q3Action *m_autogen_action, *m_clear_action, *m_save_action;
1645 + Q3Action *m_tidy_action, *m_startBlock_action, *m_endBlock_action;
1646 + Q3Action *m_setenc_action, *m_setmono_action, *m_saveconfig_action;
1647 + Q3Action *m_loadconfig_action, *m_loadtheme_action, *m_toolbarprefs_action, *m_tidyconfig_action;
1648 + Q3Action *m_exportlinks_action, *m_rotate_action, *m_buttonprefs_action, *m_inverse_action;
1649 + Q3Action *m_repara_action;
1651 - QAction *m_grab_action;
1652 + Q3Action *m_grab_action;
1654 void addtoolbars(Config* config);
1655 ToolbarPolicy m_tbpol, m_tbpolsave;
1656 ToolBarDock m_tbposition;
1657 bool m_tbmove, m_tbmovesave;
1658 - QToolBar* filebar();
1659 - QToolBar* viewbar();
1660 - QToolBar* navbar();
1661 - QToolBar* markbar();
1662 + Q3ToolBar* filebar();
1663 + Q3ToolBar* viewbar();
1664 + Q3ToolBar* navbar();
1665 + Q3ToolBar* markbar();
1666 void hidetoolbars();
1667 - void addfilebar(Config* _config, const QString& key, QAction* a);
1668 - void addviewbar(Config* _config, const QString& key, QAction* a);
1669 - void addnavbar(Config* _config, const QString& key, QAction* a);
1670 - void addmarkbar(Config* _config, const QString& key, QAction* a);
1671 + void addfilebar(Config* _config, const QString& key, Q3Action* a);
1672 + void addviewbar(Config* _config, const QString& key, Q3Action* a);
1673 + void addnavbar(Config* _config, const QString& key, Q3Action* a);
1674 + void addmarkbar(Config* _config, const QString& key, Q3Action* a);
1675 bool checkbar(Config* _config, const QString& key);
1677 void SaveScript(const char* sname);
1678 @@ -401,9 +409,9 @@ private slots:
1682 - QAction* m_scrollButton;
1683 + Q3Action* m_scrollButton;
1685 - QAction* m_buttonAction[MAX_ACTIONS];
1686 + Q3Action* m_buttonAction[MAX_ACTIONS];
1688 CBkmkSelector* bkmkselector;
1690 @@ -418,27 +426,25 @@ private slots:
1692 bool dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg);
1694 - QWidgetStack *editorStack;
1695 + QStackedWidget *editorStack;
1697 QComboBox* m_fontSelector;
1698 // QPEToolBar /* *menu,*/ *fileBar;
1700 - QToolBar *menubar;
1701 + Q3ToolBar *menubar;
1703 - QToolBar *fileBar, *navBar, *viewBar, *markBar;
1704 + Q3ToolBar *fileBar, *navBar, *viewBar, *markBar;
1710 QFloatBar *searchBar, *regBar/*, *m_fontBar*/;
1711 - QToolBar /* *searchBar, *regBar,*/ *m_fontBar;
1712 + Q3ToolBar /* *searchBar, *regBar,*/ *m_fontBar;
1713 QLineEdit *searchEdit, *regEdit;
1716 bool m_fontVisible, m_twoTouch;
1717 - static unsigned long m_uid;
1718 - long unsigned get_unique_id() { return m_uid++; }
1720 void resizeEvent( QResizeEvent * r)
1722 @@ -451,7 +457,7 @@ private slots:
1723 CList<Bkmk>* pOpenlist;
1725 GraphicWin* m_graphicwin;
1726 - QProgressBar* pbar;
1727 + Q3ProgressBar* pbar;
1728 bool m_fBkmksChanged;
1729 // int m_nRegAction;
1730 regedit_type m_nRegAction;
1731 diff --git a/QtrListView.cpp b/QtrListView.cpp
1732 index 67040f8..e73a395 100644
1733 --- a/QtrListView.cpp
1734 +++ b/QtrListView.cpp
1736 #include "QtrListView.h"
1737 +#include <QtGui/QKeyEvent>
1738 +#include <qnamespace.h>
1739 +using namespace Qt;
1741 void QtrListView::keyPressEvent(QKeyEvent* e)
1743 @@ -19,6 +22,6 @@ void QtrListView::keyPressEvent(QKeyEvent* e)
1744 emit OnCancelButton();
1747 - QListView::keyPressEvent(e);
1748 + Q3ListView::keyPressEvent(e);
1751 diff --git a/QtrListView.h b/QtrListView.h
1752 index c1b7f4d..02a74cc 100644
1756 #define __QTRLISTVIEW_H
1758 #include <qlistview.h>
1759 +#include <Qt3Support/Q3ListViewItem>
1761 -class QtrListView : public QListView
1762 +class QtrListView : public Q3ListView
1766 virtual void keyPressEvent(QKeyEvent* e);
1768 - QtrListView(QWidget* parent, char* name) : QListView(parent, name) {};
1769 + QtrListView(QWidget* parent, char* name) : Q3ListView(parent, name) {};
1772 - void OnOKButton(QListViewItem*);
1773 - void OnCentreButton(QListViewItem*);
1774 + void OnOKButton(Q3ListViewItem*);
1775 + void OnCentreButton(Q3ListViewItem*);
1776 void OnCancelButton();
1779 diff --git a/Reb.cpp b/Reb.cpp
1780 index 65de9f6..9e6e552 100644
1783 @@ -105,8 +105,7 @@ QImage* CReb::getPicture(const QString& ref)
1784 char* imgbuffer = new char[rs.len];
1785 fseek(fin, page2pos(iter.data()), SEEK_SET);
1786 fread(imgbuffer, rs.len, 1, fin);
1788 - arr.assign((const char*)imgbuffer, rs.len);
1789 + QByteArray arr((const char*)imgbuffer, rs.len);
1790 QImage* qimage = new QImage(arr);
1793 @@ -581,7 +580,7 @@ void RBPage::startpage(UInt32 pos, UInt32 _cp, bool _isCompressed, UInt32 _len)
1796 if (tagoffset < tagstring.length())
1797 - return tagstring[tagoffset++].unicode();
1798 + return tagstring.at(tagoffset++).unicode();
1800 return currentpage.getch(this);
1802 diff --git a/TableDialog.cpp b/TableDialog.cpp
1803 index b67d534..d0748d6 100644
1804 --- a/TableDialog.cpp
1805 +++ b/TableDialog.cpp
1806 @@ -4,7 +4,7 @@ CTableDialog::CTableDialog(const QFont& f, const QString& tabtext, bool fs, QWid
1808 setCaption("Table View");
1809 QVBoxLayout *tmp = new QVBoxLayout(this);
1810 - QTextView* qtv = new QTextView(this);
1811 + Q3TextView* qtv = new Q3TextView(this);
1813 tmp->addWidget(qtv);
1814 qtv->setText(tabtext);
1815 diff --git a/TableDialog.h b/TableDialog.h
1816 index 2257a81..14b1cf2 100644
1820 #define __TABLEDIALOG_H
1822 #include <qdialog.h>
1823 -#include <qtextview.h>
1824 +#include <Qt3Support/Q3TextView>
1825 +#include <QtGui/QKeyEvent>
1826 #include <qlayout.h>
1827 +#include <qnamespace.h>
1828 +using namespace Qt;
1830 class CTableDialog : public QDialog
1832 diff --git a/ToolbarPrefs.cpp b/ToolbarPrefs.cpp
1833 index 56c4e9b..10fc6ec 100644
1834 --- a/ToolbarPrefs.cpp
1835 +++ b/ToolbarPrefs.cpp
1838 #include <qpe/menubutton.h>
1840 +#include <Qt3Support/Q3GroupBox>
1842 CBarPrefs::CBarPrefs(const QString& appdir, bool fs, QWidget* parent, const char* name) : QDialog(parent, name, true), config( appdir )
1844 @@ -222,7 +223,7 @@ CFileBarPrefs::CFileBarPrefs( Config& _config, QWidget* parent, const char* nam
1845 config.setGroup( "Toolbar" );
1846 QVBoxLayout* vb = new QVBoxLayout(this);
1848 - QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "File", this);
1849 + Q3GroupBox* bg = new Q3GroupBox(2, Qt::Horizontal, "File", this);
1852 open = new QCheckBox( tr("Open"), bg );
1853 @@ -263,7 +264,7 @@ CNavBarPrefs::CNavBarPrefs( Config& _config, QWidget* parent, const char* name,
1854 config.setGroup( "Toolbar" );
1855 QVBoxLayout* vb = new QVBoxLayout(this);
1857 - QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "Navigation", this);
1858 + Q3GroupBox* bg = new Q3GroupBox(2, Qt::Horizontal, "Navigation", this);
1860 scroll = new QCheckBox( tr("Scroll"), bg );
1861 scroll->setChecked(config.readBoolEntry( "Scroll", false ));
1862 @@ -324,7 +325,7 @@ CViewBarPrefs::CViewBarPrefs( Config& _config, QWidget* parent, const char* nam
1864 QVBoxLayout* vb = new QVBoxLayout(this);
1866 - QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "View", this);
1867 + Q3GroupBox* bg = new Q3GroupBox(2, Qt::Horizontal, "View", this);
1870 config.setGroup( "Toolbar" );
1871 @@ -381,7 +382,7 @@ CMarkBarPrefs::CMarkBarPrefs( Config& _config, QWidget* parent, const char* nam
1873 QVBoxLayout* vb = new QVBoxLayout(this);
1875 - QGroupBox* bg = new QGroupBox(2, Qt::Horizontal, "Marks", this);
1876 + Q3GroupBox* bg = new Q3GroupBox(2, Qt::Horizontal, "Marks", this);
1878 mark = new QCheckBox( tr("Bookmark"), bg );
1879 mark->setChecked(config.readBoolEntry( "Mark", false ));
1880 @@ -443,13 +444,13 @@ CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl )
1884 - QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Dialogs", this);
1885 + Q3GroupBox* gb = new Q3GroupBox(1, Qt::Horizontal, "Dialogs", this);
1886 floating = new QCheckBox(gb);
1887 floating->setText(tr("Floating"));
1888 hl->addWidget( gb, 0, 0 );
1891 - gb = new QGroupBox(1, Qt::Horizontal, "Bars (Restart)", this);
1892 + gb = new Q3GroupBox(1, Qt::Horizontal, "Bars (Restart)", this);
1894 // QLabel* ql = new QLabel("Restart to apply changes", gb);
1895 // TextLabel = new QLabel( gb );
1896 @@ -485,7 +486,7 @@ CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl )
1898 hl->addWidget(gb, 0, 1);
1900 - gb = new QGroupBox(1, Qt::Horizontal, "QT Scroll Bar", this);
1901 + gb = new Q3GroupBox(1, Qt::Horizontal, "QT Scroll Bar", this);
1904 qtscroll = new QComboBox(gb);
1905 @@ -497,7 +498,7 @@ CMiscBarPrefs::CMiscBarPrefs( QWidget* parent, const char* name, WFlags fl )
1906 qtscroll->insertItem(tr("Left"));
1908 hl->addWidget(gb, 1, 0);
1909 - gb = new QGroupBox(1, Qt::Horizontal, "Miniscroll", this);
1910 + gb = new Q3GroupBox(1, Qt::Horizontal, "Miniscroll", this);
1913 localscroll = new QComboBox(gb);
1914 @@ -527,7 +528,7 @@ CIndBarPrefs::CIndBarPrefs( Config& _config, QWidget* parent, const char* name,
1916 QVBoxLayout* vb = new QVBoxLayout(this);
1918 - QGroupBox* bg = new QGroupBox(1, Qt::Horizontal, "Indicators", this);
1919 + Q3GroupBox* bg = new Q3GroupBox(1, Qt::Horizontal, "Indicators", this);
1921 indannotate = new QCheckBox( tr("Annotation"), bg );
1922 indannotate->setChecked(config.readBoolEntry( "Annotation indicator", false ));
1923 diff --git a/ToolbarPrefs.h b/ToolbarPrefs.h
1924 index 9df8940..2a9d5cd 100644
1925 --- a/ToolbarPrefs.h
1926 +++ b/ToolbarPrefs.h
1929 #include <qvariant.h>
1930 #include <qwidget.h>
1931 -#include <qtabdialog.h>
1932 +#include <Qt3Support/Q3TabDialog>
1933 #include <qtabwidget.h>
1934 #include <qspinbox.h>
1935 #include <qcheckbox.h>
1936 #include <qcombobox.h>
1937 #include <qlineedit.h>
1938 +#include <qnamespace.h>
1939 +using namespace Qt;
1941 #include <qpe/menubutton.h>
1942 #include <qpe/config.h>
1947 +#include <QtGui/QKeyEvent>
1952 diff --git a/URLDialog.cpp b/URLDialog.cpp
1953 index dd4568b..9497979 100644
1956 @@ -5,7 +5,7 @@ CURLDialog::CURLDialog(const QString& fname, bool fs, QWidget* parent, const cha
1958 setCaption(tr("Save URL"));
1959 QVBoxLayout *tmp = new QVBoxLayout(this);
1960 - QVButtonGroup* vb = new QVButtonGroup(fname, this);
1961 + Q3VButtonGroup* vb = new Q3VButtonGroup(fname, this);
1963 m_clipboard = new QCheckBox(tr("Clipboard"), vb);
1964 m_localfile = new QCheckBox(tr("Local file"), vb);
1965 diff --git a/URLDialog.h b/URLDialog.h
1966 index 792d13a..fffaf2b 100644
1971 #include <qvariant.h>
1972 #include <qwidget.h>
1973 -#include <qtabdialog.h>
1974 +#include <Qt3Support/Q3TabDialog>
1975 #include <qtabwidget.h>
1976 #include <qspinbox.h>
1977 #include <qcheckbox.h>
1978 #include <qcombobox.h>
1979 #include <qlineedit.h>
1980 //#include <qpe/menubutton.h>
1981 -#include <qvbuttongroup.h>
1982 +#include <Qt3Support/Q3VButtonGroup>
1983 +#include <QtGui/QKeyEvent>
1984 +#include <qnamespace.h>
1985 +using namespace Qt;
1989 diff --git a/arrierego.cpp b/arrierego.cpp
1990 index be2a3fa..b4f857f 100644
1993 @@ -114,8 +114,7 @@ void CArriere::setlink(QString& fn, const QString& wrd)
1995 QImage* CArriere::imagefromdata(UInt8* imgbuffer, UInt32 imgsize)
1998 - arr.assign((const char*)imgbuffer, imgsize);
1999 + QByteArray arr((const char*)imgbuffer, imgsize);
2001 QImage* qimage = new QImage(arr);
2003 diff --git a/cbkmkselector.h b/cbkmkselector.h
2004 index ec0c6e8..e36d31a 100644
2005 --- a/cbkmkselector.h
2006 +++ b/cbkmkselector.h
2008 #include <qwidget.h>
2009 -#include <qlistbox.h>
2010 +#include <Qt3Support/Q3ListBox>
2011 #include <qpushbutton.h>
2012 #include <qlayout.h>
2013 +#include <qnamespace.h>
2014 +using namespace Qt;
2016 -class CBkmkSelectorItem : public QListBoxText
2017 +class CBkmkSelectorItem : public Q3ListBoxText
2021 - CBkmkSelectorItem(const QString& _t, int ref) : QListBoxText(_t), m_ref(ref)
2022 + CBkmkSelectorItem(const QString& _t, int ref) : Q3ListBoxText(_t), m_ref(ref)
2025 int reference() { return m_ref; }
2026 @@ -18,7 +20,7 @@ class CBkmkSelector : public QWidget
2030 - QListBox* bkmkselector;
2031 + Q3ListBox* bkmkselector;
2032 QPushButton* exitButton;
2034 void keyPressEvent ( QKeyEvent * e )
2035 @@ -38,7 +40,7 @@ signals:
2036 void selected(int i);
2039 - void slotSelected(QListBoxItem* t)
2040 + void slotSelected(Q3ListBoxItem* t)
2044 @@ -64,13 +66,13 @@ public:
2046 QVBoxLayout* grid = new QVBoxLayout(this);
2047 QHBoxLayout* hgrid = new QHBoxLayout();
2048 - bkmkselector = new QListBox(this, tr("Bookmarks"));
2049 + bkmkselector = new Q3ListBox(this, tr("Bookmarks"));
2050 QPushButton* _sort = new QPushButton(tr("Sort"), this);
2051 connect(_sort, SIGNAL(clicked()), this, SLOT( slotSort() ) );
2052 exitButton = new QPushButton(tr("Cancel"), this);
2053 // connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( slotSelected(int) ) );
2054 - connect(bkmkselector, SIGNAL( clicked(QListBoxItem*) ), this, SLOT( slotSelected(QListBoxItem*) ) );
2055 - connect(bkmkselector, SIGNAL( returnPressed(QListBoxItem*) ), this, SLOT( slotSelected(QListBoxItem*) ) );
2056 + connect(bkmkselector, SIGNAL( clicked(Q3ListBoxItem*) ), this, SLOT( slotSelected(Q3ListBoxItem*) ) );
2057 + connect(bkmkselector, SIGNAL( returnPressed(Q3ListBoxItem*) ), this, SLOT( slotSelected(Q3ListBoxItem*) ) );
2058 connect(exitButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) );
2059 grid->addWidget(bkmkselector,1);
2060 grid->addLayout(hgrid);
2061 diff --git a/decompress.cpp b/decompress.cpp
2062 index 6034e01..979b642 100644
2063 --- a/decompress.cpp
2064 +++ b/decompress.cpp
2066 #include "decompress.h"
2069 +#include "uqtcommon.h"
2071 size_t UnZip(UInt8* compressedbuffer, size_t reclen, UInt8* tgtbuffer, size_t bsize)
2073 @@ -60,17 +61,7 @@ size_t (*getdecompressor(char* _s))(UInt8*, size_t, UInt8*, size_t)
2075 size_t (*getdecompressor(char* _s))(UInt8*, size_t, UInt8*, size_t)
2079 - QString codecpath(getenv("OPIEDIR"));
2081 - QString codecpath(getenv("QTDIR"));
2083 - codecpath += "/plugins/reader/support/libpluckerdecompress.so";
2085 - QString codecpath(getenv("READERDIR"));
2086 - codecpath += "/support/libpluckerdecompress.so";
2088 + QString codecpath = uqt_supportpath()+"/libpluckerdecompress.so";
2089 qDebug("Codec:%s", (const char*)codecpath);
2090 if (QFile::exists(codecpath))
2092 diff --git a/ebookcodec.h b/ebookcodec.h
2093 index 4229fb9..091894a 100644
2097 #include "CExpander.h"
2098 +#include "uqtcommon.h"
2100 #include <qfileinfo.h>
2102 @@ -22,17 +23,7 @@ class ebookcodec : public CExpander_Interface
2104 ebookcodec(const QString& _s) : codec(NULL), handle(NULL), status(0)
2108 - QString codecpath(getenv("OPIEDIR"));
2110 - QString codecpath(getenv("QTDIR"));
2112 - codecpath += "/plugins/reader/codecs/";
2114 - QString codecpath(getenv("READERDIR"));
2115 - codecpath += "/codecs/";
2117 + QString codecpath = uqt_codecspath();
2119 if (QFile::exists(codecpath))
2121 diff --git a/fileBrowser.cpp b/fileBrowser.cpp
2122 index c8c371a..688f035 100644
2123 --- a/fileBrowser.cpp
2124 +++ b/fileBrowser.cpp
2125 @@ -53,18 +53,18 @@ fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, boo
2126 ListView->addColumn( tr( "Name" ) );
2127 ListView->setSorting( 2, FALSE);
2128 ListView->addColumn( tr( "Size" ) );
2129 - ListView->setSelectionMode(QListView::Single);
2130 + ListView->setSelectionMode(Q3ListView::Single);
2131 ListView->setAllColumnsShowFocus( TRUE );
2132 - ListView->setColumnWidthMode(0, ((modal) ? QListView::Manual : QListView::Maximum));
2133 - ListView->setColumnWidthMode(1, QListView::Manual);
2134 + ListView->setColumnWidthMode(0, ((modal) ? Q3ListView::Manual : Q3ListView::Maximum));
2135 + ListView->setColumnWidthMode(1, Q3ListView::Manual);
2137 // signals and slots connections
2138 connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) );
2139 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) );
2140 - connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) );
2141 - connect( ListView, SIGNAL(clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
2142 - connect( ListView, SIGNAL(OnOKButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
2143 - connect( ListView, SIGNAL(OnCentreButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) );
2144 + connect( ListView, SIGNAL(doubleClicked( Q3ListViewItem*)), SLOT(listDoubleClicked(Q3ListViewItem *)) );
2145 + connect( ListView, SIGNAL(clicked( Q3ListViewItem*)), SLOT(listClicked(Q3ListViewItem *)) );
2146 + connect( ListView, SIGNAL(OnOKButton( Q3ListViewItem*)), SLOT(listClicked(Q3ListViewItem *)) );
2147 + connect( ListView, SIGNAL(OnCentreButton( Q3ListViewItem*)), SLOT(listClicked(Q3ListViewItem *)) );
2148 connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) );
2150 QVBoxLayout* grid = new QVBoxLayout(this);
2151 @@ -143,16 +143,13 @@ void fileBrowser::populateList()
2152 currentDir.setNameFilter(filterStr);
2153 // currentDir.setNameFilter("*.txt;*.etx");
2154 QString fileL, fileS;
2155 - const QFileInfoList *list = currentDir.entryInfoList();
2156 - QFileInfoListIterator it(*list);
2158 - while ( (fi=it.current()) )
2160 - if (fi->fileName() != ".")
2161 + QFileInfoList list = currentDir.entryInfoList();
2162 + for(QFileInfoListIterator it=list.begin();it!=list.end();++it) {
2163 + if (it->fileName() != ".")
2165 - fileS.sprintf( "%10li", fi->size() );
2166 - fileL.sprintf( "%s",fi->fileName().data() );
2168 + fileS.sprintf( "%10li", it->size() );
2169 + fileL.sprintf( "%s",it->fileName().data() );
2174 @@ -160,9 +157,8 @@ void fileBrowser::populateList()
2176 //// qDebug("Not a dir: "+currentDir.canonicalPath()+fileL);
2178 - new QListViewItem( ListView,fileL,fileS );
2179 + new Q3ListViewItem( ListView,fileL,fileS );
2183 ListView->setSorting( 2, FALSE);
2184 dirLabel->setText("Current Directory:\n"+currentDir.canonicalPath());
2185 @@ -174,7 +170,7 @@ void fileBrowser::upDir()
2186 //// qDebug(currentDir.canonicalPath());
2189 -void fileBrowser::listClicked(QListViewItem *selectedItem)
2190 +void fileBrowser::listClicked(Q3ListViewItem *selectedItem)
2192 if (selectedItem == NULL) return;
2193 QString strItem=selectedItem->text(0);
2194 @@ -196,12 +192,12 @@ void fileBrowser::listClicked(QListViewItem *selectedItem)
2196 if(QDir(strItem).exists())
2198 - currentDir.cd(strItem, TRUE);
2199 + currentDir.cd(strItem);
2204 - QListViewItem *selectedItem = ListView->selectedItem();
2205 + Q3ListViewItem *selectedItem = ListView->selectedItem();
2206 if (selectedItem == NULL)
2209 @@ -218,7 +214,7 @@ void fileBrowser::listClicked(QListViewItem *selectedItem)
2212 // you may want to switch these 2 functions. I like single clicks
2213 -void fileBrowser::listDoubleClicked(QListViewItem *selectedItem)
2214 +void fileBrowser::listDoubleClicked(Q3ListViewItem *selectedItem)
2218 @@ -253,7 +249,7 @@ void fileBrowser::setHidden(bool _hidden)
2220 void fileBrowser::onReturn()
2222 - QListViewItem *selectedItem = ListView->selectedItem();
2223 + Q3ListViewItem *selectedItem = ListView->selectedItem();
2224 if (selectedItem == NULL)
2226 filename = m_filename->text();
2227 @@ -282,7 +278,7 @@ void fileBrowser::onHome()
2229 void fileBrowser::setdir(const QString& s)
2231 - currentDir.cd(s, TRUE);
2236 diff --git a/fileBrowser.h b/fileBrowser.h
2237 index c536e96..959e866 100644
2240 @@ -22,6 +22,9 @@ blah,blah,blah
2241 #include <qstringlist.h>
2243 #include <qstring.h>
2244 +#include <qnamespace.h>
2245 +using namespace Qt;
2246 +#include <Qt3Support/Q3ListViewItem>
2250 @@ -50,7 +53,7 @@ class fileBrowser : public QDialog
2252 QString getCurrentFile();
2253 QLineEdit* m_filename;
2255 + QDir::Filters filterspec;
2256 // QDir::FilterSpec filterspec;
2258 //QListViewItem * item;
2259 @@ -60,8 +63,8 @@ class fileBrowser : public QDialog
2263 - void listDoubleClicked(QListViewItem *);
2264 - void listClicked(QListViewItem *);
2265 + void listDoubleClicked(Q3ListViewItem *);
2266 + void listClicked(Q3ListViewItem *);
2269 void setHidden(bool);
2270 diff --git a/hrule.cpp b/hrule.cpp
2271 index d697acb..4705057 100644
2276 +#include <qpixmap.h>
2278 QImage* hRule(int w, int h, unsigned char r, unsigned char g, unsigned char b)
2280 diff --git a/infowin.cpp b/infowin.cpp
2281 index 816a09f..0a25571 100644
2285 #include "infowin.h"
2286 #include "version.h"
2288 -#include <qmultilineedit.h>
2289 +#include <Qt3Support/Q3MultiLineEdit>
2290 #include <qlayout.h>
2291 #include <qpushbutton.h>
2293 @@ -20,9 +20,9 @@ infowin::infowin( QWidget *parent, const char *name, WFlags f) :
2294 QWidget(parent, name, f)
2296 QVBoxLayout* vl = new QVBoxLayout(this);
2297 - aboutbox = new QMultiLineEdit(this);
2298 + aboutbox = new Q3MultiLineEdit(this);
2299 aboutbox->setReadOnly(true);
2300 - aboutbox->setWordWrap(QMultiLineEdit::WidgetWidth);
2301 + aboutbox->setWordWrap(Q3MultiLineEdit::WidgetWidth);
2302 //grid->addWidget(l, 5, 0);
2303 vl->addWidget(aboutbox);
2304 QGridLayout* grid = new QGridLayout(vl, 10, 2);
2305 diff --git a/infowin.h b/infowin.h
2306 index c003998..92cff3a 100644
2313 +#include <Qt3Support/Q3MultiLineEdit>
2314 +#include <qnamespace.h>
2315 +using namespace Qt;
2317 class QMultiLineEdit;
2319 @@ -17,7 +20,7 @@ Q_OBJECT
2321 QLabel* docLocation;
2323 - QMultiLineEdit* aboutbox;
2324 + Q3MultiLineEdit* aboutbox;
2326 infowin( QWidget *parent=0, const char *name=0, WFlags f = 0);
2327 void setFileSize(int sz) { fileSize->setNum(sz); }
2328 diff --git a/opiedir/include.pro b/opiedir/include.pro
2329 new file mode 100644
2330 index 0000000..44c572b
2332 +++ b/opiedir/include.pro
2334 +DEFINES -= OPIE USEQPE
2335 +DEFINES += QT3_SUPPORT
2337 +LIBS -= -lopiecore2 -lopieui2 -lqpe
2338 +LIBS += -L${OPIEDIR}/lib
2340 +QT += core gui qt3support
2342 +isEmpty(UQT_LIBDIR) {
2343 + UQT_LIBDIR = /usr/lib/uqtreader
2345 +isEmpty(UQT_DATADIR) {
2346 + UQT_DATADIR = /usr/share/uqtreader
2348 +DEFINES += UQT_LIBDIR='\\"$$UQT_LIBDIR\\"' UQT_DATADIR='\\"$$UQT_DATADIR\\"'
2349 diff --git a/outputcodec.h b/outputcodec.h
2350 index 727575c..dfba5a2 100644
2354 #include <qfileinfo.h>
2357 +#include "uqtcommon.h"
2360 #include <qpe/global.h>
2362 @@ -29,17 +31,8 @@ class outputcodec : public COutput
2364 outputcodec(const QString& _s) : codec(NULL), handle(NULL), status(-1)
2368 - QString codecpath(getenv("OPIEDIR"));
2370 - QString codecpath(getenv("QTDIR"));
2372 - codecpath += "/plugins/reader/outcodecs/lib";
2374 - QString codecpath(getenv("READERDIR"));
2375 - codecpath += "/outcodecs/lib";
2377 + QString codecpath = uqt_outcodecspath();
2378 + codecpath += "lib";
2381 if (QFile::exists(codecpath))
2382 diff --git a/preferences.cpp b/preferences.cpp
2383 index 67960ed..044a003 100755
2384 --- a/preferences.cpp
2385 +++ b/preferences.cpp
2386 @@ -14,7 +14,7 @@ Config::Config(const QString& _fn) : fname(_fn)
2391 + while (!t.atEnd())
2393 QString data = t.readLine();
2394 int colon = data.find(':');
2395 diff --git a/reader/reader.pro b/reader/reader.pro
2396 index dc6a5dd..7552bd1 100644
2397 --- a/reader/reader.pro
2398 +++ b/reader/reader.pro
2399 @@ -51,7 +51,8 @@ HEADERS = Aportis.h \
2407 SOURCES = BuffDoc.cpp \
2409 @@ -76,7 +77,8 @@ SOURCES = BuffDoc.cpp \
2418 DESTDIR = $(OPIEDIR)/bin
2419 diff --git a/striphtml.cpp b/striphtml.cpp
2420 index a2ad56b..1346dc3 100644
2424 #include "CDrawBuffer.h"
2425 #include "striphtml.h"
2427 +#include "uqtcommon.h"
2429 #include <qregexp.h>
2431 @@ -209,14 +210,14 @@ QString striphtml::dehtml(const QString& _info)
2433 for (int i = 0; i < _info.length(); i++)
2435 - tchar ch = _info[i];
2436 + tchar ch = _info[i].unicode();
2440 for (int j = 0; j < 2; j++)
2443 - tchar ch1 = _info[++i];
2444 + tchar ch1 = _info[++i].unicode();
2445 if ('0' <= ch1 && ch1 <= '9')
2448 @@ -285,7 +286,7 @@ bool striphtml::findanchor(const QString& _info)
2451 // qApp->processEvents();
2452 - if ((offset = name.match(toQString(test.data()))) != -1) break;
2453 + if ((offset = name.exactMatch(toQString(test.data()))) != -1) break;
2455 if ((offset = id.match(toQString(test.data()))) != -1) break;
2457 @@ -325,17 +326,7 @@ striphtml::~striphtml()
2458 void striphtml::initentmap()
2460 entmap = new QMap<QString, tchar>;
2463 - QString fname(getenv("OPIEDIR"));
2465 - QString fname(getenv("QTDIR"));
2467 - fname += "/plugins/reader/data";
2469 - QString fname(getenv("READERDIR"));
2472 + QString fname = uqt_datapath();
2474 fi.setFile(fname, "HTMLentities");
2476 @@ -347,7 +338,7 @@ void striphtml::initentmap()
2481 + while (!t.atEnd())
2483 QString data = t.readLine();
2484 int colon = data.find(':');
2485 diff --git a/uqtcommon.h b/uqtcommon.h
2486 new file mode 100644
2487 index 0000000..e551740
2491 +#ifndef __UQTCOMMON_H
2492 +#define __UQTCOMMON_H
2494 +#include <qstring.h>
2498 +# define Q_DIR_ENV "OPIEDIR"
2500 +# define Q_DIR_ENV "QTDIR"
2504 +inline QString uqt_libdir() {
2506 + return QString(getenv(Q_DIR_ENV))+"/plugins/reader";
2508 + const char *rd = getenv("READERDIR");
2510 + return UQT_LIBDIR;
2513 +inline QString uqt_datadir() {
2515 + return QString(geenv(Q_DIR_ENV));
2517 + const char *rd = getenv("READERDIR");
2519 + return UQT_DATADIR;
2523 +inline QString uqt_codecspath() {
2524 + return uqt_libdir()+"/codecs/";
2526 +inline QString uqt_outcodecspath() {
2527 + return uqt_libdir()+"/outcodecs/";
2529 +inline QString uqt_filterspath() {
2530 + return uqt_libdir()+"/filters/";
2532 +inline QString uqt_supportpath() {
2533 + return uqt_libdir()+"/support/";
2536 +inline QString uqt_picspath() {
2537 + return uqt_datadir()+"/pics/";
2539 +inline QString uqt_datapath() {
2541 + return uqt_datadir()+"/plugins/reader/data";
2543 + return uqt_datadir()+"/data";
2547 +#endif /* __UQTCOMMON_H */
2548 diff --git a/version.cpp b/version.cpp
2549 index aafb3d8..743ef38 100644
2554 #include <qmessagebox.h>
2556 -#include <qmultilineedit.h>
2557 +#include <Qt3Support/Q3MultiLineEdit>
2558 #include <qlayout.h>
2559 -#include <qtextview.h>
2560 +#include <Qt3Support/Q3TextView>
2561 class versionbox : public QDialog
2564 @@ -19,7 +19,7 @@ public:
2565 box->setWordWrap(QMultiLineEdit::WidgetWidth);
2568 - QTextView* box = new QTextView(this);
2569 + Q3TextView* box = new Q3TextView(this);