Diffstat (limited to 'noncore/apps/opie-reader/QTReaderApp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/QTReaderApp.cpp | 279 |
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 @@ ** not clear to you. ** **********************************************************************/ + #include "useqpe.h" -#include <qregexp.h> -#include <qclipboard.h> -#include <qwidgetstack.h> +#include "QTReader.h" +#include "GraphicWin.h" +#include "Bkmks.h" +#include "cbkmkselector.h" +#include "infowin.h" +#include "ToolbarPrefs.h" +#include "Prefs.h" +#include "CAnnoEdit.h" +#include "QFloatBar.h" +#include "FixedFont.h" +#include "URLDialog.h" +#include "QTReaderApp.h" +#include "CDrawBuffer.h" +#include "Filedata.h" +#include "opie.h" +#include "names.h" +#include "CEncoding_tables.h" +#include "CloseDialog.h" + +/* OPIE */ +#include <opie2/odebug.h> +#ifdef USEQPE +#include <qpe/menubutton.h> +#include <qpe/fontdatabase.h> +#include <qpe/global.h> +#include <qpe/applnk.h> +#include <qpe/config.h> +#include <qpe/qcopenvelope_qws.h> +#endif + +/* QT */ #ifdef USEQPE #include <qmenubar.h> #include <qtoolbar.h> #endif +#include <qregexp.h> +#include <qclipboard.h> +#include <qwidgetstack.h> #include <qmenubar.h> #include <qtoolbar.h> -#ifdef USEQPE -#include <qpe/menubutton.h> -#include <qpe/fontdatabase.h> -#endif #include <qcombobox.h> #include <qpopupmenu.h> #include <qaction.h> @@ -39,33 +67,14 @@ #include <qtoolbutton.h> #include <qspinbox.h> #include <qobjectlist.h> -#ifdef USEQPE -#include <qpe/global.h> -#include <qpe/applnk.h> -#endif #include <qfileinfo.h> -#include <stdlib.h> //getenv #include <qprogressbar.h> -#ifdef USEQPE -#include <qpe/config.h> -#endif #include <qbuttongroup.h> #include <qradiobutton.h> -#ifdef USEQPE -#include <qpe/qcopenvelope_qws.h> -#endif -#include "QTReader.h" -#include "GraphicWin.h" -#include "Bkmks.h" -#include "cbkmkselector.h" -#include "infowin.h" -#include "ToolbarPrefs.h" -#include "Prefs.h" -#include "CAnnoEdit.h" -#include "QFloatBar.h" -#include "FixedFont.h" -#include "URLDialog.h" -//#include <qpe/fontdatabase.h> + +/* STD */ +#include <stdlib.h> //getenv + #ifdef USEQPE #include <qpe/resource.h> @@ -75,14 +84,6 @@ #include "qfiledialog.h" #endif -#include "QTReaderApp.h" -#include "CDrawBuffer.h" -#include "Filedata.h" -#include "opie.h" -#include "names.h" -#include "CEncoding_tables.h" -#include "CloseDialog.h" - bool CheckVersion(int&, int&, char&); #ifdef _WINDOWS @@ -125,7 +126,7 @@ void QTReaderApp::listBkmkFiles() QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); @@ -146,7 +147,7 @@ void QTReaderApp::listBkmkFiles() bkmkselector->insertItem(fi->fileName()); cnt++; - //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); + //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl; ++it; // goto next list element } @@ -214,8 +215,8 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) m_url_localfile = false; m_url_globalfile = false; ftime(&m_lastkeytime); -//// qDebug("Application directory = %s", (const tchar *)QPEApplication::documentDir()); -//// qDebug("Application directory = %s", (const tchar *)Global::applicationFileName("uqtreader","bkmks.xml")); +//// odebug << "Application directory = " << (const tchar *)QPEApplication::documentDir() << "" << oendl; +//// odebug << "Application directory = " << (const tchar *)Global::applicationFileName("uqtreader" << "" << oendl; m_bcloseDisabled = true; m_disableesckey = false; @@ -243,7 +244,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) m_rot = 270; } -// qDebug("Initial Rotation(%d):%s", m_rot, (const char*)rot); +// odebug << "Initial Rotation(" << m_rot << "):" << rot << "" << oendl; */ m_autogenstr = "^ *[A-Z].*[a-z] *$"; @@ -260,13 +261,13 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) #else QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); } QFileInfo fi(d, INIFILE); -// qDebug("Path:%s", (const char*)fi.absFilePath()); +// odebug << "Path:" << fi.absFilePath() << "" << oendl; Config config(fi.absFilePath()); #endif config.setGroup("Toolbar"); @@ -356,7 +357,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) // don't need the close visible, it is redundant... importSelector->setCloseVisible( FALSE ); */ -// qDebug("Reading file list"); +// odebug << "Reading file list" << oendl; readfilelist(); reader = new QTReader( editorStack ); @@ -367,7 +368,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold); #endif -// qDebug("Reading config"); +// odebug << "Reading config" << oendl; // Config config( APPDIR ); config.setGroup( "View" ); m_debounce = config.readNumEntry("Debounce", 0); @@ -769,7 +770,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) m_fontBar->setHorizontalStretchable( TRUE ); -// qDebug("Font selector"); +// odebug << "Font selector" << oendl; m_fontSelector = new QComboBox(false, m_fontBar); m_fontBar->setStretchableWidget( m_fontSelector ); { @@ -801,17 +802,17 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), this, SLOT( msgHandler(const QCString&,const QByteArray&) ) ); #endif -// qDebug("Initing"); +// odebug << "Initing" << oendl; reader->init(); -// qDebug("Inited"); +// odebug << "Inited" << oendl; // m_buttonAction[m_spaceTarget]->setOn(true); -// qDebug("fonting"); +// odebug << "fonting" << oendl; do_setfont(reader->m_fontname); if (!reader->m_lastfile.isEmpty()) { -// qDebug("doclnk"); +// odebug << "doclnk" << oendl; // doc = new DocLnk(reader->m_lastfile); -// qDebug("doclnk done"); +// odebug << "doclnk done" << oendl; if (pOpenlist != NULL) { @@ -831,24 +832,24 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) { break; } -// qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name())); +// odebug << "Item:" << toQString(CFiledata(p->anno()).name()) << "" << oendl; p = NULL; } if (p != NULL) { -// qDebug("openfrombkmk"); +// odebug << "openfrombkmk" << oendl; if (!openfrombkmk(p)) showEditTools(); } else { -// qDebug("openfile"); +// odebug << "openfile" << oendl; openFile( reader->m_lastfile ); } } else { -// qDebug("Openfile 2"); +// odebug << "Openfile 2" << oendl; if (!reader->m_lastfile.isEmpty()) openFile( reader->m_lastfile ); } @@ -870,7 +871,7 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) config.writeEntry("BkmkType", bkmktype); config.writeEntry("Minor", (int)minor); } -// qDebug("finished update"); +// odebug << "finished update" << oendl; } void QTReaderApp::addtoolbars(Config* config) @@ -1028,14 +1029,14 @@ QToolBar* QTReaderApp::filebar() switch (m_tbpol) { case cesSingle: -// qDebug("Setting filebar to menubar"); +// odebug << "Setting filebar to menubar" << oendl; fileBar = menubar; break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesMenuTool: case cesMultiple: -// qDebug("Creating new file bar"); +// odebug << "Creating new file bar" << oendl; fileBar = new QToolBar("File", this, m_tbposition); break; } @@ -1053,7 +1054,7 @@ QToolBar* QTReaderApp::viewbar() viewBar = new QToolBar("View", this, m_tbposition); break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesSingle: case cesMenuTool: viewBar = fileBar; @@ -1069,15 +1070,15 @@ QToolBar* QTReaderApp::navbar() switch (m_tbpol) { case cesMultiple: -// qDebug("Creating new nav bar"); +// odebug << "Creating new nav bar" << oendl; navBar = new QToolBar("Navigation", this, m_tbposition); break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesSingle: case cesMenuTool: navBar = fileBar; -// qDebug("Setting navbar to filebar"); +// odebug << "Setting navbar to filebar" << oendl; break; } } @@ -1093,7 +1094,7 @@ QToolBar* QTReaderApp::markbar() markBar = new QToolBar("Marks", this, m_tbposition); break; default: - qDebug("Incorrect toolbar policy set"); + odebug << "Incorrect toolbar policy set" << oendl; case cesSingle: case cesMenuTool: markBar = fileBar; @@ -1127,7 +1128,7 @@ void QTReaderApp::msgHandler(const QCString& _msg, const QByteArray& _data) { QString msg = QString::fromUtf8(_msg); -//// qDebug("Received:%s", (const char*)msg); +//// odebug << "Received:" << msg << "" << oendl; QDataStream stream( _data, IO_ReadOnly ); if ( msg == "info(QString)" ) @@ -1481,7 +1482,7 @@ void QTReaderApp::setfullscreen(bool sfs) void QTReaderApp::buttonActionSelected(QAction* _a) { -//// qDebug("es:%x : %s (%u)", _a, (const char *)(_a->text()), ActNameToInt(_a->text())); +//// odebug << "es:" << _a << " : " << (const char *)(_a->text()) << " (" << ActNameToInt(_a->text()) << ")" << oendl; m_spaceTarget = ActNameToInt(_a->text()); } @@ -1563,7 +1564,7 @@ void QTReaderApp::updatefileinfo() if (reader->m_lastfile.isEmpty()) return; tchar* nm = fromQString(reader->m_string); tchar* fl = fromQString(reader->m_lastfile); -// qDebug("Lastfile:%x", fl); +// odebug << "Lastfile:" << fl << "" << oendl; bool notadded = true; if (pOpenlist == NULL) pOpenlist = new CList<Bkmk>; else @@ -1577,7 +1578,7 @@ void QTReaderApp::updatefileinfo() unsigned char* data; CFiledata fd(iter->anno()); reader->setSaveData(data, dlen, fd.content(), fd.length()); -// qDebug("Filedata(1):%u, %u", fd.length(), dlen); +// odebug << "Filedata(1):" << fd.length() << ", " << dlen << "" << oendl; // getstate(data, dlen); iter->setAnno(data, dlen); notadded = false; @@ -1586,7 +1587,7 @@ void QTReaderApp::updatefileinfo() } } } -// qDebug("Added?:%x", notadded); +// odebug << "Added?:" << notadded << "" << oendl; if (notadded) { struct stat fnstat; @@ -1596,7 +1597,7 @@ void QTReaderApp::updatefileinfo() unsigned char* data; reader->setSaveData(data, dlen, fd.content(), fd.length()); pOpenlist->push_front(Bkmk(nm, data, dlen, reader->pagelocate())); -// qDebug("Filedata(2):%u, %u", fd.length(), dlen); +// odebug << "Filedata(2):" << fd.length() << ", " << dlen << "" << oendl; delete [] data; } delete [] nm; @@ -1611,7 +1612,7 @@ void QTReaderApp::fileOpen() if (regVisible) regBar->hide(); if (searchVisible) searchBar->hide(); */ -// qDebug("fileOpen"); +// odebug << "fileOpen" << oendl; // if (!reader->m_lastfile.isEmpty()) updatefileinfo(); fileOpen2(); @@ -1652,7 +1653,7 @@ void QTReaderApp::fileOpen2() reader->setFocus(); } // reader->refresh(); -// qDebug("HEIGHT:%d", reader->m_lastheight); +// odebug << "HEIGHT:" << reader->m_lastheight << "" << oendl; } QString QTReaderApp::usefilebrowser() @@ -1672,7 +1673,7 @@ QString QTReaderApp::usefilebrowser() { fn = fb->getCurrentFile(); } -// qDebug("Selected %s", (const char*)fn); +// odebug << "Selected " << fn << "" << oendl; delete fb; showEditTools(); return fn; @@ -1803,7 +1804,7 @@ void QTReaderApp::showprefs() reader->bpeanut = true; break; default: - qDebug("Format out of range"); + odebug << "Format out of range" << oendl; } reader->bdepluck = prefwin->Depluck(); reader->bdejpluck = prefwin->Dejpluck(); @@ -1863,7 +1864,7 @@ void QTReaderApp::showtoolbarprefs() QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); + owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); @@ -1900,7 +1901,7 @@ void QTReaderApp::showtoolbarprefs() QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", APPDIR ); + owarn << "Cannot find the \"~/" << APPDIR << "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); @@ -2175,7 +2176,7 @@ void QTReaderApp::editFind() void QTReaderApp::findNext() { -// // qDebug("findNext called\n"); +// // odebug << "findNext called\n" << oendl; #ifdef __ISEARCH QString arg = searchEdit->text(); #else @@ -2271,12 +2272,12 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg) return false; } } -// qDebug("Found it at %u:%u", pos, offset); +// odebug << "Found it at " << pos << ":" << offset << "" << oendl; pbar->hide(); -// qDebug("Hid"); +// odebug << "Hid" << oendl; reader->locate(pos+offset); -// qDebug("Loacted"); -// qDebug("page up"); +// odebug << "Loacted" << oendl; +// odebug << "page up" << oendl; ret = true; } else @@ -2333,7 +2334,7 @@ void QTReaderApp::search() void QTReaderApp::openFile( const QString &f ) { -// qDebug("File:%s", (const char*)f); +// odebug << "File:" << f << "" << oendl; // openFile(DocLnk(f)); //} // @@ -2380,7 +2381,7 @@ void QTReaderApp::resizeEvent(QResizeEvent* e) */ void QTReaderApp::handlekey(QKeyEvent* e) { -// qDebug("Keypress event"); +// odebug << "Keypress event" << oendl; timeb now; ftime(&now); unsigned long etime = (1000*(now.time - m_lastkeytime.time) + now.millitm)-m_lastkeytime.millitm; @@ -2392,7 +2393,7 @@ void QTReaderApp::handlekey(QKeyEvent* e) switch(e->key()) { case Key_Escape: -// qDebug("escape event"); +// odebug << "escape event" << oendl; if (m_disableesckey) { m_disableesckey = false; @@ -2407,7 +2408,7 @@ void QTReaderApp::handlekey(QKeyEvent* e) } else { -// qDebug("escape action"); +// odebug << "escape action" << oendl; doAction(m_escapeTarget, e); } } @@ -2506,11 +2507,11 @@ void QTReaderApp::showEditTools() } else { -// qDebug("him"); +// odebug << "him" << oendl; #ifdef USEQPE Global::hideInputMethod(); #endif -// qDebug("eb"); +// odebug << "eb" << oendl; menubar->show(); if (fileBar != NULL) fileBar->show(); if (viewBar != NULL) viewBar->show(); @@ -2532,20 +2533,20 @@ void QTReaderApp::showEditTools() regBar->show(); } if (m_fontVisible) m_fontBar->show(); -// qDebug("sn"); +// odebug << "sn" << oendl; showNormal(); -// qDebug("sm"); +// odebug << "sm" << oendl; #ifdef USEQPE showMaximized(); #endif // setCentralWidget(reader); } -// qDebug("uc"); +// odebug << "uc" << oendl; updateCaption(); -// qDebug("rw"); +// odebug << "rw" << oendl; editorStack->raiseWidget( reader ); -// qDebug("sf"); +// odebug << "sf" << oendl; reader->setFocus(); reader->refresh(); } @@ -2614,7 +2615,7 @@ void QTReaderApp::setDocument(const QString& fileref) void QTReaderApp::closeEvent( QCloseEvent *e ) { -// qDebug("Close event"); +// odebug << "Close event" << oendl; if (m_fullscreen) { m_fullscreen = false; @@ -2631,7 +2632,7 @@ void QTReaderApp::closeEvent( QCloseEvent *e ) { if ((m_escapeTarget != cesNone) && m_bcloseDisabled) { -// qDebug("Close disabled"); +// odebug << "Close disabled" << oendl; m_bcloseDisabled = false; e->ignore(); } @@ -2709,7 +2710,7 @@ bool QTReaderApp::listbkmk(CList<Bkmk>* plist, const QString& _lab) for (CList<Bkmk>::iterator i = plist->begin(); i != plist->end(); i++) { #ifdef _UNICODE -// qDebug("Item:%s", (const char*)toQString(i->name())); +// odebug << "Item:" << toQString(i->name()) << "" << oendl; bkmkselector->insertItem(toQString(i->name())); #else bkmkselector->insertItem(i->name()); @@ -2738,9 +2739,9 @@ void QTReaderApp::do_regedit() { // fileBar->hide(); reader->bDoUpdates = false; -// qDebug("Showing regbar"); +// odebug << "Showing regbar" << oendl; regBar->show(); -// qDebug("Showing kbd"); +// odebug << "Showing kbd" << oendl; #ifdef USEQPE Global::showInputMethod(); #endif @@ -2756,10 +2757,10 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk) QString fn = toQString( CFiledata(bk->anno()).name() ); -// qDebug("fileinfo"); +// odebug << "fileinfo" << oendl; if (!fn.isEmpty() && QFileInfo(fn).isFile()) { -// qDebug("Opening"); +// odebug << "Opening" << oendl; openFile(fn); struct stat fnstat; stat((const char *)reader->m_lastfile, &fnstat); @@ -2781,7 +2782,7 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk) { QMessageBox::warning(this, PROGNAME, "Not all file data used\nNew version?"); } -// qDebug("updating"); +// odebug << "updating" << oendl; // showEditTools(); reader->locate(bk->value()); } @@ -2812,7 +2813,7 @@ void QTReaderApp::gotobkmk(int ind) reader->locate((*pBkmklist)[ind]->value()); break; case cDelBkmk: -//// qDebug("Deleting:%s\n",(*pBkmklist)[ind]->name()); +//// odebug << "Deleting:" << (*pBkmklist)[ind]->name() << "\n" << oendl; pBkmklist->erase(ind); m_fBkmksChanged = true; // pBkmklist->sort(); @@ -2912,7 +2913,7 @@ void QTReaderApp::gotobkmk(int ind) /* CFileSelector *f = new CFileSelector("text/html", this, NULL, !m_bFloatingDialog, TRUE, TRUE ); int ret = f->exec(); - qDebug("Return:%d", ret); + odebug << "Return:" << ret << "" << oendl; DocLnk* doc = f->getDoc(); if (doc != NULL) { @@ -2932,11 +2933,11 @@ void QTReaderApp::gotobkmk(int ind) } FileManager fm; fm.saveFile( *doc, rt ); - qDebug("YES"); + odebug << "YES" << oendl; } else { - qDebug("NO"); + odebug << "NO" << oendl; } delete f; */ @@ -3009,7 +3010,7 @@ void QTReaderApp::do_regaction() break; #endif case cSetConfigName: -// qDebug("Saving config"); +// odebug << "Saving config" << oendl; do_saveconfig(regEdit->text(), false); break; } @@ -3101,7 +3102,7 @@ void QTReaderApp::setfontHelper(const QString& lcn, int size) void QTReaderApp::do_setencoding(int i) { -// qDebug("setencoding:%d", i); +// odebug << "setencoding:" << i << "" << oendl; if (m_fontAction == cChooseEncoding) { reader->setencoding(i); @@ -3109,9 +3110,9 @@ void QTReaderApp::do_setencoding(int i) reader->refresh(); m_fontBar->hide(); m_fontVisible = false; -// qDebug("showedit"); +// odebug << "showedit" << oendl; if (reader->isVisible()) showEditTools(); -// qDebug("showeditdone"); +// odebug << "showeditdone" << oendl; } void QTReaderApp::do_setfont(const QString& lcn) @@ -3123,17 +3124,17 @@ void QTReaderApp::do_setfont(const QString& lcn) reader->refresh(); m_fontBar->hide(); m_fontVisible = false; -// qDebug("showedit"); +// odebug << "showedit" << oendl; //if (reader->isVisible()) showEditTools(); -// qDebug("showeditdone"); +// odebug << "showeditdone" << oendl; } void QTReaderApp::do_autogen(const QString& regText) { unsigned long fs, ts; reader->sizes(fs,ts); -// // qDebug("Reg:%s\n", (const tchar*)(regEdit->text())); +// // odebug << "Reg:" << (const tchar*)(regEdit->text()) << "\n" << oendl; m_autogenstr = regText; QRegExp re(regText); CBuffer buff; @@ -3180,7 +3181,7 @@ void QTReaderApp::do_autogen(const QString& regText) void QTReaderApp::saveprefs() { -// qDebug("saveprefs"); +// odebug << "saveprefs" << oendl; // reader->saveprefs("uqtreader"); // if (!m_loadedconfig) do_saveconfig( APPDIR, true ); @@ -3261,11 +3262,11 @@ void QTReaderApp::saveprefs() /* void QTReaderApp::oldFile() { -// qDebug("oldFile called"); +// odebug << "oldFile called" << oendl; reader->setText(true); -// qDebug("settext called"); +// odebug << "settext called" << oendl; showEditTools(); -// qDebug("showedit called"); +// odebug << "showedit called" << oendl; } */ @@ -3341,10 +3342,10 @@ void QTReaderApp::readfilelist() #else /* USEQPE */ BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles")); #endif /* USEQPE */ -// qDebug("Reading open files"); +// odebug << "Reading open files" << oendl; pOpenlist = bf.readall(); -// if (pOpenlist != NULL) qDebug("...with success"); -// else qDebug("...without success!"); +// if (pOpenlist != NULL) odebug << "...with success" << oendl; +// else odebug << "...without success!" << oendl; } void QTReaderApp::savefilelist() @@ -3359,7 +3360,7 @@ void QTReaderApp::savefilelist() #else /* USEQPE */ BkmkFile bf((const char *)Global::applicationFileName(APPDIR,".openfiles"), true); #endif /* USEQPE */ -// qDebug("Writing open files"); +// odebug << "Writing open files" << oendl; bf.write(*pOpenlist); } } @@ -3469,7 +3470,7 @@ void QTReaderApp::showAnnotation() void QTReaderApp::OnWordSelected(const QString& wrd, size_t posn, const QString& line) { -//// qDebug("OnWordSelected(%u):%s", posn, (const char*)wrd); +//// odebug << "OnWordSelected(" << posn << "):" << wrd << "" << oendl; if (m_doClipboard) { @@ -3519,7 +3520,7 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) else { e->accept(); -// qDebug("Accepted"); +// odebug << "Accepted" << oendl; switch (a) { case cesOpenFile: @@ -3582,7 +3583,7 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) gotoEnd(); break; default: - qDebug("Unknown ActionType:%u", a); + odebug << "Unknown ActionType:" << a << "" << oendl; break; } } @@ -3600,7 +3601,7 @@ void QTReaderApp::SaveConfig() void QTReaderApp::do_saveconfig(const QString& _txt, bool full) { -// qDebug("do_saveconfig:%s", (const char*)_txt); +// odebug << "do_saveconfig:" << _txt << "" << oendl; #ifdef USEQPE QString configname; Config::Domain dom; @@ -3623,11 +3624,11 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) QFileInfo fi; if (full) { -// qDebug("full:%s", (const char*)_txt); +// odebug << "full:" << _txt << "" << oendl; QDir d = QDir::home(); // "/" if ( !d.cd(_txt) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); + owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl; d = QDir::home(); d.mkdir(_txt); d.cd(_txt); @@ -3639,14 +3640,14 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); } if ( !d.cd("configs") ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl; d = QDir::home(); d.cd(APPDIR); d.mkdir("configs"); @@ -3654,7 +3655,7 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) } fi.setFile(d, _txt); } -// qDebug("Path:%s", (const char*)fi.absFilePath()); +// odebug << "Path:" << fi.absFilePath() << "" << oendl; Config config(fi.absFilePath()); #endif @@ -3934,7 +3935,7 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false) QDir d = QDir::home(); // "/" if ( !d.cd(_txt) ) { // "/tmp" - qWarning( "Cannot find the \"~/%s\" directory", (const char*)_txt ); + owarn << "Cannot find the \"~/" << _txt << "\" directory" << oendl; d = QDir::home(); d.mkdir(_txt); d.cd(_txt); @@ -3946,14 +3947,14 @@ bool QTReaderApp::readconfig(const QString& _txt, bool full=false) QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); } if ( !d.cd("configs") ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/configs\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "/configs\" directory" << oendl; d = QDir::home(); d.mkdir("configs"); d.cd("configs"); @@ -4061,13 +4062,13 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); } if ( !d.cd(tgtdir) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/%s\" directory", tgtdir ); + owarn << "Cannot find the \"~/" APPDIR "/" << tgtdir << "\" directory" << oendl; d = QDir::home(); d.mkdir(tgtdir); d.cd(tgtdir); @@ -4084,7 +4085,7 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) bkmkselector->insertItem(fi->fileName()); cnt++; - //qDebug( "%10li %s", fi->size(), fi->fileName().data() ); + //odebug << "" << fi->size() << " " << fi->fileName().data() << "" << oendl; ++it; // goto next list element } @@ -4168,7 +4169,7 @@ void QTReaderApp::OnURLSelected(const QString& href) { QClipboard* cb = QApplication::clipboard(); cb->setText(href); - qDebug("<a href=\"%s\">%s</a>", (const char*)href, (const char*)href); + odebug << "<a href=\"" << href << "\">" << href << "</a>" << oendl; } if (m_url_localfile) { @@ -4192,14 +4193,14 @@ void QTReaderApp::writeUrl(const QString& file, const QString& href) QDir d = QDir::home(); // "/" if ( !d.cd(APPDIR) ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "\" directory" << oendl; d = QDir::home(); d.mkdir(APPDIR); d.cd(APPDIR); } if ( !d.cd("urls") ) { // "/tmp" - qWarning( "Cannot find the \"~/" APPDIR "/urls\" directory" ); + owarn << "Cannot find the \"~/" APPDIR "/urls\" directory" << oendl; d = QDir::home(); d.cd(APPDIR); d.mkdir("urls"); |