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 @@ -16,57 +16,66 @@ ** Contact info@trolltech.com if any conditions of this licensing are ** 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> #include <qapplication.h> #include <qlineedit.h> #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> #include <qpe/qpeapplication.h> @@ -74,16 +83,8 @@ #else #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 #define PICDIR "c:\\uqtreader\\pics\\" @@ -124,9 +125,9 @@ void QTReaderApp::listBkmkFiles() int cnt = 0; 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); } @@ -145,9 +146,9 @@ 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 } #else /* USEQPE */ @@ -213,10 +214,10 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) m_url_clipboard = false; 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; pBkmklist = NULL; @@ -242,9 +243,9 @@ 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] *$"; #ifdef USEQPE @@ -259,15 +260,15 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) Config config( APPDIR ); #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"); m_tbmovesave = m_tbmove = config.readBoolEntry("Movable", false); @@ -355,9 +356,9 @@ 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 ); @@ -366,9 +367,9 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) #ifdef USEQPE ((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); #ifdef USEQPE @@ -768,9 +769,9 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE ); m_fontBar->setHorizontalStretchable( TRUE ); -// qDebug("Font selector"); +// odebug << "Font selector" << oendl; m_fontSelector = new QComboBox(false, m_fontBar); m_fontBar->setStretchableWidget( m_fontSelector ); { #ifndef USEQPE @@ -800,19 +801,19 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) #ifdef USEMSGS 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) { /* @@ -830,26 +831,26 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile) { 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 ); } } @@ -869,9 +870,9 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) config.writeEntry("Major", major); config.writeEntry("BkmkType", bkmktype); config.writeEntry("Minor", (int)minor); } -// qDebug("finished update"); +// odebug << "finished update" << oendl; } void QTReaderApp::addtoolbars(Config* config) { @@ -1027,16 +1028,16 @@ 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; } // fileBar->setHorizontalStretchable( true ); @@ -1052,9 +1053,9 @@ QToolBar* QTReaderApp::viewbar() case cesMultiple: 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; break; @@ -1068,17 +1069,17 @@ 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; } } return navBar; @@ -1092,9 +1093,9 @@ QToolBar* QTReaderApp::markbar() case cesMultiple: 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; break; @@ -1126,9 +1127,9 @@ void QTReaderApp::suspend() { reader->suspend(); } 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)" ) { @@ -1480,9 +1481,9 @@ 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()); } QTReaderApp::~QTReaderApp() @@ -1562,9 +1563,9 @@ void QTReaderApp::updatefileinfo() if (reader->m_string.isEmpty()) return; 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 { @@ -1576,18 +1577,18 @@ void QTReaderApp::updatefileinfo() unsigned short dlen; 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; delete [] data; break; } } } -// qDebug("Added?:%x", notadded); +// odebug << "Added?:" << notadded << "" << oendl; if (notadded) { struct stat fnstat; stat((const char *)reader->m_lastfile, &fnstat); @@ -1595,9 +1596,9 @@ void QTReaderApp::updatefileinfo() unsigned short dlen; 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; delete [] fl; @@ -1610,9 +1611,9 @@ void QTReaderApp::fileOpen() fileBar->hide(); if (regVisible) regBar->hide(); if (searchVisible) searchBar->hide(); */ -// qDebug("fileOpen"); +// odebug << "fileOpen" << oendl; // if (!reader->m_lastfile.isEmpty()) updatefileinfo(); fileOpen2(); } @@ -1651,9 +1652,9 @@ void QTReaderApp::fileOpen2() } reader->setFocus(); } // reader->refresh(); -// qDebug("HEIGHT:%d", reader->m_lastheight); +// odebug << "HEIGHT:" << reader->m_lastheight << "" << oendl; } QString QTReaderApp::usefilebrowser() { @@ -1671,9 +1672,9 @@ QString QTReaderApp::usefilebrowser() if (fb->exec()) { fn = fb->getCurrentFile(); } -// qDebug("Selected %s", (const char*)fn); +// odebug << "Selected " << fn << "" << oendl; delete fb; showEditTools(); return fn; #endif @@ -1802,9 +1803,9 @@ void QTReaderApp::showprefs() case 4: reader->bpeanut = true; break; default: - qDebug("Format out of range"); + odebug << "Format out of range" << oendl; } reader->bdepluck = prefwin->Depluck(); reader->bdejpluck = prefwin->Dejpluck(); reader->setContinuous(prefwin->Continuous()); @@ -1862,9 +1863,9 @@ void QTReaderApp::showtoolbarprefs() QFileInfo fi; 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); } @@ -1899,9 +1900,9 @@ void QTReaderApp::showtoolbarprefs() QFileInfo fi; 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); } @@ -2174,9 +2175,9 @@ void QTReaderApp::editFind() } void QTReaderApp::findNext() { -// // qDebug("findNext called\n"); +// // odebug << "findNext called\n" << oendl; #ifdef __ISEARCH QString arg = searchEdit->text(); #else QRegExp arg = searchEdit->text(); @@ -2270,14 +2271,14 @@ bool QTReaderApp::dosearch(size_t start, CDrawBuffer& test, const QRegExp& arg) reader->locate(pos); 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 { @@ -2332,9 +2333,9 @@ void QTReaderApp::search() #endif void QTReaderApp::openFile( const QString &f ) { -// qDebug("File:%s", (const char*)f); +// odebug << "File:" << f << "" << oendl; // openFile(DocLnk(f)); //} // //void QTReaderApp::openFile( const DocLnk &f ) @@ -2379,9 +2380,9 @@ 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; if (etime < m_debounce) @@ -2391,9 +2392,9 @@ void QTReaderApp::handlekey(QKeyEvent* e) m_lastkeytime = now; switch(e->key()) { case Key_Escape: -// qDebug("escape event"); +// odebug << "escape event" << oendl; if (m_disableesckey) { m_disableesckey = false; } @@ -2406,9 +2407,9 @@ void QTReaderApp::handlekey(QKeyEvent* e) e->accept(); } else { -// qDebug("escape action"); +// odebug << "escape action" << oendl; doAction(m_escapeTarget, e); } } break; @@ -2505,13 +2506,13 @@ void QTReaderApp::showEditTools() showFullScreen(); } 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(); if (navBar != NULL) navBar->show(); @@ -2531,22 +2532,22 @@ void QTReaderApp::showEditTools() #endif 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(); } /* @@ -2613,9 +2614,9 @@ void QTReaderApp::setDocument(const QString& fileref) } void QTReaderApp::closeEvent( QCloseEvent *e ) { -// qDebug("Close event"); +// odebug << "Close event" << oendl; if (m_fullscreen) { m_fullscreen = false; showEditTools(); @@ -2630,9 +2631,9 @@ void QTReaderApp::closeEvent( QCloseEvent *e ) if (editorStack->visibleWidget() == reader) { if ((m_escapeTarget != cesNone) && m_bcloseDisabled) { -// qDebug("Close disabled"); +// odebug << "Close disabled" << oendl; m_bcloseDisabled = false; e->ignore(); } else @@ -2708,9 +2709,9 @@ 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()); #endif @@ -2737,11 +2738,11 @@ void QTReaderApp::do_autogen() 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 regVisible = true; @@ -2755,12 +2756,12 @@ 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); @@ -2780,9 +2781,9 @@ bool QTReaderApp::openfrombkmk(Bkmk* bk) if (svlen != 0) { QMessageBox::warning(this, PROGNAME, "Not all file data used\nNew version?"); } -// qDebug("updating"); +// odebug << "updating" << oendl; // showEditTools(); reader->locate(bk->value()); } return true; @@ -2811,9 +2812,9 @@ void QTReaderApp::gotobkmk(int ind) case cGotoBkmk: 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(); break; @@ -2911,9 +2912,9 @@ 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) { FILE* fin = fopen((const char *)Global::applicationFileName(APPDIR "/urls",bkmkselector->text(ind)), "r"); @@ -2931,13 +2932,13 @@ void QTReaderApp::gotobkmk(int ind) doc->setName(bkmkselector->text(ind)); } FileManager fm; fm.saveFile( *doc, rt ); - qDebug("YES"); + odebug << "YES" << oendl; } else { - qDebug("NO"); + odebug << "NO" << oendl; } delete f; */ @@ -3008,9 +3009,9 @@ void QTReaderApp::do_regaction() do_setpipetarget(regEdit->text()); break; #endif case cSetConfigName: -// qDebug("Saving config"); +// odebug << "Saving config" << oendl; do_saveconfig(regEdit->text(), false); break; } // reader->restore(); @@ -3100,19 +3101,19 @@ 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); } 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) { @@ -3122,19 +3123,19 @@ 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; if (pBkmklist != NULL) delete pBkmklist; @@ -3179,9 +3180,9 @@ 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 ); @@ -3260,13 +3261,13 @@ 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; } */ /* @@ -3340,12 +3341,12 @@ void QTReaderApp::readfilelist() BkmkFile bf((const char *)fi.absFilePath()); #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() { @@ -3358,9 +3359,9 @@ void QTReaderApp::savefilelist() BkmkFile bf((const char *)fi.absFilePath(), true); #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); } } @@ -3468,9 +3469,9 @@ 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) { QClipboard* cb = QApplication::clipboard(); @@ -3518,9 +3519,9 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) } else { e->accept(); -// qDebug("Accepted"); +// odebug << "Accepted" << oendl; switch (a) { case cesOpenFile: { @@ -3581,9 +3582,9 @@ void QTReaderApp::doAction(ActionTypes a, QKeyEvent* e) case cesEndDoc: gotoEnd(); break; default: - qDebug("Unknown ActionType:%u", a); + odebug << "Unknown ActionType:" << a << "" << oendl; break; } } } @@ -3599,9 +3600,9 @@ 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; @@ -3622,13 +3623,13 @@ void QTReaderApp::do_saveconfig(const QString& _txt, bool full) #else 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); } @@ -3638,24 +3639,24 @@ 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"); d.cd("configs"); } fi.setFile(d, _txt); } -// qDebug("Path:%s", (const char*)fi.absFilePath()); +// odebug << "Path:" << fi.absFilePath() << "" << oendl; Config config(fi.absFilePath()); #endif @@ -3933,9 +3934,9 @@ 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); } @@ -3945,16 +3946,16 @@ 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"); } @@ -4060,15 +4061,15 @@ bool QTReaderApp::PopulateConfig(const char* tgtdir) int cnt = 0; 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); } @@ -4083,9 +4084,9 @@ 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 } #else /* USEQPE */ @@ -4167,9 +4168,9 @@ void QTReaderApp::OnURLSelected(const QString& href) if (m_url_clipboard) { 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) { writeUrl(reader->m_string, href); @@ -4191,16 +4192,16 @@ void QTReaderApp::writeUrl(const QString& file, const QString& href) QFileInfo fi; 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"); d.cd("urls"); |