[oe-commits] org.oe.dev uqtreader: opie-reader made for qt4-x11

polyonymous commit openembedded-commits at lists.openembedded.org
Fri Jun 8 00:05:02 UTC 2007


uqtreader: opie-reader made for qt4-x11
the very first successfull attempt to get it running on qt4-x11.
very dirty, but working, patch.

Author: polyonymous at openembedded.org
Branch: org.openembedded.dev
Revision: 1a91225e25a9f88e57d69f3d7645563ee2d1f745
ViewMTN: http://monotone.openembedded.org/revision.psp?id=1a91225e25a9f88e57d69f3d7645563ee2d1f745
Files:
1
packages/opie-reader/files/qt4.patch
packages/opie-reader/uqtreader_cvs.bb
Diffs:

#
# mt diff -rb93d99eb04f48c102b03f5d6af4a506f48657066 -r1a91225e25a9f88e57d69f3d7645563ee2d1f745
#
# 
# 
# add_file "packages/opie-reader/files/qt4.patch"
#  content [643bce9ce388124e6f490f8070d8a481d6a0192e]
# 
# add_file "packages/opie-reader/uqtreader_cvs.bb"
#  content [b5eaf8da58651885a61786aed8e5b69735c2160b]
# 
============================================================
--- packages/opie-reader/files/qt4.patch	643bce9ce388124e6f490f8070d8a481d6a0192e
+++ packages/opie-reader/files/qt4.patch	643bce9ce388124e6f490f8070d8a481d6a0192e
@@ -0,0 +1,2091 @@
+diff --git a/Aportis.cpp b/Aportis.cpp
+index 37dcc99..03c26ea 100644
+--- a/Aportis.cpp
++++ b/Aportis.cpp
+@@ -443,8 +443,7 @@ unsuspend();
+   gotorecordnumber(tgtrec);
+   UInt8* imgbuffer = new UInt8[reclen];
+   fread(imgbuffer, 1, reclen, fin);
+-  QByteArray arr;
+-  arr.assign((const char*)imgbuffer, reclen);
++  QByteArray arr((const char*)imgbuffer, reclen);
+ 
+   QImage* qimage = new QImage(arr);
+   fseek(fin, cur, SEEK_SET);
+diff --git a/Bkmks.cpp b/Bkmks.cpp
+index 45aa045..c67db9e 100644
+--- a/Bkmks.cpp
++++ b/Bkmks.cpp
+@@ -32,8 +32,7 @@ Bkmk::Bkmk(const Bkmk& rhs) :
+   m_annolen(0),
+   m_position(0)
+ {
+-    init(rhs.name(), sizeof(tchar)*(ustrlen(rhs.name())+1), rhs.anno(),
+-         sizeof(tchar)*(ustrlen(rhs.anno())+1), rhs.value());
++    *this = rhs;
+ }
+ 
+ Bkmk::Bkmk(const tchar* _nm, const tchar* _anno, unsigned int _p) : m_position(_p)
+diff --git a/BuffDoc.cpp b/BuffDoc.cpp
+index 355d14d..8c1eadc 100644
+--- a/BuffDoc.cpp
++++ b/BuffDoc.cpp
+@@ -682,7 +682,8 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
+ #endif
+   codecpath += "/plugins/reader/codecs";
+ #else
+-  QString codecpath(getenv("READERDIR"));
++  const char *rd = getenv("READERDIR");
++  QString codecpath(rd?rd:"/usr/lib/uqtreader");
+   codecpath += "/codecs";
+ #endif
+   QDir d(codecpath, "*.so");
+@@ -690,19 +691,14 @@ int BuffDoc::openfile(QWidget* _parent, const char *src)
+   if (d.exists())
+     {
+ 
+-      const QFileInfoList *list = d.entryInfoList();
+-      QFileInfoListIterator it( *list );      // create list iterator
+-      QFileInfo *fi;                          // pointer for traversing
+-  
++      QFileInfoList list = d.entryInfoList();
+       int ret = -1;
+-      while ( ret != 0 && (fi=it.current()) )
+-	{           // for each file...
++      for(QFileInfoListIterator it=list.begin();ret && it!=list.end();++it) {
+ 	  if (exp != NULL) delete exp;
+-	  qDebug("Trying %s", (const char*)fi->fileName());
+-	  exp = new ebookcodec(fi->fileName());
++	  qDebug("Trying %s", (const char*)it->fileName());
++	  exp = new ebookcodec(it->fileName());
+ 	  ret = exp->openfile(src);
+-	  ++it;
+-	}
++      }
+       qDebug("Buffdoc:Finished opening");
+       if (ret != 0)
+ 	{
+diff --git a/ButtonPrefs.cpp b/ButtonPrefs.cpp
+index 762de55..2c4cad7 100644
+--- a/ButtonPrefs.cpp
++++ b/ButtonPrefs.cpp
+@@ -17,7 +17,7 @@
+ #include <qtooltip.h>
+ #include <qwhatsthis.h>
+ #include <qbuttongroup.h>
+-#include <qmultilineedit.h>
++#include <Qt3Support/Q3MultiLineEdit>
+ #ifdef USECOMBO
+ #include <qcombobox.h>
+ #else
+@@ -26,12 +26,14 @@
+ #include <qfontdatabase.h>
+ 
+ #include <qlistview.h>
++#include <Qt3Support/Q3ListViewItem>
++#include <QtGui/QKeyEvent>
+ 
+-class MyQListViewItem : public QListViewItem
++class MyQListViewItem : public Q3ListViewItem
+ {
+   orKey o;
+ public:
+-  MyQListViewItem(const orKey& _o, QListView* p, const QString& c1, const QString& c2, const QString& c3) : QListViewItem(p, c1, c2, c3), o(_o) { }
++  MyQListViewItem(const orKey& _o, Q3ListView* p, const QString& c1, const QString& c2, const QString& c3) : Q3ListViewItem(p, c1, c2, c3), o(_o) { }
+   orKey getKey() { return o; }
+ };
+ 
+@@ -43,7 +45,7 @@ void CButtonPrefs::mapkey(Qt::ButtonState st, int _key)
+ void CButtonPrefs::mapkey(Qt::ButtonState st, int _key, int act)
+ {
+   orKey key(st, _key, ((act == cesScrollMore) || (act == cesScrollLess)));
+-  QMap<orKey,QListViewItem*>::Iterator iter = listmap.find(key);
++  QMap<orKey,Q3ListViewItem*>::Iterator iter = listmap.find(key);
+   if (iter != listmap.end())
+     {
+       lb->takeItem(iter.data());
+@@ -112,7 +114,7 @@ CButtonPrefs::CButtonPrefs( QMap<orKey, int>* _kmap, QWidget* parent,  const cha
+ {
+   QVBoxLayout* vo = new QVBoxLayout(this);
+   QHBoxLayout* lo = new QHBoxLayout();
+-  setFocusPolicy(QWidget::StrongFocus);
++  setFocusPolicy(Qt::StrongFocus);
+ #ifdef USECOMBO
+     action = new QComboBox( this );
+ #else
+@@ -123,17 +125,17 @@ CButtonPrefs::CButtonPrefs( QMap<orKey, int>* _kmap, QWidget* parent,  const cha
+ 
+ 
+ 
+-    QMultiLineEdit* TextLabel1 = new QMultiLineEdit( this );
++    Q3MultiLineEdit* TextLabel1 = new Q3MultiLineEdit( this );
+     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." ) );
+     TextLabel1->setReadOnly(true);
+-    TextLabel1->setWordWrap(QMultiLineEdit::WidgetWidth);
++    TextLabel1->setWordWrap(Q3MultiLineEdit::WidgetWidth);
+ 
+     //    lo->addWidget(TextLabel, 0, Qt::AlignTop);
+     //    lo->addWidget(action, 0, Qt::AlignTop);
+     lo->addWidget(TextLabel1);
+     lo->addWidget(action);
+     vo->addLayout(lo);
+-    lb = new QListView(this);
++    lb = new Q3ListView(this);
+     lb->addColumn( tr( "Key" ) );
+     lb->addColumn( tr( "Function" ) );
+     lb->addColumn( tr( "Scroll" ) );
+diff --git a/ButtonPrefs.h b/ButtonPrefs.h
+index 9af04e1..f09ad02 100644
+--- a/ButtonPrefs.h
++++ b/ButtonPrefs.h
+@@ -11,11 +11,13 @@
+ 
+ #include <qvariant.h>
+ #include <qwidget.h>
+-#include <qtabdialog.h>
++#include <Qt3Support/Q3TabDialog>
+ #include <qtabwidget.h>
+ #include <qspinbox.h>
+ #include <qcheckbox.h>
+ #include <qlineedit.h>
++#include <qnamespace.h>
++using namespace Qt;
+ 
+ #define USECOMBO
+ 
+@@ -33,18 +35,18 @@ class QGridLayout;
+ //class QCheckBox;
+ class QLabel;
+ //class QSpinBox;
+-class QListViewItem;
++class Q3ListViewItem;
+ 
+-class QListView;
+-class QListViewItem;
++class Q3ListView;
++class Q3ListViewItem;
+ 
+ class CButtonPrefs : public QWidget
+ {
+   Q_OBJECT
+ 
+   QMap<orKey, int> *kmap;
+-  QMap<orKey, QListViewItem*> listmap;
+-  QListView* lb;
++  QMap<orKey, Q3ListViewItem*> listmap;
++  Q3ListView* lb;
+   void keyPressEvent(QKeyEvent* e);
+ #ifdef USECOMBO
+     void populate(QComboBox*);
+diff --git a/CAnnoEdit.cpp b/CAnnoEdit.cpp
+index 35821ed..6ee1321 100644
+--- a/CAnnoEdit.cpp
++++ b/CAnnoEdit.cpp
+@@ -83,8 +83,8 @@ CAnnoEdit::CAnnoEdit(QWidget *parent, const char *name, WFlags f) :
+ {
+   QVBoxLayout* grid = new QVBoxLayout(this);
+   m_name = new QLineEdit(this, "Name");
+-  m_anno = new QMultiLineEdit(this, "Annotation");
+-  m_anno->setWordWrap(QMultiLineEdit::WidgetWidth);
++  m_anno = new Q3MultiLineEdit(this, "Annotation");
++  m_anno->setWordWrap(Q3MultiLineEdit::WidgetWidth);
+   QPushButton* exitButton = new QPushButton("Okay", this);
+   connect(exitButton, SIGNAL( clicked() ), this, SLOT( slotOkay() ) );
+   QPushButton* cancelButton = new QPushButton("Cancel", this);
+diff --git a/CAnnoEdit.h b/CAnnoEdit.h
+index 78d3eeb..c74c560 100644
+--- a/CAnnoEdit.h
++++ b/CAnnoEdit.h
+@@ -4,15 +4,17 @@
+ #include <qlayout.h>
+ #include <qpushbutton.h>
+ #include <qlineedit.h>
+-#include <qmultilineedit.h>
++#include <Qt3Support/Q3MultiLineEdit>
+ #include <qcombobox.h>
++#include <qnamespace.h>
++using namespace Qt;
+ 
+ class CAnnoEdit : public QWidget
+ {
+     Q_OBJECT
+ 
+     QLineEdit* m_name;
+-    QMultiLineEdit* m_anno;
++    Q3MultiLineEdit* m_anno;
+     size_t m_posn, m_posn2;
+     QComboBox* colorbox;
+  public:
+diff --git a/CFilter.cpp b/CFilter.cpp
+index a4ea60a..4baa890 100644
+--- a/CFilter.cpp
++++ b/CFilter.cpp
+@@ -673,7 +673,8 @@ ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NU
+ #endif
+   filterpath += "/plugins/reader/filters/lib";
+ #else
+-  QString filterpath(getenv("READERDIR"));
++  const char *rd = getenv("READERDIR");
++  QString filterpath(rd?rd:"/usr/lib/uqtreader");
+   filterpath += "/filters/lib";
+ #endif
+   filterpath += nm;
+diff --git a/CHM.cpp b/CHM.cpp
+index ace5abc..3c325bb 100644
+--- a/CHM.cpp
++++ b/CHM.cpp
+@@ -335,7 +335,7 @@ int CHM::getch() {
+ #else
+     QChar letter = chmBuffer[bufpos++];
+ #endif
+-    return (int)(char)letter;
++    return letter.unicode();
+ }
+ 
+ void CHM::getch(tchar& ch, CStyle& sty)
+diff --git a/CloseDialog.cpp b/CloseDialog.cpp
+index 741fa67..62ae906 100644
+--- a/CloseDialog.cpp
++++ b/CloseDialog.cpp
+@@ -5,7 +5,7 @@ CCloseDialog::CCloseDialog(const QString& fname, bool fs, QWidget* parent, const
+ {
+     setCaption(tr("Tidy-up"));
+     QVBoxLayout *tmp = new QVBoxLayout(this);
+-    QVButtonGroup* vb = new QVButtonGroup(tr("Delete"), this);
++    Q3VButtonGroup* vb = new Q3VButtonGroup(tr("Delete"), this);
+     tmp->addWidget(vb);
+     QString filestring = tr("Delete") + " " + fname;
+     file = new QCheckBox(filestring, vb);
+diff --git a/CloseDialog.h b/CloseDialog.h
+index 54aaf1c..84609f5 100644
+--- a/CloseDialog.h
++++ b/CloseDialog.h
+@@ -11,14 +11,17 @@
+ 
+ #include <qvariant.h>
+ #include <qwidget.h>
+-#include <qtabdialog.h>
++#include <Qt3Support/Q3TabDialog>
+ #include <qtabwidget.h>
+ #include <qspinbox.h>
+ #include <qcheckbox.h>
+ #include <qcombobox.h>
+ #include <qlineedit.h>
+ //#include <qpe/menubutton.h>
+-#include <qvbuttongroup.h>
++#include <Qt3Support/Q3VButtonGroup>
++#include <QtGui/QKeyEvent>
++#include <qnamespace.h>
++using namespace Qt;
+ 
+ class QVBoxLayout; 
+ class QHBoxLayout; 
+diff --git a/FontControl.cpp b/FontControl.cpp
+index 08b8c52..b80dd6e 100644
+--- a/FontControl.cpp
++++ b/FontControl.cpp
+@@ -1,4 +1,5 @@
+ #include <qfontdatabase.h>
++#include <Qt3Support/Q3ValueList>
+ 
+ #include "FontControl.h"
+ 
+@@ -33,9 +34,9 @@ int FontControl::gzoom()
+ 
+ bool FontControl::ChangeFont(QString& n, int tgt)
+ {
+-    QValueList<int>::Iterator it;
++    Q3ValueList<int>::Iterator it;
+     QFontDatabase fdb;
+-    QValueList<int> sizes = fdb.pointSizes(n);
++    Q3ValueList<int> sizes = fdb.pointSizes(n);
+     if (sizes.count() == 0)
+     {
+ 	return false;
+diff --git a/GraphicWin.h b/GraphicWin.h
+index 70d5f7e..a6c556a 100644
+--- a/GraphicWin.h
++++ b/GraphicWin.h
+@@ -1,14 +1,16 @@
+ #ifndef __GRAPHICWIN_H
+ #define __GRAPHICWIN_H
+ 
+-#include <qscrollview.h>
++#include <Qt3Support/Q3ScrollView>
+ #include <qpixmap.h>
+ #include <qimage.h>
+ #include <qpushbutton.h>
+ #include <qlayout.h>
+ #include <qwmatrix.h>
++#include <qnamespace.h>
++using namespace Qt;
+ 
+-class GraphicScroll : public QScrollView
++class GraphicScroll : public Q3ScrollView
+ {
+   Q_OBJECT
+   QWidget* m_picture;
+@@ -19,7 +21,7 @@ class GraphicScroll : public QScrollView
+     }
+  public:
+   GraphicScroll( QWidget *parent=0, const char *name=0, WFlags f = 0)
+-    : QScrollView(parent, name, f)
++    : Q3ScrollView(parent, name, f)
+     {
+       m_picture = new QWidget(viewport());
+       addChild(m_picture);
+diff --git a/Prefs.cpp b/Prefs.cpp
+index 6c4d45b..f3df856 100644
+--- a/Prefs.cpp
++++ b/Prefs.cpp
+@@ -27,6 +27,7 @@
+ #include <qpe/menubutton.h>
+ #endif
+ #include <qfontdatabase.h>
++#include <Qt3Support/Q3ButtonGroup>
+ 
+ #ifdef USECOMBO
+ void populate_colours(QComboBox *mb)
+@@ -58,7 +59,7 @@ CLayoutPrefs::CLayoutPrefs( QWidget* parent,  const char* name, WFlags fl )
+     : QWidget( parent, name, fl )
+ {
+     QHBoxLayout* hb = new QHBoxLayout(this);
+-    QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Text", this);
++    Q3ButtonGroup* bg = new Q3ButtonGroup(2, Qt::Horizontal, "Text", this);
+     hb->addWidget(bg);
+ 
+     StripCR = new QCheckBox( bg );
+@@ -592,7 +593,7 @@ CMiscPrefs::CMiscPrefs( QWidget* parent,  const char* name, WFlags fl )
+     vl->setMargin( 0 );
+     hl->setMargin( 0 );
+ 
+-    QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, "Select Action", this);
++    Q3GroupBox* gb = new Q3GroupBox(1, Qt::Horizontal, "Select Action", this);
+     hl->addWidget( gb );
+ 
+     annotation = new QCheckBox( gb );
+@@ -607,7 +608,7 @@ CMiscPrefs::CMiscPrefs( QWidget* parent,  const char* name, WFlags fl )
+     boutput = new QCheckBox( gb );
+     boutput->setText( tr( "Output" ) );
+ 
+-    QButtonGroup* bg = new QButtonGroup(1, Qt::Horizontal, "Plucker", this);
++    Q3ButtonGroup* bg = new Q3ButtonGroup(1, Qt::Horizontal, "Plucker", this);
+     hl->addWidget( bg );
+ 
+     Depluck = new QCheckBox( bg );
+@@ -618,7 +619,7 @@ CMiscPrefs::CMiscPrefs( QWidget* parent,  const char* name, WFlags fl )
+ 
+     Continuous = new QCheckBox( bg );
+     Continuous->setText( tr( "Continuous" ) );
+-    bg = new QButtonGroup(2, Qt::Horizontal, "Background", this);
++    bg = new Q3ButtonGroup(2, Qt::Horizontal, "Background", this);
+     vl->addWidget( bg );
+ 
+ //    QLabel* TextLabel = new QLabel( bg );
+@@ -662,7 +663,7 @@ CScrollPrefs::CScrollPrefs( QWidget* parent,  const char* name, WFlags fl )
+ 
+     hl->setMargin( 0 );
+ 
+-    QButtonGroup* bg = new QButtonGroup(2, Qt::Horizontal, "Scroll", this);
++    Q3ButtonGroup* bg = new Q3ButtonGroup(2, Qt::Horizontal, "Scroll", this);
+     hl->addWidget( bg );
+ 
+     //    scrollinplace = new QCheckBox( bg );
+@@ -715,7 +716,8 @@ CScrollPrefs::CScrollPrefs( QWidget* parent,  const char* name, WFlags fl )
+ #endif
+       codecpath += "/plugins/reader/outcodecs";
+ #else
+-      QString codecpath(getenv("READERDIR"));
++      const char *rd = getenv("READERDIR");
++      QString codecpath(rd?rd:"/usr/lib/uqtreader");
+       codecpath += "/outcodecs";
+ #endif
+       QDir ocd(codecpath, "lib*.so");
+@@ -772,7 +774,7 @@ CInterPrefs::CInterPrefs( QWidget* parent,  const char* name, WFlags fl )
+ {
+     QHBoxLayout* hb = new QHBoxLayout(this);
+ 
+-    QGroupBox* gb = new QGroupBox(1, Qt::Horizontal, tr("International"), this);
++    Q3GroupBox* gb = new Q3GroupBox(1, Qt::Horizontal, tr("International"), this);
+ 
+     hb->addWidget(gb);
+ 
+@@ -784,7 +786,7 @@ CInterPrefs::CInterPrefs( QWidget* parent,  const char* name, WFlags fl )
+     TextLabel = new QLabel( gb );
+     TextLabel->setText( tr( "Ideogram Width" ) );
+     ideogramwidth = new QSpinBox( gb );
+-    ideogramwidth->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
++    // ideogramwidth->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
+     ideogramwidth->setRange(1,200);
+ 
+     propfontchange = new QCheckBox( gb );
+@@ -809,7 +811,7 @@ CInterPrefs::CInterPrefs( QWidget* parent,  const char* name, WFlags fl )
+ 
+     QVBoxLayout* vb = new QVBoxLayout;
+ 
+-    gb = new QGroupBox(1, Qt::Horizontal, "Dictionary", this);
++    gb = new Q3GroupBox(1, Qt::Horizontal, "Dictionary", this);
+ 
+     TextLabel = new QLabel( gb );
+     TextLabel->setText( tr( "Application" ) );
+diff --git a/Prefs.h b/Prefs.h
+index 103484e..a499506 100644
+--- a/Prefs.h
++++ b/Prefs.h
+@@ -11,11 +11,14 @@
+ 
+ #include <qvariant.h>
+ #include <qwidget.h>
+-#include <qtabdialog.h>
++#include <Qt3Support/Q3TabDialog>
+ #include <qtabwidget.h>
+ #include <qspinbox.h>
+ #include <qcheckbox.h>
+ #include <qlineedit.h>
++#include <qnamespace.h>
++using namespace Qt;
++#include <QtGui/QKeyEvent>
+ 
+ #define USECOMBO
+ 
+diff --git a/QFloatBar.h b/QFloatBar.h
+index cc98233..0144fce 100644
+--- a/QFloatBar.h
++++ b/QFloatBar.h
+@@ -1,10 +1,11 @@
+ #ifndef __QFLOATBAR_H
+ #define __QFLOATBAR_H
+ 
+-#include <qtoolbar.h>
+-#include <qmainwindow.h>
++#include <Qt3Support/Q3ToolBar>
++#include <Qt3Support/Q3MainWindow>
++#include <qnamespace.h>
+ 
+-class QFloatBar : public QToolBar
++class QFloatBar : public Q3ToolBar
+ {
+     Q_OBJECT
+ 	virtual void hideEvent(QHideEvent* e)
+@@ -12,7 +13,7 @@ class QFloatBar : public QToolBar
+ 	    /*if (e->spontaneous())*/ emit OnHide();
+ 	}
+ 	public:
+-    QFloatBar(char* t, QMainWindow* mw, QMainWindow::ToolBarDock td, bool f) : QToolBar(t, mw, td, f) {}
++    QFloatBar(char* t, Q3MainWindow* mw, Qt::ToolBarDock td, bool f) : Q3ToolBar(t, mw, td, f) {}
+  signals:
+     void OnHide();
+ };
+diff --git a/QTReader.cpp b/QTReader.cpp
+index 75da8ac..2c698ba 100644
+--- a/QTReader.cpp
++++ b/QTReader.cpp
+@@ -1999,6 +1999,7 @@ void QTReader::drawFonts()
+ 	      }
+ 	  }
+ 	emitRedraw();
++	update();
+     }
+ /*
+     else
+@@ -2221,7 +2222,7 @@ void QTR%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list