summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/QTReaderApp.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp279
1 files changed, 140 insertions, 139 deletions
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index b072854..f18cb59 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -17,20 +17,48 @@
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20
20#include "useqpe.h" 21#include "useqpe.h"
21#include <qregexp.h> 22#include "QTReader.h"
22#include <qclipboard.h> 23#include "GraphicWin.h"
23#include <qwidgetstack.h> 24#include "Bkmks.h"
25#include "cbkmkselector.h"
26#include "infowin.h"
27#include "ToolbarPrefs.h"
28#include "Prefs.h"
29#include "CAnnoEdit.h"
30#include "QFloatBar.h"
31#include "FixedFont.h"
32#include "URLDialog.h"
33#include "QTReaderApp.h"
34#include "CDrawBuffer.h"
35#include "Filedata.h"
36#include "opie.h"
37#include "names.h"
38#include "CEncoding_tables.h"
39#include "CloseDialog.h"
40
41/* OPIE */
42#include <opie2/odebug.h>
43#ifdef USEQPE
44#include <qpe/menubutton.h>
45#include <qpe/fontdatabase.h>
46#include <qpe/global.h>
47#include <qpe/applnk.h>
48#include <qpe/config.h>
49#include <qpe/qcopenvelope_qws.h>
50#endif
51
52/* QT */
24#ifdef USEQPE 53#ifdef USEQPE
25#include <qmenubar.h> 54#include <qmenubar.h>
26#include <qtoolbar.h> 55#include <qtoolbar.h>
27#endif 56#endif
57#include <qregexp.h>
58#include <qclipboard.h>
59#include <qwidgetstack.h>
28#include <qmenubar.h> 60#include <qmenubar.h>
29#include <qtoolbar.h> 61#include <qtoolbar.h>
30#ifdef USEQPE
31#include <qpe/menubutton.h>
32#include <qpe/fontdatabase.h>
33#endif
34#include <qcombobox.h> 62#include <qcombobox.h>
35#include <qpopupmenu.h> 63#include <qpopupmenu.h>
36#include <qaction.h> 64#include <qaction.h>
@@ -39,33 +67,14 @@
39#include <qtoolbutton.h> 67#include <qtoolbutton.h>
40#include <qspinbox.h> 68#include <qspinbox.h>
41#include <qobjectlist.h> 69#include <qobjectlist.h>
42#ifdef USEQPE
43#include <qpe/global.h>
44#include <qpe/applnk.h>
45#endif
46#include <qfileinfo.h> 70#include <qfileinfo.h>
47#include <stdlib.h> //getenv
48#include <qprogressbar.h> 71#include <qprogressbar.h>
49#ifdef USEQPE
50#include <qpe/config.h>
51#endif
52#include <qbuttongroup.h> 72#include <qbuttongroup.h>
53#include <qradiobutton.h> 73#include <qradiobutton.h>
54#ifdef USEQPE 74
55#include <qpe/qcopenvelope_qws.h> 75/* STD */
56#endif 76#include <stdlib.h> //getenv
57#include "QTReader.h" 77
58#include "GraphicWin.h"
59#include "Bkmks.h"
60#include "cbkmkselector.h"
61#include "infowin.h"
62#include "ToolbarPrefs.h"
63#include "Prefs.h"
64#include "CAnnoEdit.h"
65#include "QFloatBar.h"
66#include "FixedFont.h"
67#include "URLDialog.h"
68//#include <qpe/fontdatabase.h>
69 78
70#ifdef USEQPE 79#ifdef USEQPE
71#include <qpe/resource.h> 80#include <qpe/resource.h>
@@ -75,14 +84,6 @@
75#include "qfiledialog.h" 84#include "qfiledialog.h"
76#endif 85#endif
77 86
78#include "QTReaderApp.h"
79#include "CDrawBuffer.h"
80#include "Filedata.h"
81#include "opie.h"
82#include "names.h"
83#include "CEncoding_tables.h"
84#include "CloseDialog.h"
85
86bool CheckVersion(int&, int&, char&); 87bool CheckVersion(int&, int&, char&);
87 88
88#ifdef _WINDOWS 89#ifdef _WINDOWS
@@ -125,7 +126,7 @@ void QTReaderApp::listBkmkFiles()
125 126
126 QDir d = QDir::home(); // "/" 127 QDir d = QDir::home(); // "/"
127 if ( !d.cd(APPDIR) ) { // "/tmp" 128 if ( !d.cd(APPDIR) ) { // "/tmp"
128 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 129 owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl;
129 d = QDir::home(); 130 d = QDir::home();
130 d.mkdir(APPDIR); 131 d.mkdir(APPDIR);
131 d.cd(APPDIR); 132 d.cd(APPDIR);
@@ -146,7 +147,7 @@ void QTReaderApp::listBkmkFiles()
146 bkmkselector->insertItem(fi->fileName()); 147 bkmkselector->insertItem(fi->fileName());
147 cnt++; 148 cnt++;
148 149
149 //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); 150 //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl;
150 ++it; // goto next list element 151 ++it; // goto next list element
151 } 152 }
152 153
@@ -214,8 +215,8 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
214 m_url_localfile = false; 215 m_url_localfile = false;
215 m_url_globalfile = false; 216 m_url_globalfile = false;
216 ftime(&m_lastkeytime); 217 ftime(&m_lastkeytime);
217//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir()); 218//// odebug << "Application directory = " << (const tchar *)QPEApplication::documentDir() << "" << oendl;
218//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml")); 219//// odebug << "Application directory = " << (const tchar *)Global::applicationFileName("uqtreader" << "" << oendl;
219 220
220 m_bcloseDisabled = true; 221 m_bcloseDisabled = true;
221 m_disableesckey = false; 222 m_disableesckey = false;
@@ -243,7 +244,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
243 m_rot = 270; 244 m_rot = 270;
244 } 245 }
245 246
246// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot); 247// odebug << "Initial Rotation(" << m_rot << "):" << rot << "" << oendl;
247*/ 248*/
248 m_autogenstr = "^ *[A-Z].*[a-z] *$"; 249 m_autogenstr = "^ *[A-Z].*[a-z] *$";
249 250
@@ -260,13 +261,13 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
260#else 261#else
261 QDir d = QDir::home(); // "/" 262 QDir d = QDir::home(); // "/"
262 if ( !d.cd(APPDIR) ) { // "/tmp" 263 if ( !d.cd(APPDIR) ) { // "/tmp"
263 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 264 owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl;
264 d = QDir::home(); 265 d = QDir::home();
265 d.mkdir(APPDIR); 266 d.mkdir(APPDIR);
266 d.cd(APPDIR); 267 d.cd(APPDIR);
267 } 268 }
268 QFileInfo fi(d, INIFILE); 269 QFileInfo fi(d, INIFILE);
269// qDebug("Path:%s", (const char*)fi.absFilePath()); 270// odebug << "Path:" << fi.absFilePath() << "" << oendl;
270 Config config(fi.absFilePath()); 271 Config config(fi.absFilePath());
271#endif 272#endif
272 config.setGroup("Toolbar"); 273 config.setGroup("Toolbar");
@@ -356,7 +357,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
356 // don't need the close visible, it is redundant... 357 // don't need the close visible, it is redundant...
357 importSelector->setCloseVisible( FALSE ); 358 importSelector->setCloseVisible( FALSE );
358*/ 359*/
359// qDebug("Reading file list"); 360// odebug << "Reading file list" << oendl;
360 readfilelist(); 361 readfilelist();
361 362
362 reader = new QTReader( editorStack ); 363 reader = new QTReader( editorStack );
@@ -367,7 +368,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
367 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold); 368 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold);
368#endif 369#endif
369 370
370// qDebug("Reading config"); 371// odebug << "Reading config" << oendl;
371// Config config( APPDIR ); 372// Config config( APPDIR );
372 config.setGroup( "View" ); 373 config.setGroup( "View" );
373 m_debounce = config.readNumEntry("Debounce", 0); 374 m_debounce = config.readNumEntry("Debounce", 0);
@@ -769,7 +770,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
769 770
770 m_fontBar->setHorizontalStretchable( TRUE ); 771 m_fontBar->setHorizontalStretchable( TRUE );
771 772
772// qDebug("Font selector"); 773// odebug << "Font selector" << oendl;
773 m_fontSelector = new QComboBox(false, m_fontBar); 774 m_fontSelector = new QComboBox(false, m_fontBar);
774 m_fontBar->setStretchableWidget( m_fontSelector ); 775 m_fontBar->setStretchableWidget( m_fontSelector );
775 { 776 {
@@ -801,17 +802,17 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
801 connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), 802 connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
802 this, SLOT( msgHandler(const QCString&,const QByteArray&) ) ); 803 this, SLOT( msgHandler(const QCString&,const QByteArray&) ) );
803#endif 804#endif
804// qDebug("Initing"); 805// odebug << "Initing" << oendl;
805 reader->init(); 806 reader->init();
806// qDebug("Inited"); 807// odebug << "Inited" << oendl;
807// m_buttonAction[m_spaceTarget]->setOn(true); 808// m_buttonAction[m_spaceTarget]->setOn(true);
808// qDebug("fonting"); 809// odebug << "fonting" << oendl;
809 do_setfont(reader->m_fontname); 810 do_setfont(reader->m_fontname);
810 if (!reader->m_lastfile.isEmpty()) 811 if (!reader->m_lastfile.isEmpty())
811 { 812 {
812 //qDebug("doclnk"); 813// odebug << "doclnk" << oendl;
813 //doc = new DocLnk(reader->m_lastfile); 814 //doc = new DocLnk(reader->m_lastfile);
814 //qDebug("doclnk done"); 815// odebug << "doclnk done" << oendl;
815 if (pOpenlist != NULL) 816 if (pOpenlist != NULL)
816 { 817 {
817 818
@@ -831,24 +832,24 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
831 { 832 {
832 break; 833 break;
833 } 834 }
834 // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name())); 835// odebug << "Item:" << toQString(CFiledata(p->anno()).name()) << "" << oendl;
835 p = NULL; 836 p = NULL;
836 } 837 }
837 if (p != NULL) 838 if (p != NULL)
838 { 839 {
839 //qDebug("openfrombkmk"); 840// odebug << "openfrombkmk" << oendl;
840 if (!openfrombkmk(p)) 841 if (!openfrombkmk(p))
841 showEditTools(); 842 showEditTools();
842 } 843 }
843 else 844 else
844 { 845 {
845 //qDebug("openfile"); 846// odebug << "openfile" << oendl;
846 openFile( reader->m_lastfile ); 847 openFile( reader->m_lastfile );
847 } 848 }
848 } 849 }
849 else 850 else
850 { 851 {
851 // qDebug("Openfile 2"); 852// odebug << "Openfile 2" << oendl;
852 if (!reader->m_lastfile.isEmpty()) 853 if (!reader->m_lastfile.isEmpty())
853 openFile( reader->m_lastfile ); 854 openFile( reader->m_lastfile );
854 } 855 }
@@ -870,7 +871,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
870 config.writeEntry("BkmkType", bkmktype); 871 config.writeEntry("BkmkType", bkmktype);
871 config.writeEntry("Minor", (int)minor); 872 config.writeEntry("Minor", (int)minor);
872 } 873 }
873// qDebug("finished update"); 874// odebug << "finished update" << oendl;
874} 875}
875 876
876void QTReaderApp::addtoolbars(Config* config) 877void QTReaderApp::addtoolbars(Config* config)
@@ -1028,14 +1029,14 @@ QToolBar* QTReaderApp::filebar()
1028 switch (m_tbpol) 1029 switch (m_tbpol)
1029 { 1030 {
1030 case cesSingle: 1031 case cesSingle:
1031 // qDebug("Setting filebar to menubar"); 1032// odebug << "Setting filebar to menubar" << oendl;
1032 fileBar = menubar; 1033 fileBar = menubar;
1033 break; 1034 break;
1034 default: 1035 default:
1035 qDebug("Incorrect toolbar policy set"); 1036 odebug << "Incorrect toolbar policy set" << oendl;
1036 case cesMenuTool: 1037 case cesMenuTool:
1037 case cesMultiple: 1038 case cesMultiple:
1038 // qDebug("Creating new file bar"); 1039// odebug << "Creating new file bar" << oendl;
1039 fileBar = new QToolBar("File", this, m_tbposition); 1040 fileBar = new QToolBar("File", this, m_tbposition);
1040 break; 1041 break;
1041 } 1042 }
@@ -1053,7 +1054,7 @@ QToolBar* QTReaderApp::viewbar()
1053 viewBar = new QToolBar("View", this, m_tbposition); 1054 viewBar = new QToolBar("View", this, m_tbposition);
1054 break; 1055 break;
1055 default: 1056 default:
1056 qDebug("Incorrect toolbar policy set"); 1057 odebug << "Incorrect toolbar policy set" << oendl;
1057 case cesSingle: 1058 case cesSingle:
1058 case cesMenuTool: 1059 case cesMenuTool:
1059 viewBar = fileBar; 1060 viewBar = fileBar;
@@ -1069,15 +1070,15 @@ QToolBar* QTReaderApp::navbar()
1069 switch (m_tbpol) 1070 switch (m_tbpol)
1070 { 1071 {
1071 case cesMultiple: 1072 case cesMultiple:
1072 // qDebug("Creating new nav bar"); 1073// odebug << "Creating new nav bar" << oendl;
1073 navBar = new QToolBar("Navigation", this, m_tbposition); 1074 navBar = new QToolBar("Navigation", this, m_tbposition);
1074 break; 1075 break;
1075 default: 1076 default:
1076 qDebug("Incorrect toolbar policy set"); 1077 odebug << "Incorrect toolbar policy set" << oendl;
1077 case cesSingle: 1078 case cesSingle:
1078 case cesMenuTool: 1079 case cesMenuTool:
1079 navBar = fileBar; 1080 navBar = fileBar;
1080 // qDebug("Setting navbar to filebar"); 1081// odebug << "Setting navbar to filebar" << oendl;
1081 break; 1082 break;
1082 } 1083 }
1083 } 1084 }
@@ -1093,7 +1094,7 @@ QToolBar* QTReaderApp::markbar()
1093 markBar = new QToolBar("Marks", this, m_tbposition); 1094 markBar = new QToolBar("Marks", this, m_tbposition);
1094 break; 1095 break;
1095 default: 1096 default:
1096 qDebug("Incorrect toolbar policy set"); 1097 odebug << "Incorrect toolbar policy set" << oendl;
1097 case cesSingle: 1098 case cesSingle:
1098 case cesMenuTool: 1099 case cesMenuTool:
1099 markBar = fileBar; 1100 markBar = fileBar;
@@ -1127,7 +1128,7 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data)
1127{ 1128{
1128 QString msg = QString::fromUtf8(_msg); 1129 QString msg = QString::fromUtf8(_msg);
1129 1130
1130//// qDebug("Received:%s", (const char*)msg); 1131//// odebug << "Received:" << msg << "" << oendl;
1131 1132
1132 QDataStream stream( _data, IO_ReadOnly ); 1133 QDataStream stream( _data, IO_ReadOnly );
1133 if ( msg == "info(QString)" ) 1134 if ( msg == "info(QString)" )
@@ -1481,7 +1482,7 @@ void QTReaderApp::setfullscreen(bool sfs)
1481 1482
1482void QTReaderApp::buttonActionSelected(QAction* _a) 1483void QTReaderApp::buttonActionSelected(QAction* _a)
1483{ 1484{
1484//// qDebug("es:%x : %s (%u)", _a, (const char *)(_a->text()), ActNameToInt(_a->text())); 1485//// odebug << "es:" << _a << " : " << (const char *)(_a->text()) << " (" << ActNameToInt(_a->text()) << ")" << oendl;
1485 m_spaceTarget = ActNameToInt(_a->text()); 1486 m_spaceTarget = ActNameToInt(_a->text());
1486} 1487}
1487 1488
@@ -1563,7 +1564,7 @@ void QTReaderApp::updatefileinfo()
1563 if (reader->m_lastfile.isEmpty()) return; 1564 if (reader->m_lastfile.isEmpty()) return;
1564 tchar* nm = fromQString(reader->m_string); 1565 tchar* nm = fromQString(reader->m_string);
1565 tchar* fl = fromQString(reader->m_lastfile); 1566 tchar* fl = fromQString(reader->m_lastfile);
1566// qDebug("Lastfile:%x", fl); 1567// odebug << "Lastfile:" << fl << "" << oendl;
1567 bool notadded = true; 1568 bool notadded = true;
1568 if (pOpenlist == NULL) pOpenlist = new CList<Bkmk>; 1569 if (pOpenlist == NULL) pOpenlist = new CList<Bkmk>;
1569 else 1570 else
@@ -1577,7 +1578,7 @@ void QTReaderApp::updatefileinfo()
1577 unsigned char* data; 1578 unsigned char* data;
1578 CFiledata fd(iter->anno()); 1579 CFiledata fd(iter->anno());
1579 reader->setSaveData(data, dlen, fd.content(), fd.length()); 1580 reader->setSaveData(data, dlen, fd.content(), fd.length());
1580 // qDebug("Filedata(1):%u, %u", fd.length(), dlen); 1581// odebug << "Filedata(1):" << fd.length() << ", " << dlen << "" << oendl;
1581 // getstate(data, dlen); 1582 // getstate(data, dlen);
1582 iter->setAnno(data, dlen); 1583 iter->setAnno(data, dlen);
1583 notadded = false; 1584 notadded = false;
@@ -1586,7 +1587,7 @@ void QTReaderApp::updatefileinfo()
1586 } 1587 }
1587 } 1588 }
1588 } 1589 }
1589// qDebug("Added?:%x", notadded); 1590// odebug << "Added?:" << notadded << "" << oendl;
1590 if (notadded) 1591 if (notadded)
1591 { 1592 {
1592 struct stat fnstat; 1593 struct stat fnstat;
@@ -1596,7 +1597,7 @@ void QTReaderApp::updatefileinfo()
1596 unsigned char* data; 1597 unsigned char* data;
1597 reader->setSaveData(data, dlen, fd.content(), fd.length()); 1598 reader->setSaveData(data, dlen, fd.content(), fd.length());
1598 pOpenlist->push_front(Bkmk(nm, data, dlen, reader->pagelocate())); 1599 pOpenlist->push_front(Bkmk(nm, data, dlen, reader->pagelocate()));
1599 //qDebug("Filedata(2):%u, %u", fd.length(), dlen); 1600// odebug << "Filedata(2):" << fd.length() << ", " << dlen << "" << oendl;
1600 delete [] data; 1601 delete [] data;
1601 } 1602 }
1602 delete [] nm; 1603 delete [] nm;
@@ -1611,7 +1612,7 @@ void QTReaderApp::fileOpen()
1611 if (regVisible) regBar->hide(); 1612 if (regVisible) regBar->hide();
1612 if (searchVisible) searchBar->hide(); 1613 if (searchVisible) searchBar->hide();
1613*/ 1614*/
1614// qDebug("fileOpen"); 1615// odebug << "fileOpen" << oendl;
1615// if (!reader->m_lastfile.isEmpty()) 1616// if (!reader->m_lastfile.isEmpty())
1616 updatefileinfo(); 1617 updatefileinfo();
1617 fileOpen2(); 1618 fileOpen2();
@@ -1652,7 +1653,7 @@ void QTReaderApp::fileOpen2()
1652 reader->setFocus(); 1653 reader->setFocus();
1653 } 1654 }
1654// reader->refresh(); 1655// reader->refresh();
1655// qDebug("HEIGHT:%d", reader->m_lastheight); 1656// odebug << "HEIGHT:" << reader->m_lastheight << "" << oendl;
1656} 1657}
1657 1658
1658QString QTReaderApp::usefilebrowser() 1659QString QTReaderApp::usefilebrowser()
@@ -1672,7 +1673,7 @@ QString QTReaderApp::usefilebrowser()
1672 { 1673 {
1673 fn = fb->getCurrentFile(); 1674 fn = fb->getCurrentFile();
1674 } 1675 }
1675// qDebug("Selected %s", (const char*)fn); 1676// odebug << "Selected " << fn << "" << oendl;
1676 delete fb; 1677 delete fb;
1677 showEditTools(); 1678 showEditTools();
1678 return fn; 1679 return fn;
@@ -1803,7 +1804,7 @@ void QTReaderApp::showprefs()
1803 reader->bpeanut = true; 1804 reader->bpeanut = true;
1804 break; 1805 break;
1805 default: 1806 default:
1806 qDebug("Format out of range"); 1807 odebug << "Format out of range" << oendl;
1807 } 1808 }
1808 reader->bdepluck = prefwin->Depluck(); 1809 reader->bdepluck = prefwin->Depluck();
1809 reader->bdejpluck = prefwin->Dejpluck(); 1810 reader->bdejpluck = prefwin->Dejpluck();
@@ -1863,7 +1864,7 @@ void QTReaderApp::showtoolbarprefs()
1863 QDir d = QDir::home(); // "/" 1864 QDir d = QDir::home(); // "/"
1864 if ( !d.cd(APPDIR) ) 1865 if ( !d.cd(APPDIR) )
1865 { // "/tmp" 1866 { // "/tmp"
1866 qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); 1867 owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl;
1867 d = QDir::home(); 1868 d = QDir::home();
1868 d.mkdir(APPDIR); 1869 d.mkdir(APPDIR);
1869 d.cd(APPDIR); 1870 d.cd(APPDIR);
@@ -1900,7 +1901,7 @@ void QTReaderApp::showtoolbarprefs()
1900 QDir d = QDir::home(); // "/" 1901 QDir d = QDir::home(); // "/"
1901 if ( !d.cd(APPDIR) ) 1902 if ( !d.cd(APPDIR) )
1902 { // "/tmp" 1903 { // "/tmp"
1903 qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); 1904 owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl;
1904 d = QDir::home(); 1905 d = QDir::home();
1905 d.mkdir(APPDIR); 1906 d.mkdir(APPDIR);
1906 d.cd(APPDIR); 1907 d.cd(APPDIR);
@@ -2175,7 +2176,7 @@ void QTReaderApp::editFind()
2175 2176
2176void QTReaderApp::findNext() 2177void QTReaderApp::findNext()
2177{ 2178{
2178// // qDebug("findNext called\n"); 2179// // odebug << "findNext called\n" << oendl;
2179#ifdef __ISEARCH 2180#ifdef __ISEARCH
2180 QString arg = searchEdit->text(); 2181 QString arg = searchEdit->text();
2181#else 2182#else
@@ -2271,12 +2272,12 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg)
2271 return false; 2272 return false;
2272 } 2273 }
2273 } 2274 }
2274// qDebug("Found it at %u:%u", pos, offset); 2275// odebug << "Found it at " << pos << ":" << offset << "" << oendl;
2275 pbar->hide(); 2276 pbar->hide();
2276// qDebug("Hid"); 2277// odebug << "Hid" << oendl;
2277 reader->locate(pos+offset); 2278 reader->locate(pos+offset);
2278// qDebug("Loacted"); 2279// odebug << "Loacted" << oendl;
2279// qDebug("page up"); 2280// odebug << "page up" << oendl;
2280 ret = true; 2281 ret = true;
2281 } 2282 }
2282 else 2283 else
@@ -2333,7 +2334,7 @@ void QTReaderApp::search()
2333 2334
2334void QTReaderApp::openFile( const QString &f ) 2335void QTReaderApp::openFile( const QString &f )
2335{ 2336{
2336// qDebug("File:%s", (const char*)f); 2337// odebug << "File:" << f << "" << oendl;
2337// openFile(DocLnk(f)); 2338// openFile(DocLnk(f));
2338//} 2339//}
2339// 2340//
@@ -2380,7 +2381,7 @@ void QTReaderApp::resizeEvent(QResizeEvent* e)
2380*/ 2381*/
2381void QTReaderApp::handlekey(QKeyEvent* e) 2382void QTReaderApp::handlekey(QKeyEvent* e)
2382{ 2383{
2383// qDebug("Keypress event"); 2384// odebug << "Keypress event" << oendl;
2384 timeb now; 2385 timeb now;
2385 ftime(&now); 2386 ftime(&now);
2386 unsigned long etime = (1000*(now.time - m_lastkeytime.time) + now.millitm)-m_lastkeytime.millitm; 2387 unsigned long etime = (1000*(now.time - m_lastkeytime.time) + now.millitm)-m_lastkeytime.millitm;
@@ -2392,7 +2393,7 @@ void QTReaderApp::handlekey(QKeyEvent* e)
2392 switch(e->key()) 2393 switch(e->key())
2393 { 2394 {
2394 case Key_Escape: 2395 case Key_Escape:
2395 // qDebug("escape event"); 2396// odebug << "escape event" << oendl;
2396 if (m_disableesckey) 2397 if (m_disableesckey)
2397 { 2398 {
2398 m_disableesckey = false; 2399 m_disableesckey = false;
@@ -2407,7 +2408,7 @@ void QTReaderApp::handlekey(QKeyEvent* e)
2407 } 2408 }
2408 else 2409 else
2409 { 2410 {
2410 // qDebug("escape action"); 2411// odebug << "escape action" << oendl;
2411 doAction(m_escapeTarget, e); 2412 doAction(m_escapeTarget, e);
2412 } 2413 }
2413 } 2414 }
@@ -2506,11 +2507,11 @@ void QTReaderApp::showEditTools()
2506 } 2507 }
2507 else 2508 else
2508 { 2509 {
2509 //qDebug("him"); 2510// odebug << "him" << oendl;
2510#ifdef USEQPE 2511#ifdef USEQPE
2511 Global::hideInputMethod(); 2512 Global::hideInputMethod();
2512#endif 2513#endif
2513 //qDebug("eb"); 2514// odebug << "eb" << oendl;
2514 menubar->show(); 2515 menubar->show();
2515 if (fileBar != NULL) fileBar->show(); 2516 if (fileBar != NULL) fileBar->show();
2516 if (viewBar != NULL) viewBar->show(); 2517 if (viewBar != NULL) viewBar->show();
@@ -2532,20 +2533,20 @@ void QTReaderApp::showEditTools()
2532 regBar->show(); 2533 regBar->show();
2533 } 2534 }
2534 if (m_fontVisible) m_fontBar->show(); 2535 if (m_fontVisible) m_fontBar->show();
2535 //qDebug("sn"); 2536// odebug << "sn" << oendl;
2536 showNormal(); 2537 showNormal();
2537 //qDebug("sm"); 2538// odebug << "sm" << oendl;
2538#ifdef USEQPE 2539#ifdef USEQPE
2539 showMaximized(); 2540 showMaximized();
2540#endif 2541#endif
2541 //setCentralWidget(reader); 2542 //setCentralWidget(reader);
2542 } 2543 }
2543 2544
2544// qDebug("uc"); 2545// odebug << "uc" << oendl;
2545 updateCaption(); 2546 updateCaption();
2546// qDebug("rw"); 2547// odebug << "rw" << oendl;
2547 editorStack->raiseWidget( reader ); 2548 editorStack->raiseWidget( reader );
2548// qDebug("sf"); 2549// odebug << "sf" << oendl;
2549 reader->setFocus(); 2550 reader->setFocus();
2550 reader->refresh(); 2551 reader->refresh();
2551} 2552}
@@ -2614,7 +2615,7 @@ void QTReaderApp::setDocument(const QString& fileref)
2614 2615
2615void QTReaderApp::closeEvent( QCloseEvent *e ) 2616void QTReaderApp::closeEvent( QCloseEvent *e )
2616{ 2617{
2617// qDebug("Close event"); 2618// odebug << "Close event" << oendl;
2618 if (m_fullscreen) 2619 if (m_fullscreen)
2619 { 2620 {
2620 m_fullscreen = false; 2621 m_fullscreen = false;
@@ -2631,7 +2632,7 @@ void QTReaderApp::closeEvent( QCloseEvent *e )
2631 { 2632 {
2632 if ((m_escapeTarget != cesNone) && m_bcloseDisabled) 2633 if ((m_escapeTarget != cesNone) && m_bcloseDisabled)
2633 { 2634 {
2634 //qDebug("Close disabled"); 2635// odebug << "Close disabled" << oendl;
2635 m_bcloseDisabled = false; 2636 m_bcloseDisabled = false;
2636 e->ignore(); 2637 e->ignore();
2637 } 2638 }
@@ -2709,7 +2710,7 @@ bool QTReaderApp::listbkmk(CList<Bkmk>* plist, const QString& _lab)
2709 for (CList<Bkmk>::iterator i = plist->begin(); i != plist->end(); i++) 2710 for (CList<Bkmk>::iterator i = plist->begin(); i != plist->end(); i++)
2710 { 2711 {
2711#ifdef _UNICODE 2712#ifdef _UNICODE
2712 // qDebug("Item:%s", (const char*)toQString(i->name())); 2713// odebug << "Item:" << toQString(i->name()) << "" << oendl;
2713 bkmkselector->insertItem(toQString(i->name())); 2714 bkmkselector->insertItem(toQString(i->name()));
2714#else 2715#else
2715 bkmkselector->insertItem(i->name()); 2716 bkmkselector->insertItem(i->name());
@@ -2738,9 +2739,9 @@ void QTReaderApp::do_regedit()
2738{ 2739{
2739// fileBar->hide(); 2740// fileBar->hide();
2740 reader->bDoUpdates = false; 2741 reader->bDoUpdates = false;
2741// qDebug("Showing regbar"); 2742// odebug << "Showing regbar" << oendl;
2742 regBar->show(); 2743 regBar->show();
2743// qDebug("Showing kbd"); 2744// odebug << "Showing kbd" << oendl;
2744#ifdef USEQPE 2745#ifdef USEQPE
2745 Global::showInputMethod(); 2746 Global::showInputMethod();
2746#endif 2747#endif
@@ -2756,10 +2757,10 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk)
2756 QString fn = toQString( 2757 QString fn = toQString(
2757 CFiledata(bk->anno()).name() 2758 CFiledata(bk->anno()).name()
2758 ); 2759 );
2759 //qDebug("fileinfo"); 2760// odebug << "fileinfo" << oendl;
2760 if (!fn.isEmpty() && QFileInfo(fn).isFile()) 2761 if (!fn.isEmpty() && QFileInfo(fn).isFile())
2761 { 2762 {
2762 //qDebug("Opening"); 2763// odebug << "Opening" << oendl;
2763 openFile(fn); 2764 openFile(fn);
2764 struct stat fnstat; 2765 struct stat fnstat;
2765 stat((const char *)reader->m_lastfile, &fnstat); 2766 stat((const char *)reader->m_lastfile, &fnstat);
@@ -2781,7 +2782,7 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk)
2781 { 2782 {
2782 QMessageBox::warning(this, PROGNAME, "Not all file data used\nNew version?"); 2783 QMessageBox::warning(this, PROGNAME, "Not all file data used\nNew version?");
2783 } 2784 }
2784 // qDebug("updating"); 2785// odebug << "updating" << oendl;
2785 // showEditTools(); 2786 // showEditTools();
2786 reader->locate(bk->value()); 2787 reader->locate(bk->value());
2787 } 2788 }
@@ -2812,7 +2813,7 @@ void QTReaderApp::gotobkmk(int ind)
2812 reader->locate((*pBkmklist)[ind]->value()); 2813 reader->locate((*pBkmklist)[ind]->value());
2813 break; 2814 break;
2814 case cDelBkmk: 2815 case cDelBkmk:
2815 //// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); 2816//// odebug << "Deleting:" << (*pBkmklist)[ind]->name() << "\n" << oendl;
2816 pBkmklist->erase(ind); 2817 pBkmklist->erase(ind);
2817 m_fBkmksChanged = true; 2818 m_fBkmksChanged = true;
2818 // pBkmklist->sort(); 2819 // pBkmklist->sort();
@@ -2912,7 +2913,7 @@ void QTReaderApp::gotobkmk(int ind)
2912/* 2913/*
2913 CFileSelector *f = new CFileSelector("text/html", this, NULL, !m_bFloatingDialog, TRUE, TRUE ); 2914 CFileSelector *f = new CFileSelector("text/html", this, NULL, !m_bFloatingDialog, TRUE, TRUE );
2914 int ret = f->exec(); 2915 int ret = f->exec();
2915 qDebug("Return:%d", ret); 2916 odebug << "Return:" << ret << "" << oendl;
2916 DocLnk* doc = f->getDoc(); 2917 DocLnk* doc = f->getDoc();
2917 if (doc != NULL) 2918 if (doc != NULL)
2918 { 2919 {
@@ -2932,11 +2933,11 @@ void QTReaderApp::gotobkmk(int ind)
2932 } 2933 }
2933 FileManager fm; 2934 FileManager fm;
2934 fm.saveFile( *doc, rt ); 2935 fm.saveFile( *doc, rt );
2935 qDebug("YES"); 2936 odebug << "YES" << oendl;
2936 } 2937 }
2937 else 2938 else
2938 { 2939 {
2939 qDebug("NO"); 2940 odebug << "NO" << oendl;
2940 } 2941 }
2941 delete f; 2942 delete f;
2942*/ 2943*/
@@ -3009,7 +3010,7 @@ void QTReaderApp::do_regaction()
3009 break; 3010 break;
3010#endif 3011#endif
3011 case cSetConfigName: 3012 case cSetConfigName:
3012 // qDebug("Saving config"); 3013// odebug << "Saving config" << oendl;
3013 do_saveconfig(regEdit->text(), false); 3014 do_saveconfig(regEdit->text(), false);
3014 break; 3015 break;
3015 } 3016 }
@@ -3101,7 +3102,7 @@ void QTReaderApp::setfontHelper(const QString& lcn, int size)
3101 3102
3102void QTReaderApp::do_setencoding(int i) 3103void QTReaderApp::do_setencoding(int i)
3103{ 3104{
3104// qDebug("setencoding:%d", i); 3105// odebug << "setencoding:" << i << "" << oendl;
3105 if (m_fontAction == cChooseEncoding) 3106 if (m_fontAction == cChooseEncoding)
3106 { 3107 {
3107 reader->setencoding(i); 3108 reader->setencoding(i);
@@ -3109,9 +3110,9 @@ void QTReaderApp::do_setencoding(int i)
3109 reader->refresh(); 3110 reader->refresh();
3110 m_fontBar->hide(); 3111 m_fontBar->hide();
3111 m_fontVisible = false; 3112 m_fontVisible = false;
3112// qDebug("showedit"); 3113// odebug << "showedit" << oendl;
3113 if (reader->isVisible()) showEditTools(); 3114 if (reader->isVisible()) showEditTools();
3114// qDebug("showeditdone"); 3115// odebug << "showeditdone" << oendl;
3115} 3116}
3116 3117
3117void QTReaderApp::do_setfont(const QString& lcn) 3118void QTReaderApp::do_setfont(const QString& lcn)
@@ -3123,17 +3124,17 @@ void QTReaderApp::do_setfont(const QString& lcn)
3123 reader->refresh(); 3124 reader->refresh();
3124 m_fontBar->hide(); 3125 m_fontBar->hide();
3125 m_fontVisible = false; 3126 m_fontVisible = false;
3126// qDebug("showedit"); 3127// odebug << "showedit" << oendl;
3127 //if (reader->isVisible()) 3128 //if (reader->isVisible())
3128 showEditTools(); 3129 showEditTools();
3129// qDebug("showeditdone"); 3130// odebug << "showeditdone" << oendl;
3130} 3131}
3131 3132
3132void QTReaderApp::do_autogen(const QString& regText) 3133void QTReaderApp::do_autogen(const QString& regText)
3133{ 3134{
3134 unsigned long fs, ts; 3135 unsigned long fs, ts;
3135 reader->sizes(fs,ts); 3136 reader->sizes(fs,ts);
3136// // qDebug("Reg:%s\n", (const tchar*)(regEdit->text())); 3137// // odebug << "Reg:" << (const tchar*)(regEdit->text()) << "\n" << oendl;
3137 m_autogenstr = regText; 3138 m_autogenstr = regText;
3138 QRegExp re(regText); 3139 QRegExp re(regText);
3139 CBuffer buff; 3140 CBuffer buff;
@@ -3180,7 +3181,7 @@ void QTReaderApp::do_autogen(const QString& regText)
3180 3181
3181void QTReaderApp::saveprefs() 3182void QTReaderApp::saveprefs()
3182{ 3183{
3183// qDebug("saveprefs"); 3184// odebug << "saveprefs" << oendl;
3184// reader->saveprefs("uqtreader"); 3185// reader->saveprefs("uqtreader");
3185// if (!m_loadedconfig) 3186// if (!m_loadedconfig)
3186 do_saveconfig( APPDIR, true ); 3187 do_saveconfig( APPDIR, true );
@@ -3261,11 +3262,11 @@ void QTReaderApp::saveprefs()
3261/* 3262/*
3262void QTReaderApp::oldFile() 3263void QTReaderApp::oldFile()
3263{ 3264{
3264// qDebug("oldFile called"); 3265// odebug << "oldFile called" << oendl;
3265 reader->setText(true); 3266 reader->setText(true);
3266// qDebug("settext called"); 3267// odebug << "settext called" << oendl;
3267 showEditTools(); 3268 showEditTools();
3268// qDebug("showedit called"); 3269// odebug << "showedit called" << oendl;
3269} 3270}
3270*/ 3271*/
3271 3272
@@ -3341,10 +3342,10 @@ void QTReaderApp::readfilelist()
3341#else /* USEQPE */ 3342#else /* USEQPE */
3342 BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles")); 3343 BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles"));
3343#endif /* USEQPE */ 3344#endif /* USEQPE */
3344// qDebug("Reading open files"); 3345// odebug << "Reading open files" << oendl;
3345 pOpenlist = bf.readall(); 3346 pOpenlist = bf.readall();
3346// if (pOpenlist != NULL) qDebug("...with success"); 3347// if (pOpenlist != NULL) odebug << "...with success" << oendl;
3347// else qDebug("...without success!"); 3348// else odebug << "...without success!" << oendl;
3348} 3349}
3349 3350
3350void QTReaderApp::savefilelist() 3351void QTReaderApp::savefilelist()
@@ -3359,7 +3360,7 @@ void QTReaderApp::savefilelist()
3359#else /* USEQPE */ 3360#else /* USEQPE */
3360 BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles"), true); 3361 BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles"), true);
3361#endif /* USEQPE */ 3362#endif /* USEQPE */
3362 //qDebug("Writing open files"); 3363// odebug << "Writing open files" << oendl;
3363 bf.write(*pOpenlist); 3364 bf.write(*pOpenlist);
3364 } 3365 }
3365} 3366}
@@ -3469,7 +3470,7 @@ void QTReaderApp::showAnnotation()
3469 3470
3470void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& line) 3471void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& line)
3471{ 3472{
3472//// qDebug("OnWordSelected(%u):%s", posn, (const char*)wrd); 3473//// odebug << "OnWordSelected(" << posn << "):" << wrd << "" << oendl;
3473 3474
3474 if (m_doClipboard) 3475 if (m_doClipboard)
3475 { 3476 {
@@ -3519,7 +3520,7 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e)
3519 else 3520 else
3520 { 3521 {
3521 e->accept(); 3522 e->accept();
3522 //qDebug("Accepted"); 3523// odebug << "Accepted" << oendl;
3523 switch (a) 3524 switch (a)
3524 { 3525 {
3525 case cesOpenFile: 3526 case cesOpenFile:
@@ -3582,7 +3583,7 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e)
3582 gotoEnd(); 3583 gotoEnd();
3583 break; 3584 break;
3584 default: 3585 default:
3585 qDebug("Unknown ActionType:%u", a); 3586 odebug << "Unknown ActionType:" << a << "" << oendl;
3586 break; 3587 break;
3587 } 3588 }
3588 } 3589 }
@@ -3600,7 +3601,7 @@ void QTReaderApp::SaveConfig()
3600 3601
3601void QTReaderApp::do_saveconfig(const QString& _txt, bool full) 3602void QTReaderApp::do_saveconfig(const QString& _txt, bool full)
3602{ 3603{
3603// qDebug("do_saveconfig:%s", (const char*)_txt); 3604// odebug << "do_saveconfig:" << _txt << "" << oendl;
3604#ifdef USEQPE 3605#ifdef USEQPE
3605 QString configname; 3606 QString configname;
3606 Config::Domain dom; 3607 Config::Domain dom;
@@ -3623,11 +3624,11 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full)
3623 QFileInfo fi; 3624 QFileInfo fi;
3624 if (full) 3625 if (full)
3625 { 3626 {
3626 // qDebug("full:%s", (const char*)_txt); 3627// odebug << "full:" << _txt << "" << oendl;
3627 QDir d = QDir::home(); // "/" 3628 QDir d = QDir::home(); // "/"
3628 if ( !d.cd(_txt) ) 3629 if ( !d.cd(_txt) )
3629 { // "/tmp" 3630 { // "/tmp"
3630 qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); 3631 owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl;
3631 d = QDir::home(); 3632 d = QDir::home();
3632 d.mkdir(_txt); 3633 d.mkdir(_txt);
3633 d.cd(_txt); 3634 d.cd(_txt);
@@ -3639,14 +3640,14 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full)
3639 QDir d = QDir::home(); // "/" 3640 QDir d = QDir::home(); // "/"
3640 if ( !d.cd(APPDIR) ) 3641 if ( !d.cd(APPDIR) )
3641 { // "/tmp" 3642 { // "/tmp"
3642 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 3643 owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl;
3643 d = QDir::home(); 3644 d = QDir::home();
3644 d.mkdir(APPDIR); 3645 d.mkdir(APPDIR);
3645 d.cd(APPDIR); 3646 d.cd(APPDIR);
3646 } 3647 }
3647 if ( !d.cd("configs") ) 3648 if ( !d.cd("configs") )
3648 { // "/tmp" 3649 { // "/tmp"
3649 qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); 3650 owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl;
3650 d = QDir::home(); 3651 d = QDir::home();
3651 d.cd(APPDIR); 3652 d.cd(APPDIR);
3652 d.mkdir("configs"); 3653 d.mkdir("configs");
@@ -3654,7 +3655,7 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full)
3654 } 3655 }
3655 fi.setFile(d, _txt); 3656 fi.setFile(d, _txt);
3656 } 3657 }
3657 //qDebug("Path:%s", (const char*)fi.absFilePath()); 3658// odebug << "Path:" << fi.absFilePath() << "" << oendl;
3658 Config config(fi.absFilePath()); 3659 Config config(fi.absFilePath());
3659#endif 3660#endif
3660 3661
@@ -3934,7 +3935,7 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false)
3934 QDir d = QDir::home(); // "/" 3935 QDir d = QDir::home(); // "/"
3935 if ( !d.cd(_txt) ) 3936 if ( !d.cd(_txt) )
3936 { // "/tmp" 3937 { // "/tmp"
3937 qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); 3938 owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl;
3938 d = QDir::home(); 3939 d = QDir::home();
3939 d.mkdir(_txt); 3940 d.mkdir(_txt);
3940 d.cd(_txt); 3941 d.cd(_txt);
@@ -3946,14 +3947,14 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false)
3946 QDir d = QDir::home(); // "/" 3947 QDir d = QDir::home(); // "/"
3947 if ( !d.cd(APPDIR) ) 3948 if ( !d.cd(APPDIR) )
3948 { // "/tmp" 3949 { // "/tmp"
3949 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 3950 owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl;
3950 d = QDir::home(); 3951 d = QDir::home();
3951 d.mkdir(APPDIR); 3952 d.mkdir(APPDIR);
3952 d.cd(APPDIR); 3953 d.cd(APPDIR);
3953 } 3954 }
3954 if ( !d.cd("configs") ) 3955 if ( !d.cd("configs") )
3955 { // "/tmp" 3956 { // "/tmp"
3956 qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); 3957 owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl;
3957 d = QDir::home(); 3958 d = QDir::home();
3958 d.mkdir("configs"); 3959 d.mkdir("configs");
3959 d.cd("configs"); 3960 d.cd("configs");
@@ -4061,13 +4062,13 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir)
4061 4062
4062 QDir d = QDir::home(); // "/" 4063 QDir d = QDir::home(); // "/"
4063 if ( !d.cd(APPDIR) ) { // "/tmp" 4064 if ( !d.cd(APPDIR) ) { // "/tmp"
4064 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 4065 owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl;
4065 d = QDir::home(); 4066 d = QDir::home();
4066 d.mkdir(APPDIR); 4067 d.mkdir(APPDIR);
4067 d.cd(APPDIR); 4068 d.cd(APPDIR);
4068 } 4069 }
4069 if ( !d.cd(tgtdir) ) { // "/tmp" 4070 if ( !d.cd(tgtdir) ) { // "/tmp"
4070 qWarning( "Cannot find the \"~/" APPDIR "/%s\" directory", tgtdir ); 4071 owarn << "Cannot find the \"~/" APPDIR "/" << tgtdir << "\" directory" << oendl;
4071 d = QDir::home(); 4072 d = QDir::home();
4072 d.mkdir(tgtdir); 4073 d.mkdir(tgtdir);
4073 d.cd(tgtdir); 4074 d.cd(tgtdir);
@@ -4084,7 +4085,7 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir)
4084 bkmkselector->insertItem(fi->fileName()); 4085 bkmkselector->insertItem(fi->fileName());
4085 cnt++; 4086 cnt++;
4086 4087
4087 //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); 4088 //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl;
4088 ++it; // goto next list element 4089 ++it; // goto next list element
4089 } 4090 }
4090 4091
@@ -4168,7 +4169,7 @@ void QTReaderApp::OnURLSelected(const QString& href)
4168 { 4169 {
4169 QClipboard* cb = QApplication::clipboard(); 4170 QClipboard* cb = QApplication::clipboard();
4170 cb->setText(href); 4171 cb->setText(href);
4171 qDebug("<a href=\"%s\">%s</a>", (const char*)href, (const char*)href); 4172 odebug << "<a href=\"" << href << "\">" << href << "</a>" << oendl;
4172 } 4173 }
4173 if (m_url_localfile) 4174 if (m_url_localfile)
4174 { 4175 {
@@ -4192,14 +4193,14 @@ void QTReaderApp::writeUrl(const QString& file, const QString& href)
4192 QDir d = QDir::home(); // "/" 4193 QDir d = QDir::home(); // "/"
4193 if ( !d.cd(APPDIR) ) 4194 if ( !d.cd(APPDIR) )
4194 { // "/tmp" 4195 { // "/tmp"
4195 qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); 4196 owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl;
4196 d = QDir::home(); 4197 d = QDir::home();
4197 d.mkdir(APPDIR); 4198 d.mkdir(APPDIR);
4198 d.cd(APPDIR); 4199 d.cd(APPDIR);
4199 } 4200 }
4200 if ( !d.cd("urls") ) 4201 if ( !d.cd("urls") )
4201 { // "/tmp" 4202 { // "/tmp"
4202 qWarning( "Cannot find the \"~/" APPDIR "/urls\" directory" ); 4203 owarn << "Cannot find the \"~/" APPDIR "/urls\" directory" << oendl;
4203 d = QDir::home(); 4204 d = QDir::home();
4204 d.cd(APPDIR); 4205 d.cd(APPDIR);
4205 d.mkdir("urls"); 4206 d.mkdir("urls");