author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
64 files changed, 1360 insertions, 1267 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index a60d6ce..a47edd8 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -73,3 +73,3 @@ void AdvancedFm::cleanUp() { void AdvancedFm::tabChanged(QWidget *) { -// qWarning("tab changed"); +// owarn << "tab changed" << oendl; QString path = CurrentDir()->canonicalPath(); @@ -95,3 +95,3 @@ void AdvancedFm::populateView() { -// qWarning("PopulateView"); +// owarn << "PopulateView" << oendl; QPixmap pm; @@ -101,3 +101,3 @@ void AdvancedFm::populateView() { -//qWarning("path is "+path); +//owarn << "path is "+path << oendl; thisView->clear(); @@ -162,3 +162,3 @@ void AdvancedFm::populateView() { if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { - // qDebug(" overlay link image"); + // odebug << " overlay link image" << oendl; pm= Resource::loadPixmap( "advancedfm/symlink" ); @@ -186,3 +186,3 @@ void AdvancedFm::populateView() { lstat( mydirent->d_name, &buf); -// qDebug(mydirent->d_name); +// odebug << mydirent->d_name << oendl; fileL.sprintf("%s", mydirent->d_name); @@ -211,3 +211,3 @@ void AdvancedFm::rePopulate() { // int tmpTab = whichTab; -// // qDebug("%d", tmpTab); +// // odebug << "" << tmpTab << "" << oendl; @@ -221,6 +221,6 @@ void AdvancedFm::rePopulate() { void AdvancedFm::ListClicked(QListViewItem *selectedItem) { -//qWarning("listclicked"); +//owarn << "listclicked" << oendl; if(selectedItem) { QString strItem=selectedItem->text(0); -// qWarning(strItem); +// owarn << strItem << oendl; QString strSize=selectedItem->text(1); @@ -269,3 +269,3 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in void AdvancedFm::switchToLocalTab() { -//qWarning("switch to local view"); +//owarn << "switch to local view" << oendl; TabWidget->setCurrentWidget(0); @@ -275,3 +275,3 @@ void AdvancedFm::switchToLocalTab() { void AdvancedFm::switchToRemoteTab() { -//qWarning("switch to local view"); +//owarn << "switch to local view" << oendl; TabWidget->setCurrentWidget(1); @@ -331,3 +331,3 @@ QStringList AdvancedFm::getPath() { strList << it.current()->text(0); -// qDebug(it.current()->text(0)); +// odebug << it.current()->text(0) << oendl; } @@ -382,3 +382,3 @@ void AdvancedFm::doAbout() { void AdvancedFm::keyPressEvent( QKeyEvent *e) { -// qWarning("key %d", e->key()); +// owarn << "key " << e->key() << "" << oendl; // if( CurrentView()->hasFocus() ) @@ -640,3 +640,3 @@ void AdvancedFm::addToDocs() { curFile = thisDir->canonicalPath()+"/"+(*it); -// qDebug(curFile); +// odebug << curFile << oendl; QFileInfo fi(curFile); @@ -713,3 +713,3 @@ void AdvancedFm::addCustomDir() { void AdvancedFm::removeCustomDir() { -// qDebug("remove custom dir"); +// odebug << "remove custom dir" << oendl; Config cfg("AdvancedFm"); @@ -748,3 +748,3 @@ void AdvancedFm::removeCustomDir() { void AdvancedFm::gotoCustomDir(const QString &dir) { -// qDebug("gotoCustomDir(const QString &dir) " +dir ); +// odebug << "gotoCustomDir(const QString &dir) " +dir << oendl; // QString curDir = dir; @@ -789,6 +789,6 @@ QListView * AdvancedFm::CurrentView() { if ( whichTab == 1) { -// qWarning("CurrentView Tab 1"); +// owarn << "CurrentView Tab 1" << oendl; return Local_View; } else { -// qWarning("CurrentView Tab 2"); +// owarn << "CurrentView Tab 2" << oendl; return Remote_View; @@ -805,3 +805,3 @@ QListView * AdvancedFm::OtherView() { void AdvancedFm::setOtherTabCurrent() { -// qWarning("setOtherTabCurrent() %d", whichTab); +// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; if ( whichTab == 1) { @@ -816,6 +816,6 @@ void AdvancedFm::setOtherTabCurrent() { void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { -// qDebug("qcop message "+msg ); +// odebug << "qcop message "+msg << oendl; QDataStream stream ( data, IO_ReadOnly ); if ( msg == "openDirectory(QString)" ) { -// qDebug("received"); +// odebug << "received" << oendl; QString file; @@ -832,3 +832,3 @@ void AdvancedFm::setDocument(const QString &file) { void AdvancedFm::gotoDirectory(const QString &file) { -// qWarning("goto dir "+file); +// owarn << "goto dir "+file << oendl; QString curDir = file; @@ -868,3 +868,3 @@ void AdvancedFm::findFile(const QString &fileName) { void AdvancedFm::slotSwitchMenu(int ) { -// qDebug("Switch %d", item); +// odebug << "Switch " << item << "" << oendl; // viewMenu->setItemChecked(item, true); diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index 716343d..f1c518e 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro @@ -1,4 +1,3 @@ TEMPLATE = app -CONFIG += qt warn_on quick-app -# CONFIG += qt warn_on +CONFIG += qt warn_on quick-app HEADERS = advancedfm.h filePermissions.h output.h @@ -8,22 +7,3 @@ INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 -lopieui2 - -TRANSLATIONS = ../../../i18n/de/advancedfm.ts \ - ../../../i18n/nl/advancedfm.ts \ - ../../../i18n/da/advancedfm.ts \ - ../../../i18n/xx/advancedfm.ts \ - ../../../i18n/en/advancedfm.ts \ - ../../../i18n/es/advancedfm.ts \ - ../../../i18n/fr/advancedfm.ts \ - ../../../i18n/hu/advancedfm.ts \ - ../../../i18n/ja/advancedfm.ts \ - ../../../i18n/ko/advancedfm.ts \ - ../../../i18n/no/advancedfm.ts \ - ../../../i18n/pl/advancedfm.ts \ - ../../../i18n/pt/advancedfm.ts \ - ../../../i18n/pt_BR/advancedfm.ts \ - ../../../i18n/sl/advancedfm.ts \ - ../../../i18n/zh_CN/advancedfm.ts \ - ../../../i18n/zh_TW/advancedfm.ts - +LIBS += -lqpe -lopiecore2 -lopieui2 diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 2997c55..29335f8 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp @@ -13,2 +13,4 @@ +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/storage.h> @@ -17,3 +19,6 @@ #include <qpe/menubutton.h> +using namespace Opie::Core; +using namespace Opie::Ui; +/* QT */ #include <qlayout.h> @@ -26,6 +31,5 @@ +/* STD */ #include <sys/utsname.h> - -using namespace Opie::Ui; void AdvancedFm::init() { @@ -221,3 +225,3 @@ void AdvancedFm::init() { if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { - qDebug("not have sd"); + odebug << "not have sd" << oendl; sdButton->hide(); @@ -225,3 +229,3 @@ void AdvancedFm::init() { if( !StorageInfo::hasCf() ) { - qDebug("not have cf"); + odebug << "not have cf" << oendl; cfButton->hide(); diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 81a4318..d34f330 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp @@ -1,839 +1,842 @@ -/***************************************************************************
- AdvancedFm.cpp
- -------------------
- ** Created: Sat Mar 9 23:33:09 2002
- copyright : (C) 2002 by ljp
- email : ljp@llornkcor.com
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- ***************************************************************************/
-#include "advancedfm.h"
-#include "output.h"
-#include "filePermissions.h"
-
-#include <qpe/lnkproperties.h>
-#include <qpe/qpeapplication.h>
-#include <qpe/applnk.h>
-
-#include <qmessagebox.h>
-
-
-#include <qpopupmenu.h>
-#include <qlistview.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <sys/sendfile.h>
-#include <fcntl.h>
-
-
-using namespace Opie::Core;
-using namespace Opie::Core;
-void AdvancedFm::doDirChange() {
- QString pathItem = CurrentView()->currentItem()->text(0);
- if( pathItem == "../") {
- ListClicked( CurrentView()->currentItem());
- } else {
- if( pathItem.find(" -> ",0,TRUE) != -1)
- pathItem = dealWithSymName((const QString&)pathItem)+"/";
-// qWarning(pathItem);
- gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) );
- }
-}
-
-void AdvancedFm::showMenuHidden() {
- if (b) {
- CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
- OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
- fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
- } else {
- CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
- OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
- fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
- }
- b = !b;
- populateView();
-}
-
-void AdvancedFm::showHidden() {
- if (b) {
- CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
- OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
- } else {
- CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
- OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
- }
- populateView();
-}
-
-QString AdvancedFm::dealWithSymName(const QString &fileName) {
- QString strItem = fileName;
- return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
-}
-
-void AdvancedFm::runThis() {
- if( !CurrentView()->currentItem()) return;
- QString fs;
- QDir *thisDir = CurrentDir();
-
- QString curFile = CurrentView()->currentItem()->text(0);
- QString path = thisDir->canonicalPath();
-
- if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
-
- curFile = dealWithSymName((const QString&)curFile);
-
- if(curFile != "../") {
-
- fs = getFileSystemType((const QString &) path);
- QFileInfo fileInfo( path + "/" + curFile);
-// qDebug( fileInfo.owner());
-
- if( (fileInfo.permission( QFileInfo::ExeUser)
- | fileInfo.permission( QFileInfo::ExeGroup)
- | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) {
- | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
- QCopEnvelope e("QPE/System", "execute(QString)" );
- e << curFile;
- } else {
- curFile = path + "/" + curFile;
- DocLnk nf(curFile);
- QString execStr = nf.exec();
-// qDebug( execStr);
- if( execStr.isEmpty() ) {
- } else {
- nf.execute();
- }
- }
- }
-}
-
-void AdvancedFm::runText() {
- if( !CurrentView()->currentItem()) return;
- QString curFile = CurrentView()->currentItem()->text(0);
- if(curFile != "../") {
- if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
- curFile = dealWithSymName((const QString&)curFile);
- curFile = CurrentDir()->canonicalPath()+"/"+curFile;
- QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
- e << curFile;
- }
-}
-
-void AdvancedFm::makeDir() {
- InputDialog *fileDlg;
- fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0);
- fileDlg->exec();
- if( fileDlg->result() == 1 ) {
- QDir *thisDir = CurrentDir();
- QString filename = fileDlg->LineEdit1->text();
- thisDir->mkdir( thisDir->canonicalPath()+"/"+filename);
- }
- populateView();
-}
-
-void AdvancedFm::doDelete() {
- QStringList curFileList = getPath();
- bool doMsg=true;
- int count = curFileList.count();
- if( count > 0) {
- if(count > 1 ) {
- QString msg;
- msg=tr("Really delete\n%1 files?").arg(count);
- switch ( QMessageBox::warning(this,tr("Delete"),msg
- ,tr("Yes"),tr("No"),0,0,1) )
- {
- case 0:
- doMsg=false;
- break;
- case 1:
- return;
- break;
- };
- }
-
- QString myFile;
-
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
- myFile = (*it);
- if( myFile.find(" -> ",0,TRUE) != -1)
- myFile = myFile.left( myFile.find(" -> ",0,TRUE));
-
- QString f = CurrentDir()->canonicalPath();
- if(f.right(1).find("/",0,TRUE) == -1)
- f += "/";
- f += myFile;
- if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) {
- //if file is a directory
-
- switch ( QMessageBox::warning( this, tr("Delete Directory?"),
- tr("Really delete %1\nand all it's contents ?" ).arg( f ) ,
- tr("Yes"), tr("No"), 0, 0, 1) ) {
- case 0:
- {
- f=f.left(f.length()-1);
- QString cmd="rm -rf "+f;
- startProcess( (const QString)cmd.latin1() );
- populateView();
- }
- break;
- case 1:
- // exit
- break;
- };
-
- } else {
- if(doMsg) {
- switch ( QMessageBox::warning(this,tr("Delete"),
- tr("Really delete\n%1?").arg( myFile ),
- tr("Yes"), tr("No"), 0, 0, 1) ) {
- case 1:
- return;
- break;
- };
- }
-
- QString cmd="rm "+f;
- QFile file(f);
- QFileInfo fi(myFile);
- if( fi.fileName().find("../",0,TRUE)==-1) {
-// qDebug("remove link files "+myFile);
-
-// DocLnk lnk(f);
- DocLnk *lnk;
- lnk = new DocLnk(f);
-// qDebug("Deleting doclnk " + lnk->linkFile());
- if(lnk->isValid())
- lnk->removeLinkFile();
- // delete lnk;
- file.remove();
- }
- }
- }
- }
- populateView();
-}
-
-void AdvancedFm::filePerms() {
- QStringList curFileList = getPath();
- QString filePath;
-
- filePath = CurrentDir()->canonicalPath()+"/";
-
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
- filePermissions *filePerm;
- filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it));
- QPEApplication::execDialog( filePerm );
- if( filePerm )
- delete filePerm;
- }
- populateView();
-}
-
-void AdvancedFm::doProperties() {
-#if defined(QT_QWS_OPIE)
-
- QStringList curFileList = getPath();
-
- QString filePath;
- filePath = CurrentDir()->canonicalPath()+"/";
-
-// qDebug("%d",curFileList.count());
-
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
-// qDebug((filePath+*it));
- DocLnk lnk( (filePath+*it));
- LnkProperties prop( &lnk );
- QPEApplication::execDialog( &prop );
- }
-#endif
-
-}
-
-void AdvancedFm::upDir() {
- QDir *thisDir = CurrentDir();
- QString current = thisDir->canonicalPath();
- QDir dir(current);
- dir.cdUp();
- current = dir.canonicalPath();
- chdir( current.latin1() );
- thisDir->cd( current, TRUE);
-
- populateView();
- update();
-}
-
-void AdvancedFm::copy() {
- qApp->processEvents();
- QStringList curFileList = getPath();
-
- QDir *thisDir = CurrentDir();
- QDir *thatDir = OtherDir();
-
- bool doMsg=true;
- int count=curFileList.count();
- if( count > 0) {
- if(count > 1 ){
- QString msg;
- msg=tr("Really copy\n%1 files?").arg(count);
- switch ( QMessageBox::warning(this,tr("Copy"),msg
- ,tr("Yes"),tr("No"),0,0,1) )
- {
- case 0:
- doMsg=false;
- break;
- case 1:
- return;
- break;
- };
- }
-
- QString curFile, item, destFile;
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
- item=(*it);
- if(item.find("->",0,TRUE)) //symlink
- item = item.left(item.find("->",0,TRUE));
-
- curFile = thisDir->canonicalPath()+"/"+ item;
- destFile = thatDir->canonicalPath()+"/"+ item;
-
-// qDebug("Destination file is "+destFile);
-// qDebug("CurrentFile file is " + curFile);
-
- QFile f(destFile);
- if( f.exists()) {
- if(doMsg) {
- switch ( QMessageBox::warning(this,tr("File Exists!"),
- tr("%1 exists. Ok to overwrite?").arg( item ),
- tr("Yes"),tr("No"),0,0,1) ) {
- case 1:
- return;
- break;
- };
- }
- f.remove();
- }
-
- if( !copyFile( curFile, destFile) ) {
- QMessageBox::message("AdvancedFm",
- tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) );
- return;
- }
- }
- setOtherTabCurrent();
- rePopulate();
- }
-}
-
-void AdvancedFm::copyAs() {
- qApp->processEvents();
-
- QStringList curFileList = getPath();
- QString curFile, item;
- InputDialog *fileDlg;
-
- QDir *thisDir = CurrentDir();
- QDir *thatDir = OtherDir();
-
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
- QString destFile;
- item=(*it);
- curFile = thisDir->canonicalPath()+"/"+(*it);
- fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0);
-
- fileDlg->setInputText((const QString &) destFile );
- fileDlg->exec();
-
- if( fileDlg->result() == 1 ) {
- QString filename = fileDlg->LineEdit1->text();
- destFile = thatDir->canonicalPath()+"/"+filename;
-
- QFile f( destFile);
- if( f.exists()) {
- switch (QMessageBox::warning(this,tr("File Exists!"),
- item+tr("\nexists. Ok to overwrite?"),
- tr("Yes"),tr("No"),0,0,1) ) {
- case 0:
- f.remove();
- break;
- case 1:
- return;
- break;
- };
- }
- if( !copyFile( curFile, destFile) ) {
- QMessageBox::message("AdvancedFm",tr("Could not copy\n")
- +curFile +tr("to\n")+destFile);
- return;
- }
- }
- delete fileDlg;
-
- }
- rePopulate();
- setOtherTabCurrent();
-}
-
-void AdvancedFm::copySameDir() {
- qApp->processEvents();
- QStringList curFileList = getPath();
- QString curFile, item, destFile;
- InputDialog *fileDlg;
-
- QDir *thisDir = CurrentDir();
-
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
- item=(*it);
- curFile = thisDir->canonicalPath()+"/"+ item;
-
- fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0);
- fileDlg->setInputText((const QString &) destFile );
- fileDlg->exec();
-
- if( fileDlg->result() == 1 ) {
-
- QString filename = fileDlg->LineEdit1->text();
- destFile = thisDir->canonicalPath()+"/"+filename;
-
- QFile f(destFile);
- if( f.exists()) {
- switch (QMessageBox::warning(this,tr("Delete"),
- destFile+tr(" already exists.\nDo you really want to delete it?"),
- tr("Yes"),tr("No"),0,0,1) ) {
- case 0:
-
- f.remove();
- break;
- case 1:
- return;
- break;
- };
- }
- if(!copyFile( curFile,destFile) ) {
- QMessageBox::message("AdvancedFm",tr("Could not copy\n")
- +curFile +tr("to\n")+destFile);
- return;
- }
-
-// qDebug("copy "+curFile+" as "+destFile);
- }
- delete fileDlg;
- }
- rePopulate();
-}
-
-void AdvancedFm::move() {
- qApp->processEvents();
-
- QStringList curFileList = getPath();
- if( curFileList.count() > 0) {
- QString curFile, destFile, item;
-
- QDir *thisDir = CurrentDir();
- QDir *thatDir = OtherDir();
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
- item=(*it);
- QString destFile = thatDir->canonicalPath();
-
- if(destFile.right(1).find("/",0,TRUE) == -1)
- destFile+="/";
- destFile += item;
-// qDebug("Destination file is "+destFile);
-
- curFile = thisDir->canonicalPath();
- if(curFile.right(1).find("/",0,TRUE) == -1)
- curFile +="/";
- curFile+= item;
-// qDebug("CurrentFile file is " + curFile);
-
- if(QFileInfo(curFile).isDir()) {
- moveDirectory( curFile, destFile );
- rePopulate();
- return;
- }
-
- QFile f( curFile);
- if( f.exists()) {
- if( !copyFile( curFile, destFile) ) {
- QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile);
- return;
- } else
- QFile::remove(curFile);
- }
- }
-
- }
- rePopulate();
- setOtherTabCurrent();
-}
-
-bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
- int err = 0;
- if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src;
- err = system((const char*)cmd);
- } else
- err = -1;
-
- if(err!=0) {
- QMessageBox::message(tr("Note"),tr("Could not move\n") + src);
- return false;
- }
- return true;
-}
-
-bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
-
- QString cmd = "/bin/cp -fpR " + src + " " + dest;
- qWarning(cmd);
- int err = system( (const char *) cmd );
- if ( err != 0 ) {
- QMessageBox::message("AdvancedFm",
- tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) );
- return false;
- }
-
- return true;
-}
-
-
-bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
-
-
- if(QFileInfo(src).isDir()) {
- if( copyDirectory( src, dest )) {
- setOtherTabCurrent();
- populateView();
- return true;
- }
- else
- return false;
- }
-
-
- bool success = true;
- struct stat status;
- QFile srcFile(src);
- QFile destFile(dest);
- int err=0;
- int read_fd=0;
- int write_fd=0;
- struct stat stat_buf;
- off_t offset = 0;
- if(!srcFile.open( IO_ReadOnly|IO_Raw)) {
-// qWarning("open failed");
- return success = false;
- }
- read_fd = srcFile.handle();
- if(read_fd != -1) {
- fstat (read_fd, &stat_buf);
- if( !destFile.open( IO_WriteOnly|IO_Raw ) ) {
-// qWarning("destfile open failed");
- return success = false;
- }
- write_fd = destFile.handle();
- if(write_fd != -1) {
- err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size);
- if( err == -1) {
- QString msg;
- switch(err) {
- case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. ";
- case EINVAL: msg = "Descriptor is not valid or locked. ";
- case ENOMEM: msg = "Insufficient memory to read from in_fd.";
- case EIO: msg = "Unspecified error while reading from in_fd.";
- };
- success = false;
-// qWarning(msg);
- }
- } else {
- success = false;
- }
- } else {
- success = false;
- }
- srcFile.close();
- destFile.close();
- // Set file permissions
- if( stat( (const char *) src, &status ) == 0 ) {
- chmod( (const char *) dest, status.st_mode );
- }
-
- return success;
-}
-
-void AdvancedFm::runCommand() {
- if( !CurrentView()->currentItem()) return;
- QDir *thisDir = CurrentDir();
-
- QString curFile;
- curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0);
-
- InputDialog *fileDlg;
- fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
- fileDlg->setInputText(curFile);
- fileDlg->exec();
- //QString command;
-
- if( fileDlg->result() == 1 ) {
-// qDebug(fileDlg->LineEdit1->text());
- QStringList command;
-
- command << "/bin/sh";
- command << "-c";
- command << fileDlg->LineEdit1->text();
- Output *outDlg;
- outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
- QPEApplication::execDialog( outDlg );
- qApp->processEvents();
-
- }
-}
-
-void AdvancedFm::runCommandStd() {
- if( !CurrentView()->currentItem()) return;
- QString curFile;
- QDir *thisDir = CurrentDir();
- QListView *thisView = CurrentView();
- if( thisView->currentItem())
- curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0);
-
- InputDialog *fileDlg;
- fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
- fileDlg->setInputText(curFile);
- fileDlg->exec();
-
- if( fileDlg->result() == 1 ) {
- qApp->processEvents();
- startProcess( (const QString)fileDlg->LineEdit1->text().latin1());
- }
-}
-
-void AdvancedFm::fileStatus() {
- if( !CurrentView()->currentItem()) return;
- QString curFile;
- curFile = CurrentView()->currentItem()->text(0);
-
- QStringList command;
- command << "/bin/sh";
- command << "-c";
- command << "stat -l "+ curFile;
-
- Output *outDlg;
- outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
- QPEApplication::execDialog( outDlg );
- qApp->processEvents();
-}
-
-
-void AdvancedFm::mkDir() {
- makeDir();
-}
-
-void AdvancedFm::rn() {
- renameIt();
-}
-
-void AdvancedFm::del() {
- doDelete();
-}
-
-void AdvancedFm::mkSym() {
- QString cmd;
- QStringList curFileList = getPath();
- if( curFileList.count() > 0) {
- QDir *thisDir = CurrentDir();
- QDir * thatDir = OtherDir();
-
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
-
- QString destName = thatDir->canonicalPath()+"/"+(*it);
- if(destName.right(1) == "/") {
- destName = destName.left( destName.length() -1);
- }
-
- QString curFile = thisDir->canonicalPath()+"/"+(*it);
-
- if( curFile.right(1) == "/") {
- curFile = curFile.left( curFile.length() -1);
- }
-
- cmd = "ln -s "+curFile+" "+destName;
-// qDebug(cmd);
- startProcess( (const QString)cmd );
- }
- rePopulate();
- setOtherTabCurrent();
- }
-}
-
-void AdvancedFm::doBeam() {
- Ir ir;
- if(!ir.supported()) {
- } else {
- QStringList curFileList = getPath();
- if( curFileList.count() > 0) {
- for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
- QString curFile = (*it);
- QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile;
- if( curFilePath.right(1) == "/") {
- curFilePath = curFilePath.left( curFilePath.length() -1);
- }
- Ir *file = new Ir(this, "IR");
- connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*)));
- file->send( curFilePath, curFile );
- }
- }
- }
-}
-
-void AdvancedFm::fileBeamFinished( Ir *) {
- QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
-}
-
-void AdvancedFm::selectAll() {
- QListView *thisView = CurrentView();
- thisView->selectAll(true);
- thisView->setSelected( thisView->firstChild(),false);
-}
-
-void AdvancedFm::startProcess(const QString & cmd) {
- QStringList command;
- OProcess *process;
- process = new OProcess();
- connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
- this, SLOT( processEnded(Opie::Core::OProcess*)));
-
- connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
- this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
-
- command << "/bin/sh";
- command << "-c";
- command << cmd.latin1();
- *process << command;
- if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
- qDebug("could not start process");
-}
-
-void AdvancedFm::processEnded(OProcess *) {
- rePopulate();
-}
-
-void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) {
-// qWarning("received stderrt %d bytes", buflen);
-
- QString lineStr = buffer;
- QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
-}
-
-bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
- if ( o->inherits( "QLineEdit" ) ) {
- if ( e->type() == QEvent::KeyPress ) {
- QKeyEvent *ke = (QKeyEvent*)e;
- if ( ke->key() == Key_Return ||
- ke->key() == Key_Enter ) {
- okRename();
- return true;
- }
- else if ( ke->key() == Key_Escape ) {
- cancelRename();
- return true;
- }
- }
- else if ( e->type() == QEvent::FocusOut ) {
- cancelRename();
- return true;
- }
- }
- if ( o->inherits( "QListView" ) ) {
- if ( e->type() == QEvent::FocusIn ) {
- if( o == Local_View) { //keep track of which view
- whichTab=1;
- }
- else {
- whichTab=2;
- }
- }
- OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection
- }
-
- return QWidget::eventFilter( o, e );
-}
-
-
-void AdvancedFm::cancelRename() {
-// qDebug("cancel rename");
- QListView * view;
- view = CurrentView();
-
- bool resetFocus = view->viewport()->focusProxy() == renameBox;
- delete renameBox;
- renameBox = 0;
- if ( resetFocus ) {
- view->viewport()->setFocusProxy( view);
- view->setFocus();
- }
-}
-
-void AdvancedFm::doRename(QListView * view) {
- if( !CurrentView()->currentItem()) return;
-
- QRect r = view->itemRect( view->currentItem( ));
- r = QRect( view->viewportToContents( r.topLeft() ), r.size() );
- r.setX( view->contentsX() );
-
- if ( r.width() > view->visibleWidth() )
- r.setWidth( view->visibleWidth() );
-
- renameBox = new QLineEdit( view->viewport(), "qt_renamebox" );
- renameBox->setFrame(true);
-
- renameBox->setText( view->currentItem()->text(0) );
-
- renameBox->selectAll();
- renameBox->installEventFilter( this );
-
- view->addChild( renameBox, r.x(), r.y() );
-
- renameBox->resize( r.size() );
-
- view->viewport()->setFocusProxy( renameBox );
-
- renameBox->setFocus();
- renameBox->show();
-}
-
-
-void AdvancedFm::renameIt() {
- if( !CurrentView()->currentItem()) return;
-
- QListView *thisView = CurrentView();
- oldName = thisView->currentItem()->text(0);
- doRename( thisView );
-}
-
-void AdvancedFm::okRename() {
- if( !renameBox) return;
-
- QString newName = renameBox->text();
- cancelRename();
- QListView * view = CurrentView();
- QString path = CurrentDir()->canonicalPath() + "/";
- oldName = path + oldName;
- newName = path + newName;
- if( rename( oldName.latin1(), newName.latin1())== -1)
- QMessageBox::message(tr("Note"),tr("Could not rename"));
- else
- oldName = "";
- QListViewItem *item = view->currentItem();
- view->takeItem( item );
- delete item;
- rePopulate();
-}
-
-void AdvancedFm::openSearch() {
- QMessageBox::message(tr("Note"),tr("Not Yet Implemented"));
-}
+/*************************************************************************** + AdvancedFm.cpp + ------------------- + ** Created: Sat Mar 9 23:33:09 2002 + copyright : (C) 2002 by ljp + email : ljp@llornkcor.com + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + ***************************************************************************/ + +#include "advancedfm.h" +#include "output.h" +#include "filePermissions.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/lnkproperties.h> +#include <qpe/qpeapplication.h> +#include <qpe/applnk.h> +using namespace Opie::Core; + +/* QT*/ + +#include <qmessagebox.h> +#include <qpopupmenu.h> +#include <qlistview.h> + +/* STD */ + +#include <errno.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/stat.h> +#include <dirent.h> +#include <sys/sendfile.h> +#include <fcntl.h> + +void AdvancedFm::doDirChange() { + QString pathItem = CurrentView()->currentItem()->text(0); + if( pathItem == "../") { + ListClicked( CurrentView()->currentItem()); + } else { + if( pathItem.find(" -> ",0,TRUE) != -1) + pathItem = dealWithSymName((const QString&)pathItem)+"/"; +// owarn << pathItem << oendl; + gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); + } +} + +void AdvancedFm::showMenuHidden() { + if (b) { + CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); + OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); + fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); + } else { + CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); + OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); + fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); + } + b = !b; + populateView(); +} + +void AdvancedFm::showHidden() { + if (b) { + CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); + OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); + } else { + CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); + OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); + } + populateView(); +} + +QString AdvancedFm::dealWithSymName(const QString &fileName) { + QString strItem = fileName; + return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); +} + +void AdvancedFm::runThis() { + if( !CurrentView()->currentItem()) return; + QString fs; + QDir *thisDir = CurrentDir(); + + QString curFile = CurrentView()->currentItem()->text(0); + QString path = thisDir->canonicalPath(); + + if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink + + curFile = dealWithSymName((const QString&)curFile); + + if(curFile != "../") { + + fs = getFileSystemType((const QString &) path); + QFileInfo fileInfo( path + "/" + curFile); +// odebug << fileInfo.owner() << oendl; + + if( (fileInfo.permission( QFileInfo::ExeUser) + | fileInfo.permission( QFileInfo::ExeGroup) + | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { + | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { + QCopEnvelope e("QPE/System", "execute(QString)" ); + e << curFile; + } else { + curFile = path + "/" + curFile; + DocLnk nf(curFile); + QString execStr = nf.exec(); +// odebug << execStr << oendl; + if( execStr.isEmpty() ) { + } else { + nf.execute(); + } + } + } +} + +void AdvancedFm::runText() { + if( !CurrentView()->currentItem()) return; + QString curFile = CurrentView()->currentItem()->text(0); + if(curFile != "../") { + if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink + curFile = dealWithSymName((const QString&)curFile); + curFile = CurrentDir()->canonicalPath()+"/"+curFile; + QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); + e << curFile; + } +} + +void AdvancedFm::makeDir() { + InputDialog *fileDlg; + fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); + fileDlg->exec(); + if( fileDlg->result() == 1 ) { + QDir *thisDir = CurrentDir(); + QString filename = fileDlg->LineEdit1->text(); + thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); + } + populateView(); +} + +void AdvancedFm::doDelete() { + QStringList curFileList = getPath(); + bool doMsg=true; + int count = curFileList.count(); + if( count > 0) { + if(count > 1 ) { + QString msg; + msg=tr("Really delete\n%1 files?").arg(count); + switch ( QMessageBox::warning(this,tr("Delete"),msg + ,tr("Yes"),tr("No"),0,0,1) ) + { + case 0: + doMsg=false; + break; + case 1: + return; + break; + }; + } + + QString myFile; + + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + myFile = (*it); + if( myFile.find(" -> ",0,TRUE) != -1) + myFile = myFile.left( myFile.find(" -> ",0,TRUE)); + + QString f = CurrentDir()->canonicalPath(); + if(f.right(1).find("/",0,TRUE) == -1) + f += "/"; + f += myFile; + if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { + //if file is a directory + + switch ( QMessageBox::warning( this, tr("Delete Directory?"), + tr("Really delete %1\nand all it's contents ?" ).arg( f ) , + tr("Yes"), tr("No"), 0, 0, 1) ) { + case 0: + { + f=f.left(f.length()-1); + QString cmd="rm -rf "+f; + startProcess( (const QString)cmd.latin1() ); + populateView(); + } + break; + case 1: + // exit + break; + }; + + } else { + if(doMsg) { + switch ( QMessageBox::warning(this,tr("Delete"), + tr("Really delete\n%1?").arg( myFile ), + tr("Yes"), tr("No"), 0, 0, 1) ) { + case 1: + return; + break; + }; + } + + QString cmd="rm "+f; + QFile file(f); + QFileInfo fi(myFile); + if( fi.fileName().find("../",0,TRUE)==-1) { +// odebug << "remove link files "+myFile << oendl; + +// DocLnk lnk(f); + DocLnk *lnk; + lnk = new DocLnk(f); +// odebug << "Deleting doclnk " + lnk->linkFile() << oendl; + if(lnk->isValid()) + lnk->removeLinkFile(); + // delete lnk; + file.remove(); + } + } + } + } + populateView(); +} + +void AdvancedFm::filePerms() { + QStringList curFileList = getPath(); + QString filePath; + + filePath = CurrentDir()->canonicalPath()+"/"; + + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + filePermissions *filePerm; + filePerm = new filePermissions(this, "Permissions",true,0,(const QString &)(filePath+*it)); + QPEApplication::execDialog( filePerm ); + if( filePerm ) + delete filePerm; + } + populateView(); +} + +void AdvancedFm::doProperties() { +#if defined(QT_QWS_OPIE) + + QStringList curFileList = getPath(); + + QString filePath; + filePath = CurrentDir()->canonicalPath()+"/"; + +// odebug << "" << curFileList.count() << "" << oendl; + + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { +// odebug << (filePath+*it) << oendl; + DocLnk lnk( (filePath+*it)); + LnkProperties prop( &lnk ); + QPEApplication::execDialog( &prop ); + } +#endif + +} + +void AdvancedFm::upDir() { + QDir *thisDir = CurrentDir(); + QString current = thisDir->canonicalPath(); + QDir dir(current); + dir.cdUp(); + current = dir.canonicalPath(); + chdir( current.latin1() ); + thisDir->cd( current, TRUE); + + populateView(); + update(); +} + +void AdvancedFm::copy() { + qApp->processEvents(); + QStringList curFileList = getPath(); + + QDir *thisDir = CurrentDir(); + QDir *thatDir = OtherDir(); + + bool doMsg=true; + int count=curFileList.count(); + if( count > 0) { + if(count > 1 ){ + QString msg; + msg=tr("Really copy\n%1 files?").arg(count); + switch ( QMessageBox::warning(this,tr("Copy"),msg + ,tr("Yes"),tr("No"),0,0,1) ) + { + case 0: + doMsg=false; + break; + case 1: + return; + break; + }; + } + + QString curFile, item, destFile; + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + item=(*it); + if(item.find("->",0,TRUE)) //symlink + item = item.left(item.find("->",0,TRUE)); + + curFile = thisDir->canonicalPath()+"/"+ item; + destFile = thatDir->canonicalPath()+"/"+ item; + +// odebug << "Destination file is "+destFile << oendl; +// odebug << "CurrentFile file is " + curFile << oendl; + + QFile f(destFile); + if( f.exists()) { + if(doMsg) { + switch ( QMessageBox::warning(this,tr("File Exists!"), + tr("%1 exists. Ok to overwrite?").arg( item ), + tr("Yes"),tr("No"),0,0,1) ) { + case 1: + return; + break; + }; + } + f.remove(); + } + + if( !copyFile( curFile, destFile) ) { + QMessageBox::message("AdvancedFm", + tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); + return; + } + } + setOtherTabCurrent(); + rePopulate(); + } +} + +void AdvancedFm::copyAs() { + qApp->processEvents(); + + QStringList curFileList = getPath(); + QString curFile, item; + InputDialog *fileDlg; + + QDir *thisDir = CurrentDir(); + QDir *thatDir = OtherDir(); + + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + QString destFile; + item=(*it); + curFile = thisDir->canonicalPath()+"/"+(*it); + fileDlg = new InputDialog( this, tr("Copy "+curFile+" As"), TRUE, 0); + + fileDlg->setInputText((const QString &) destFile ); + fileDlg->exec(); + + if( fileDlg->result() == 1 ) { + QString filename = fileDlg->LineEdit1->text(); + destFile = thatDir->canonicalPath()+"/"+filename; + + QFile f( destFile); + if( f.exists()) { + switch (QMessageBox::warning(this,tr("File Exists!"), + item+tr("\nexists. Ok to overwrite?"), + tr("Yes"),tr("No"),0,0,1) ) { + case 0: + f.remove(); + break; + case 1: + return; + break; + }; + } + if( !copyFile( curFile, destFile) ) { + QMessageBox::message("AdvancedFm",tr("Could not copy\n") + +curFile +tr("to\n")+destFile); + return; + } + } + delete fileDlg; + + } + rePopulate(); + setOtherTabCurrent(); +} + +void AdvancedFm::copySameDir() { + qApp->processEvents(); + QStringList curFileList = getPath(); + QString curFile, item, destFile; + InputDialog *fileDlg; + + QDir *thisDir = CurrentDir(); + + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + item=(*it); + curFile = thisDir->canonicalPath()+"/"+ item; + + fileDlg = new InputDialog(this,tr("Copy ")+curFile+tr(" As"),TRUE, 0); + fileDlg->setInputText((const QString &) destFile ); + fileDlg->exec(); + + if( fileDlg->result() == 1 ) { + + QString filename = fileDlg->LineEdit1->text(); + destFile = thisDir->canonicalPath()+"/"+filename; + + QFile f(destFile); + if( f.exists()) { + switch (QMessageBox::warning(this,tr("Delete"), + destFile+tr(" already exists.\nDo you really want to delete it?"), + tr("Yes"),tr("No"),0,0,1) ) { + case 0: + + f.remove(); + break; + case 1: + return; + break; + }; + } + if(!copyFile( curFile,destFile) ) { + QMessageBox::message("AdvancedFm",tr("Could not copy\n") + +curFile +tr("to\n")+destFile); + return; + } + +// odebug << "copy "+curFile+" as "+destFile << oendl; + } + delete fileDlg; + } + rePopulate(); +} + +void AdvancedFm::move() { + qApp->processEvents(); + + QStringList curFileList = getPath(); + if( curFileList.count() > 0) { + QString curFile, destFile, item; + + QDir *thisDir = CurrentDir(); + QDir *thatDir = OtherDir(); + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + item=(*it); + QString destFile = thatDir->canonicalPath(); + + if(destFile.right(1).find("/",0,TRUE) == -1) + destFile+="/"; + destFile += item; +// odebug << "Destination file is "+destFile << oendl; + + curFile = thisDir->canonicalPath(); + if(curFile.right(1).find("/",0,TRUE) == -1) + curFile +="/"; + curFile+= item; +// odebug << "CurrentFile file is " + curFile << oendl; + + if(QFileInfo(curFile).isDir()) { + moveDirectory( curFile, destFile ); + rePopulate(); + return; + } + + QFile f( curFile); + if( f.exists()) { + if( !copyFile( curFile, destFile) ) { + QMessageBox::message(tr("Note"),tr("Could not move\n")+curFile); + return; + } else + QFile::remove(curFile); + } + } + + } + rePopulate(); + setOtherTabCurrent(); +} + +bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) { + int err = 0; + if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src; + err = system((const char*)cmd); + } else + err = -1; + + if(err!=0) { + QMessageBox::message(tr("Note"),tr("Could not move\n") + src); + return false; + } + return true; +} + +bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { + + QString cmd = "/bin/cp -fpR " + src + " " + dest; + owarn << cmd << oendl; + int err = system( (const char *) cmd ); + if ( err != 0 ) { + QMessageBox::message("AdvancedFm", + tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); + return false; + } + + return true; +} + + +bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { + + + if(QFileInfo(src).isDir()) { + if( copyDirectory( src, dest )) { + setOtherTabCurrent(); + populateView(); + return true; + } + else + return false; + } + + + bool success = true; + struct stat status; + QFile srcFile(src); + QFile destFile(dest); + int err=0; + int read_fd=0; + int write_fd=0; + struct stat stat_buf; + off_t offset = 0; + if(!srcFile.open( IO_ReadOnly|IO_Raw)) { +// owarn << "open failed" << oendl; + return success = false; + } + read_fd = srcFile.handle(); + if(read_fd != -1) { + fstat (read_fd, &stat_buf); + if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { +// owarn << "destfile open failed" << oendl; + return success = false; + } + write_fd = destFile.handle(); + if(write_fd != -1) { + err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); + if( err == -1) { + QString msg; + switch(err) { + case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; + case EINVAL: msg = "Descriptor is not valid or locked. "; + case ENOMEM: msg = "Insufficient memory to read from in_fd."; + case EIO: msg = "Unspecified error while reading from in_fd."; + }; + success = false; +// owarn << msg << oendl; + } + } else { + success = false; + } + } else { + success = false; + } + srcFile.close(); + destFile.close(); + // Set file permissions + if( stat( (const char *) src, &status ) == 0 ) { + chmod( (const char *) dest, status.st_mode ); + } + + return success; +} + +void AdvancedFm::runCommand() { + if( !CurrentView()->currentItem()) return; + QDir *thisDir = CurrentDir(); + + QString curFile; + curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); + + InputDialog *fileDlg; + fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); + fileDlg->setInputText(curFile); + fileDlg->exec(); + //QString command; + + if( fileDlg->result() == 1 ) { +// odebug << fileDlg->LineEdit1->text() << oendl; + QStringList command; + + command << "/bin/sh"; + command << "-c"; + command << fileDlg->LineEdit1->text(); + Output *outDlg; + outDlg = new Output( command, this, tr("AdvancedFm Output"), true); + QPEApplication::execDialog( outDlg ); + qApp->processEvents(); + + } +} + +void AdvancedFm::runCommandStd() { + if( !CurrentView()->currentItem()) return; + QString curFile; + QDir *thisDir = CurrentDir(); + QListView *thisView = CurrentView(); + if( thisView->currentItem()) + curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); + + InputDialog *fileDlg; + fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); + fileDlg->setInputText(curFile); + fileDlg->exec(); + + if( fileDlg->result() == 1 ) { + qApp->processEvents(); + startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); + } +} + +void AdvancedFm::fileStatus() { + if( !CurrentView()->currentItem()) return; + QString curFile; + curFile = CurrentView()->currentItem()->text(0); + + QStringList command; + command << "/bin/sh"; + command << "-c"; + command << "stat -l "+ curFile; + + Output *outDlg; + outDlg = new Output( command, this, tr("AdvancedFm Output"), true); + QPEApplication::execDialog( outDlg ); + qApp->processEvents(); +} + + +void AdvancedFm::mkDir() { + makeDir(); +} + +void AdvancedFm::rn() { + renameIt(); +} + +void AdvancedFm::del() { + doDelete(); +} + +void AdvancedFm::mkSym() { + QString cmd; + QStringList curFileList = getPath(); + if( curFileList.count() > 0) { + QDir *thisDir = CurrentDir(); + QDir * thatDir = OtherDir(); + + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + + QString destName = thatDir->canonicalPath()+"/"+(*it); + if(destName.right(1) == "/") { + destName = destName.left( destName.length() -1); + } + + QString curFile = thisDir->canonicalPath()+"/"+(*it); + + if( curFile.right(1) == "/") { + curFile = curFile.left( curFile.length() -1); + } + + cmd = "ln -s "+curFile+" "+destName; +// odebug << cmd << oendl; + startProcess( (const QString)cmd ); + } + rePopulate(); + setOtherTabCurrent(); + } +} + +void AdvancedFm::doBeam() { + Ir ir; + if(!ir.supported()) { + } else { + QStringList curFileList = getPath(); + if( curFileList.count() > 0) { + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { + QString curFile = (*it); + QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; + if( curFilePath.right(1) == "/") { + curFilePath = curFilePath.left( curFilePath.length() -1); + } + Ir *file = new Ir(this, "IR"); + connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); + file->send( curFilePath, curFile ); + } + } + } +} + +void AdvancedFm::fileBeamFinished( Ir *) { + QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); +} + +void AdvancedFm::selectAll() { + QListView *thisView = CurrentView(); + thisView->selectAll(true); + thisView->setSelected( thisView->firstChild(),false); +} + +void AdvancedFm::startProcess(const QString & cmd) { + QStringList command; + OProcess *process; + process = new OProcess(); + connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), + this, SLOT( processEnded(Opie::Core::OProcess*))); + + connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), + this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); + + command << "/bin/sh"; + command << "-c"; + command << cmd.latin1(); + *process << command; + if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) + odebug << "could not start process" << oendl; +} + +void AdvancedFm::processEnded(OProcess *) { + rePopulate(); +} + +void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { +// owarn << "received stderrt " << buflen << " bytes" << oendl; + + QString lineStr = buffer; + QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); +} + +bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { + if ( o->inherits( "QLineEdit" ) ) { + if ( e->type() == QEvent::KeyPress ) { + QKeyEvent *ke = (QKeyEvent*)e; + if ( ke->key() == Key_Return || + ke->key() == Key_Enter ) { + okRename(); + return true; + } + else if ( ke->key() == Key_Escape ) { + cancelRename(); + return true; + } + } + else if ( e->type() == QEvent::FocusOut ) { + cancelRename(); + return true; + } + } + if ( o->inherits( "QListView" ) ) { + if ( e->type() == QEvent::FocusIn ) { + if( o == Local_View) { //keep track of which view + whichTab=1; + } + else { + whichTab=2; + } + } + OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection + } + + return QWidget::eventFilter( o, e ); +} + + +void AdvancedFm::cancelRename() { +// odebug << "cancel rename" << oendl; + QListView * view; + view = CurrentView(); + + bool resetFocus = view->viewport()->focusProxy() == renameBox; + delete renameBox; + renameBox = 0; + if ( resetFocus ) { + view->viewport()->setFocusProxy( view); + view->setFocus(); + } +} + +void AdvancedFm::doRename(QListView * view) { + if( !CurrentView()->currentItem()) return; + + QRect r = view->itemRect( view->currentItem( )); + r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); + r.setX( view->contentsX() ); + + if ( r.width() > view->visibleWidth() ) + r.setWidth( view->visibleWidth() ); + + renameBox = new QLineEdit( view->viewport(), "qt_renamebox" ); + renameBox->setFrame(true); + + renameBox->setText( view->currentItem()->text(0) ); + + renameBox->selectAll(); + renameBox->installEventFilter( this ); + + view->addChild( renameBox, r.x(), r.y() ); + + renameBox->resize( r.size() ); + + view->viewport()->setFocusProxy( renameBox ); + + renameBox->setFocus(); + renameBox->show(); +} + + +void AdvancedFm::renameIt() { + if( !CurrentView()->currentItem()) return; + + QListView *thisView = CurrentView(); + oldName = thisView->currentItem()->text(0); + doRename( thisView ); +} + +void AdvancedFm::okRename() { + if( !renameBox) return; + + QString newName = renameBox->text(); + cancelRename(); + QListView * view = CurrentView(); + QString path = CurrentDir()->canonicalPath() + "/"; + oldName = path + oldName; + newName = path + newName; + if( rename( oldName.latin1(), newName.latin1())== -1) + QMessageBox::message(tr("Note"),tr("Could not rename")); + else + oldName = ""; + QListViewItem *item = view->currentItem(); + view->takeItem( item ); + delete item; + rePopulate(); +} + +void AdvancedFm::openSearch() { + QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); +} diff --git a/noncore/apps/advancedfm/filePermissions.cpp b/noncore/apps/advancedfm/filePermissions.cpp index 9698de7..b7d48e8 100644 --- a/noncore/apps/advancedfm/filePermissions.cpp +++ b/noncore/apps/advancedfm/filePermissions.cpp @@ -34,3 +34,3 @@ filePermissions::filePermissions( QWidget* parent, const char* name, bool modal setName( tr("filePermissions") ); -// qDebug("FilePermissions "+fileName); +// odebug << "FilePermissions "+fileName << oendl; /* resize( 236, 210 ); diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp index 6906298..8c585f4 100644 --- a/noncore/apps/advancedfm/output.cpp +++ b/noncore/apps/advancedfm/output.cpp @@ -7,5 +7,9 @@ +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/applnk.h> +using namespace Opie::Core; +/* QT */ #include <qfile.h> @@ -15,2 +19,3 @@ +/* STD */ #include <errno.h> @@ -18,4 +23,2 @@ /* XPM */ -using namespace Opie::Core; -using namespace Opie::Core; static char * filesave_xpm[] = { @@ -123,3 +126,3 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, cmmds=commands; -// qDebug("count %d", cmmds.count()); +// odebug << "count " << cmmds.count() << "" << oendl; if ( !name ) @@ -159,3 +162,3 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { - qDebug( "%s", (*it).latin1() ); + odebug << "" << (*it).latin1() << "" << oendl; * proc << (*it).latin1(); @@ -188,3 +191,3 @@ void Output::saveOutput() { filename+="text/plain/"+name; - qDebug(filename); + odebug << filename << oendl; @@ -198,6 +201,6 @@ void Output::saveOutput() { if(!lnk.writeLink()) { - qDebug("Writing doclink did not work"); + odebug << "Writing doclink did not work" << oendl; } } else - qWarning("Could not write file"); + owarn << "Could not write file" << oendl; f.close(); @@ -207,3 +210,3 @@ void Output::saveOutput() { void Output::commandStdout(OProcess*, char *buffer, int buflen) { - qWarning("received stdout %d bytes", buflen); + owarn << "received stdout " << buflen << " bytes" << oendl; @@ -224,3 +227,3 @@ void Output::commandStdout(OProcess*, char *buffer, int buflen) { void Output::commandStdin( const QByteArray &data) { - qWarning("received stdin %d bytes", data.size()); + owarn << "received stdin " << data.size() << " bytes" << oendl; // recieved data from the io layer goes to sz @@ -230,3 +233,3 @@ void Output::commandStdin( const QByteArray &data) { void Output::commandStderr(OProcess*, char *buffer, int buflen) { - qWarning("received stderrt %d bytes", buflen); + owarn << "received stderrt " << buflen << " bytes" << oendl; diff --git a/noncore/apps/checkbook/checkbook.pro b/noncore/apps/checkbook/checkbook.pro index 34641f4..1472df6 100644 --- a/noncore/apps/checkbook/checkbook.pro +++ b/noncore/apps/checkbook/checkbook.pro @@ -1,2 +1,2 @@ -CONFIG = qt warn_on quick-app +CONFIG = qt warn_on quick-app HEADERS = mainwindow.h \ diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp index d00e305..5026c9d 100644 --- a/noncore/apps/checkbook/listedit.cpp +++ b/noncore/apps/checkbook/listedit.cpp @@ -29,2 +29,9 @@ #include "listedit.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/resource.h> +using namespace Opie::Core; + +/* QT */ #include <qlayout.h> @@ -35,4 +42,2 @@ #include <qpushbutton.h> -#include <qpe/resource.h> - @@ -304,3 +309,3 @@ void ListEdit::slotClick(QListViewItem *itm, const QPoint &pnt, int col) } else { - qDebug( "Unsupported column type for column %s", (const char *)pDef->getName() ); + odebug << "Unsupported column type for column " << (const char *)pDef->getName() << "" << oendl; _typeEdit->setText(""); diff --git a/noncore/apps/checkbook/tabledef.cpp b/noncore/apps/checkbook/tabledef.cpp index 9a42308..745cd80 100644 --- a/noncore/apps/checkbook/tabledef.cpp +++ b/noncore/apps/checkbook/tabledef.cpp @@ -30,2 +30,4 @@ +#include <opie2/odebug.h> +using namespace Opie::Core; @@ -44,3 +46,3 @@ void ColumnDef::addColumnValue(const QString &sValue) if( (_type & 0x00ffffff) !=typeList ) - qDebug("Column %s is not a list", (const char *)_sName); + odebug << "Column " << (const char *)_sName << " is not a list" << oendl; else @@ -51,3 +53,3 @@ void ColumnDef::addColumnValue(const char *sValue) if( (_type & 0x00ffffff)!=typeList ) - qDebug("Column %s is not a list", (const char *)_sName); + odebug << "Column " << (const char *)_sName << " is not a list" << oendl; else diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp index 1b08b24..aafb588 100644 --- a/noncore/apps/checkbook/transaction.cpp +++ b/noncore/apps/checkbook/transaction.cpp @@ -33,4 +33,8 @@ +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/datebookmonth.h> +using namespace Opie::Core; +/* QT */ #include <qbuttongroup.h> @@ -334,3 +338,3 @@ void Transaction::slotNotNew() { - qDebug("Not new"); + odebug << "Not new" << oendl; _bNew=false; diff --git a/noncore/apps/confedit/confedit.pro b/noncore/apps/confedit/confedit.pro index 5a71680..785c588 100644 --- a/noncore/apps/confedit/confedit.pro +++ b/noncore/apps/confedit/confedit.pro @@ -1,21 +1,9 @@ -CONFIG = qt warn_on quick-app -HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h -SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp -INCLUDEPATH += $(OPIEDIR)/include +CONFIG = qt warn_on quick-app +HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h +SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp +INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -INTERFACES = -LIBS += -lopiecore2 +LIBS += -lqpe -lopiecore2 TARGET = confedit -!contains( platform, x11 ) { - - include ( $(OPIEDIR)/include.pro ) - LIBS += -lqpe -} - -contains( platform, x11 ) { - LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib -} - - - +include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/apps/confedit/config.in b/noncore/apps/confedit/config.in index e377307..d7682dc 100644 --- a/noncore/apps/confedit/config.in +++ b/noncore/apps/confedit/config.in @@ -1,3 +1,3 @@ config CONFEDIT - boolean "opie-confeditor (generic editor for all Opie settings)" + boolean "opie-confedit (generic editor for all Opie settings)" default "y" diff --git a/noncore/apps/confedit/listviewconfdir.cpp b/noncore/apps/confedit/listviewconfdir.cpp index 0c2feeb..33bffe1 100644 --- a/noncore/apps/confedit/listviewconfdir.cpp +++ b/noncore/apps/confedit/listviewconfdir.cpp @@ -11,6 +11,10 @@ #include "listviewconfdir.h" +#include "listviewitemconffile.h" -#include <qmessagebox.h> +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; -#include "listviewitemconffile.h" +/* QT */ +#include <qmessagebox.h> @@ -38,3 +42,3 @@ void ListViewConfDir::readConfFiles() - confDir.setFilter( QDir::Files | QDir::NoSymLinks ); + confDir.setFilter( QDir::Files | QDir::NoSymLinks ); confDir.setSorting( QDir::Name ); @@ -49,3 +53,3 @@ void ListViewConfDir::readConfFiles() { - qDebug( "opening: >%s<", fi->fileName().data() ); + odebug << "opening: >" << fi->fileName().data() << "<" << oendl; fileEntry = new ListViewItemConfFile( fi, this ); diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp index 1ff2c44..2958cf5 100644 --- a/noncore/apps/confedit/listviewitemconffile.cpp +++ b/noncore/apps/confedit/listviewitemconffile.cpp @@ -11,5 +11,11 @@ #include "listviewitemconffile.h" +#include "listviewitemconfigentry.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qmessagebox.h> #include <qtextstream.h> -#include "listviewitemconfigentry.h" @@ -21,3 +27,3 @@ ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) confFileInfo = file; -// parseFile(); + // parseFile(); displayText(); @@ -42,4 +48,4 @@ void ListViewItemConfFile::parseFile() { - //qDebug("ListViewItemConfFile::parseFile BEGIN"); - QFile confFile(confFileInfo->absFilePath()); + //odebug << "ListViewItemConfFile::parseFile BEGIN" << oendl; + QFile confFile(confFileInfo->absFilePath()); if(! confFile.open(IO_ReadOnly)) @@ -54,3 +60,3 @@ void ListViewItemConfFile::parseFile() s = t.readLine().stripWhiteSpace(); - //qDebug( "line: >%s<\n", s.latin1() ); + //odebug << "line: >" << s.latin1() << "<\n" << oendl; if (s.contains("<?xml")) @@ -62,3 +68,3 @@ void ListViewItemConfFile::parseFile() { - // qDebug("got group"+s); + // odebug << "got group"+s << oendl; group = s.mid(1,s.length()-2); @@ -70,4 +76,4 @@ void ListViewItemConfFile::parseFile() { -// qDebug("got key"+s); - if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1()); +// odebug << "got key"+s << oendl; + if (!groupItem) odebug << "PANIK NO GROUP! >" << group.latin1() << "<" << oendl; item = new ListViewItemConfigEntry(this, group, s ); @@ -78,3 +84,3 @@ void ListViewItemConfFile::parseFile() setExpandable( _valid ); -// qDebug("ListViewItemConfFile::parseFile END"); +// odebug << "ListViewItemConfFile::parseFile END" << oendl; } diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp index 6ef1043..4b04c97 100644 --- a/noncore/apps/confedit/mainwindow.cpp +++ b/noncore/apps/confedit/mainwindow.cpp @@ -13,3 +13,10 @@ #include "mainwindow.h" +#include "listviewconfdir.h" +#include "listviewitemconfigentry.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qlabel.h> @@ -18,6 +25,2 @@ -#include "listviewconfdir.h" -#include "listviewitemconfigentry.h" - - MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : @@ -35,3 +38,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : - qDebug("creating settingList"); + odebug << "creating settingList" << oendl; settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); @@ -40,3 +43,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : - qDebug("creating editor"); + odebug << "creating editor" << oendl; editor = new EditWidget(this); @@ -100,3 +103,3 @@ void MainWindow::setCurrent(QListViewItem *item) { -// qDebug("MainWindow::setCurrent"); +// odebug << "MainWindow::setCurrent" << oendl; if (!item) return; @@ -176,3 +179,3 @@ void MainWindow::showPopup() { -qDebug("showPopup"); +odebug << "showPopup" << oendl; if (!_item) return; diff --git a/noncore/apps/keyz-cfg/cfgfile.cpp b/noncore/apps/keyz-cfg/cfgfile.cpp index b0dc968..81d1ee1 100644 --- a/noncore/apps/keyz-cfg/cfgfile.cpp +++ b/noncore/apps/keyz-cfg/cfgfile.cpp @@ -1,4 +1,10 @@ -#include <qmessagebox.h> #include "cfgfile.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ +#include <qmessagebox.h> + // CfgEntry implementation @@ -97,3 +103,3 @@ bool CfgParser::load(QString file, CfgFile& cfg) { if (!err.isEmpty()) { - qDebug(err); + odebug << err << oendl; return false; @@ -108,3 +114,3 @@ bool CfgParser::load(QString file, CfgFile& cfg) { - qDebug("include: file=" + fit.key() + ", prefix=" + fit.data()); + odebug << "include: file=" + fit.key() + ", prefix=" + fit.data() << oendl; lit = labels.find(prefix+":*"); diff --git a/noncore/apps/keyz-cfg/config.in b/noncore/apps/keyz-cfg/config.in index 29a10f5..8e1be2d 100644 --- a/noncore/apps/keyz-cfg/config.in +++ b/noncore/apps/keyz-cfg/config.in @@ -3,2 +3,2 @@ default "n" - depends ( LIBQPE || LIBQPE-X11 ) + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE diff --git a/noncore/apps/keyz-cfg/keyz-cfg.pro b/noncore/apps/keyz-cfg/keyz-cfg.pro index 44bbb5f..7ac604b 100644 --- a/noncore/apps/keyz-cfg/keyz-cfg.pro +++ b/noncore/apps/keyz-cfg/keyz-cfg.pro @@ -4,7 +4,7 @@ CONFIG = qt warn_on HEADERS = zkb.h \ - zkbcfg.h \ - zkbnames.h \ - zkbxml.h \ - cfgdlg.h \ - cfgfile.h + zkbcfg.h \ + zkbnames.h \ + zkbxml.h \ + cfgdlg.h \ + cfgfile.h @@ -15,4 +15,4 @@ SOURCES = main.cpp \ zkbcfg.cpp \ - zkbnames.cpp \ - zkbxml.cpp + zkbnames.cpp \ + zkbxml.cpp @@ -20,3 +20,3 @@ INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopiecore2 TARGET = keyz-cfg diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp index f315d4b..8382615 100644 --- a/noncore/apps/keyz-cfg/zkb.cpp +++ b/noncore/apps/keyz-cfg/zkb.cpp @@ -366,3 +366,3 @@ State* Keymap::getStateByLabel(const QString& label) { -// qDebug("look for: %s\n", (const char*) name.utf8()); +// odebug << "look for: " << (const char*) name.utf8() << "\n" << oendl; QMap<QString, State*>::Iterator sit = states.find(name); @@ -418,3 +418,3 @@ bool Keymap::setCurrentState(State* state) { } else { -// qDebug("no label for: " + currentStateName + "\n"); +// odebug << "no label for: " + currentStateName + "\n" << oendl; currentLabel = ""; diff --git a/noncore/apps/keyz-cfg/zkbcfg.cpp b/noncore/apps/keyz-cfg/zkbcfg.cpp index 0992b9a..f1d53ba 100644 --- a/noncore/apps/keyz-cfg/zkbcfg.cpp +++ b/noncore/apps/keyz-cfg/zkbcfg.cpp @@ -1,5 +1,9 @@ -#include <qfileinfo.h> - #include "zkbcfg.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ +#include <qfileinfo.h> @@ -17,3 +21,3 @@ bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) - qDebug("start loading file=%s\n", (const char*) file.utf8()); + odebug << "start loading file=" << (const char*) file.utf8() << "\n" << oendl; if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) { @@ -32,4 +36,3 @@ bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) - qDebug("end loading file=%s : status=%s\n", (const char*) file.utf8(), - (const char*) err.utf8()); + odebug << "end loading file=" << file.utf8() << ": status=" << err.utf8() << oendl; return ret; @@ -124,3 +127,3 @@ bool ZkbHandler::startStateElement(const QString& name, -// qDebug("state name=%s\n", (const char*) currentStateName.utf8()); +// odebug << "state name=" << (const char*) currentStateName.utf8() << "\n" << oendl; diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp index e6cb515..59fc242 100644 --- a/noncore/apps/opie-bartender/bartender.cpp +++ b/noncore/apps/opie-bartender/bartender.cpp @@ -18,8 +18,9 @@ -#include <qtoolbar.h> -#include <qmenubar.h> -//#include <opie2/colorpopupmenu.h> +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> +using namespace Opie::Core; +/* QT */ #include <qlineedit.h> @@ -35,3 +36,6 @@ #include <qlayout.h> +#include <qtoolbar.h> +#include <qmenubar.h> +/* STD */ #include <fcntl.h> @@ -42,3 +46,2 @@ - Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) @@ -146,3 +149,3 @@ void Bartender::fillList() { if(s.find("#",0,TRUE) != -1) { -// qDebug(s.right(s.length()-2)); +// odebug << s.right(s.length()-2) << oendl; item= new QListViewItem( DrinkView, 0 ); @@ -152,3 +155,3 @@ void Bartender::fillList() { } - qDebug("there are currently %d of drinks", i); + odebug << "there are currently " << i << " of drinks" << oendl; } @@ -173,3 +176,3 @@ void Bartender::fileNew() { newDrink.append(newIng+"\n"); - qDebug("writing "+newDrink); + odebug << "writing "+newDrink << oendl; dbFile.writeBlock( newDrink.latin1(), newDrink.length()); @@ -209,3 +212,3 @@ void Bartender::showDrink( QListViewItem *item) { if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { -// qDebug(s2); +// odebug << s2 << oendl; showDrinks->MultiLineEdit1->append(s2); @@ -250,3 +253,3 @@ void Bartender::doSearchByName() { if ( it.current()->text(0).find( searchForDrinkName, 0, TRUE) != -1 ) { -// qDebug( it.current()->text(0)); +// odebug << it.current()->text(0) << oendl; searchList.append(it.current()->text(0)); @@ -281,6 +284,6 @@ void Bartender::doSearchByDrink() { lastDrinkName=s.right(s.length()-2); -// qDebug("last drink name "+lastDrinkName); +// odebug << "last drink name "+lastDrinkName << oendl; } else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { -// qDebug("appending "+lastDrinkName); +// odebug << "appending "+lastDrinkName << oendl; searchList.append( lastDrinkName); @@ -315,3 +318,3 @@ void Bartender::showSearchResult(QStringList &searchList) { if ( it2.current()->text(0)== result ) { -// qDebug( it2.current()->text(0)); +// odebug << it2.current()->text(0) << oendl; showDrink(it2.current()); @@ -345,3 +348,3 @@ void Bartender::doEdit() { if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { -// qDebug(s2); +// odebug << s2 << oendl; newDrinks->MultiLineEdit1->append(s2); @@ -372,3 +375,3 @@ void Bartender::doEdit() { newDrink.append(newIng+"\n"); - qDebug("writing "+newDrink); + odebug << "writing "+newDrink << oendl; dbFile.writeBlock( newDrink.latin1(), newDrink.length()); @@ -399,3 +402,3 @@ void Bartender::openCurrentDrink() { void Bartender::fileMenuActivated( int item) { - qDebug("Item %d", item); + odebug << "Item " << item << "" << oendl; switch(item) { @@ -420,3 +423,3 @@ void Bartender::fileMenuActivated( int item) { void Bartender::editMenuActivated(int item) { - qDebug("Item %d", item); + odebug << "Item " << item << "" << oendl; /* diff --git a/noncore/apps/opie-bartender/bartender.pro b/noncore/apps/opie-bartender/bartender.pro index 4ad3c31..41fc0e5 100644 --- a/noncore/apps/opie-bartender/bartender.pro +++ b/noncore/apps/opie-bartender/bartender.pro @@ -1,3 +1,2 @@ TEMPLATE = app -#CONFIG = qt warn_on CONFIG = qt warn_on @@ -7,5 +6,5 @@ INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -DESTDIR = $(OPIEDIR)/bin -TARGET = bartender +LIBS += -lqpe -lopiecore2 +DESTDIR = $(OPIEDIR)/bin +TARGET = bartender diff --git a/noncore/apps/opie-bartender/config.in b/noncore/apps/opie-bartender/config.in index c6ca2e6..c39a7d6 100644 --- a/noncore/apps/opie-bartender/config.in +++ b/noncore/apps/opie-bartender/config.in @@ -3,2 +3,3 @@ default "n" - depends ( LIBQPE || LIBQPE-X11 ) + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE + diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index a37f980..6d57703 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp @@ -65,3 +65,10 @@ +#include "procctl.h" +#include "MyPty.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qsocketnotifier.h> @@ -69,2 +76,3 @@ +/* STD */ #include <stdlib.h> @@ -83,6 +91,2 @@ -#include "procctl.h" -#include "MyPty.h" - - #undef VERBOSE_DEBUG @@ -99,3 +103,3 @@ void MyPty::setSize(int lines, int columns) { - qWarning("setting size"); + owarn << "setting size" << oendl; struct winsize wsize; diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index e535296..d168a5e 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp @@ -1031,3 +1031,3 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) static bool alt = FALSE; -// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); +// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; bool dele=FALSE; @@ -1070,3 +1070,3 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) -// qDebug("key pressed is 0x%x",ke->key()); +// odebug << "key pressed is 0x" << ke->key() << "" << oendl; @@ -1074,3 +1074,3 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) -// qDebug("key pressed 2 is 0x%x",ke->key()); +// odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl; emitText("\\"); // expose diff --git a/noncore/apps/opie-console/TEmulation.cpp b/noncore/apps/opie-console/TEmulation.cpp index d0169d7..6ff73af 100644 --- a/noncore/apps/opie-console/TEmulation.cpp +++ b/noncore/apps/opie-console/TEmulation.cpp @@ -72,2 +72,8 @@ #include "TEmulation.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* STD */ #include <stdio.h> @@ -206,3 +212,3 @@ void TEmulation::onKeyPress( QKeyEvent* ev ) { - qWarning("onKeyPress,...."); + owarn << "onKeyPress,...." << oendl; if (!connected) return; // someone else gets the keys diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp index 8e91b9e..c998f96 100644 --- a/noncore/apps/opie-console/atconfigdialog.cpp +++ b/noncore/apps/opie-console/atconfigdialog.cpp @@ -1,2 +1,9 @@ +#include "atconfigdialog.h" +#include "io_modem.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qlineedit.h> @@ -9,6 +16,2 @@ -#include "atconfigdialog.h" -#include "io_modem.h" - - ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) @@ -154,3 +157,3 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) { void ATConfigDialog::readConfig( const Profile& config ) { - qWarning("config in atconfigdialog"); + owarn << "config in atconfigdialog" << oendl; diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 67ad10e..7010594 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp @@ -1,3 +1,9 @@ #include "dialer.h" +#include "io_modem.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; +/* QT */ #include <qlayout.h> @@ -10,2 +16,3 @@ +/* STD */ #include <unistd.h> @@ -15,4 +22,2 @@ -#include "io_modem.h" - // State machine: | When an error occurs, we don't have to @@ -106,3 +111,3 @@ void Dialer::reset() { - qWarning("reset"); + owarn << "reset" << oendl; switchState(state_cancel); @@ -138,3 +143,3 @@ void Dialer::trydial(const QString& number) { - qWarning("TryDial:%s", number.latin1() ); + owarn << "TryDial:" << number.latin1() << "" << oendl; if(state != state_cancel) switchState(state_preinit); @@ -142,3 +147,3 @@ void Dialer::trydial(const QString& number) { - qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING)); + owarn << "HangupString " << m_profile.readEntry("HangupString") << oendl; send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); @@ -149,3 +154,3 @@ void Dialer::trydial(const QString& number) switchState(state_init); -// qWarning("Init String " + m_profile.readEntry("InitString") ); +// owarn << "Init String " + m_profile.readEntry("InitString") << oendl; send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); @@ -160,3 +165,3 @@ void Dialer::trydial(const QString& number) - qWarning("ATM3l3"); + owarn << "ATM3l3" << oendl; send("ATM3L3\r"); @@ -180,3 +185,3 @@ void Dialer::trydial(const QString& number) { - qWarning("progress"); + owarn << "progress" << oendl; switchState(state_dialing); @@ -216,3 +221,3 @@ void Dialer::send(const QString& msg) - qWarning("Sending: %s", m.latin1()); + owarn << "Sending: " << m.latin1() << "" << oendl; @@ -249,3 +254,3 @@ QString Dialer::receive() buffer[ret] = 0; - qWarning("Got: %s", buffer); + owarn << "Got: " << buffer << "" << oendl; buf.append(QString(buffer)); @@ -253,3 +258,3 @@ QString Dialer::receive() { - //qWarning("Receiving: '%s'", buf.latin1()); + //owarn << "Receiving: '" << buf.latin1() << "'" << oendl; cleanshutdown = 1; diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 99d069f..89b70c6 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp @@ -1,4 +1,2 @@ - #include "TEmuVt102.h" - #include "profile.h" @@ -7,2 +5,6 @@ +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) @@ -130,3 +132,3 @@ QColor EmulationHandler::foreColor(int col) { case Profile::Green: - qWarning("Foreground green"); + owarn << "Foreground green" << oendl; co = Qt::green; @@ -134,3 +136,3 @@ QColor EmulationHandler::foreColor(int col) { case Profile::Orange: - qWarning("Foreground orange"); + owarn << "Foreground orange" << oendl; co.setRgb( 231, 184, 98 ); @@ -154,3 +156,3 @@ QColor EmulationHandler::backColor(int col ) { case Profile::Green: - qWarning("Background black"); + owarn << "Background black" << oendl; co = Qt::black; @@ -158,3 +160,3 @@ QColor EmulationHandler::backColor(int col ) { case Profile::Orange: - qWarning("Background black"); + owarn << "Background black" << oendl; co = Qt::black; diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp index ad8ecba..4688551 100644 --- a/noncore/apps/opie-console/emulation_widget.cpp +++ b/noncore/apps/opie-console/emulation_widget.cpp @@ -226,5 +226,5 @@ void EmulationWidget::calcGeometry() - qDebug( QString(" TEST").arg( contentsRect().width() ) ); - qDebug( QString(" TEST").arg( contentsRect().height() ) ); - qDebug("NEUER TESTT!!!!!!!!"); + odebug << QString(" TEST").arg( contentsRect().width() ) << oendl; + odebug << QString(" TEST").arg( contentsRect().height() ) << oendl; + odebug << "NEUER TESTT!!!!!!!!" << oendl; @@ -260,3 +260,3 @@ void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect { - qWarning("Color1 %s", color_table[attr.b].color.name().latin1() ); + owarn << "Color1 " << color_table[attr.b].color.name().latin1() << "" << oendl; if ( usePixmap && color_table[attr.b].transparent ) @@ -274,3 +274,3 @@ void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect painter.setBackgroundMode( OpaqueMode ); - qWarning("Color %s", color_table[attr.b].color.name().latin1() ); + owarn << "Color " << color_table[attr.b].color.name().latin1() << "" << oendl; painter.setBackgroundColor( color_table[attr.b].color ); diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index eb32551..6613183 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp @@ -2,2 +2,7 @@ +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qlayout.h> @@ -39,3 +44,3 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : } - //qWarning("loaded %d keys", keys.count()); + //owarn << "loaded " << keys.count() << " keys" << oendl; */ @@ -258,3 +263,3 @@ FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* par { - qWarning("FunctionKeyboardConfig"); + owarn << "FunctionKeyboardConfig" << oendl; diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index a29fa8e..c102427 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp @@ -3,3 +3,6 @@ +/* OPIE */ +#include <opie2/odebug.h> using namespace Opie::Core; + IOBt::IOBt( const Profile &config ) : IOSerial( config ) { @@ -45,3 +48,3 @@ bool IOBt::open() { } else { - qWarning("could not attach to device"); + owarn << "could not attach to device" << oendl; delete m_attach; @@ -91,3 +94,3 @@ bool IOBt::isConnected() { void IOBt::send(const QByteArray &data) { - qDebug( "Please overload me..." ); + odebug << "Please overload me..." << oendl; } diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index 07c2b62..38542f5 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp @@ -1,5 +1,7 @@ - #include "io_irda.h" +/* OPIE */ +#include <opie2/odebug.h> using namespace Opie::Core; + IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { @@ -37,3 +39,3 @@ bool IOIrda::open() { // emit error!!! - qWarning("could not attach to device"); + owarn << "could not attach to device" << oendl; delete m_attach; @@ -76,3 +78,3 @@ bool IOIrda::isConnected() { void IOIrda::send(const QByteArray &data) { - qDebug( "Please overload me..." ); + odebug << "Please overload me..." << oendl; } diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index b74d076..c499dfe 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -2,7 +2,8 @@ #include "io_modem.h" - #include "dialer.h" +/* OPIE */ +#include <opie2/odebug.h> using namespace Opie::Core; -using namespace Opie::Core; + IOModem::IOModem( const Profile &profile ) @@ -14,3 +15,2 @@ IOModem::IOModem( const Profile &profile ) IOModem::~IOModem() { - } @@ -106,3 +106,3 @@ bool IOModem::isConnected() { void IOModem::send(const QByteArray &data) { - qDebug( "Please overload me..." ); + odebug << "Please overload me..." << oendl; } diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp index dfb2f83..1bd4338 100644 --- a/noncore/apps/opie-console/main.cpp +++ b/noncore/apps/opie-console/main.cpp @@ -93,3 +93,3 @@ int main(int argc, char **argv) { #ifdef FSCKED_DISTRIBUTION - qWarning("fscked"); + owarn << "fscked" << oendl; FixIt it; diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 06a8f7d..b403b4d 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -1,14 +1 @@ -#include <assert.h> - -#include <qaction.h> -#include <qmenubar.h> -#include <qtoolbar.h> -#include <qmessagebox.h> -#include <qwhatsthis.h> -#include <qfileinfo.h> - -#include <qpe/filemanager.h> - -#include <opie2/ofiledialog.h> - #include "TEmulation.h" @@ -25,4 +12,20 @@ - +/* OPIE */ +#include <opie2/odebug.h> +#include <opie2/ofiledialog.h> +#include <qpe/filemanager.h> +using namespace Opie::Core; using namespace Opie::Ui; + +/* QT */ +#include <qaction.h> +#include <qmenubar.h> +#include <qtoolbar.h> +#include <qmessagebox.h> +#include <qwhatsthis.h> +#include <qfileinfo.h> + +/* STD */ +#include <assert.h> + MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { @@ -448,3 +451,3 @@ void MainWindow::slotClose() { Session* ses = currentSession(); - qWarning("removing! currentSession %s", currentSession()->name().latin1() ); + owarn << "removing! currentSession " << currentSession()->name().latin1() << "" << oendl; /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ @@ -454,3 +457,3 @@ void MainWindow::slotClose() { m_sessions.remove( ses ); - qWarning("after remove!!"); + owarn << "after remove!!" << oendl; @@ -572,3 +575,3 @@ void MainWindow::slotOpenButtons( bool state ) { void MainWindow::slotSessionChanged( Session* ses ) { - qWarning("changed!"); + owarn << "changed!" << oendl; @@ -581,3 +584,3 @@ void MainWindow::slotSessionChanged( Session* ses ) { m_curSession = ses; - qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); + odebug << QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) << oendl; if ( m_curSession->layer()->isConnected() ) { diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index 3466e3a..9fdaf73 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp @@ -1,4 +1,10 @@ +#include "modemconfigwidget.h" +#include "dialdialog.h" +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/qpeapplication.h> +using namespace Opie::Core; +/* QT */ #include <qlabel.h> @@ -9,5 +15,2 @@ -#include "modemconfigwidget.h" -#include "dialdialog.h" - namespace { @@ -137,3 +140,3 @@ void ModemConfigWidget::load( const Profile& prof ) { if ( prof.readEntry( "Device" ).isEmpty() ) { - qWarning("device empty!"); + owarn << "device empty!" << oendl; return; diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index 7a15828..f7e33e9 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro @@ -1,5 +1,3 @@ TEMPLATE = app -TMAKE_CXXFLAGS += -DHAVE_OPENPTY CONFIG += qt warn_on -#CONFIG = qt DESTDIR = $(OPIEDIR)/bin @@ -72,3 +70,3 @@ TARGET = opie-console - +DEFINES += HAVE_OPENPTY diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index fbc5306..f505998 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp @@ -43,3 +43,3 @@ void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { - qWarning("recieved from sz on stdout %d bytes", buflen); + owarn << "recieved from sz on stdout " << buflen << " bytes" << oendl; @@ -67,3 +67,3 @@ void SzTransfer::receivedStdin(const QByteArray &data) { - qWarning("recieved from io_serial %d bytes", data.size()); + owarn << "recieved from io_serial " << data.size() << " bytes" << oendl; @@ -76,3 +76,3 @@ void SzTransfer::sent() { - qWarning("sent file"); + owarn << "sent file" << oendl; diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp index 6429e3c..41a91ed 100644 --- a/noncore/apps/opie-console/tabwidget.cpp +++ b/noncore/apps/opie-console/tabwidget.cpp @@ -1,5 +1,8 @@ - #include "tabwidget.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; using namespace Opie::Ui; + TabWidget::TabWidget( QWidget* parent, const char* name ) @@ -14,3 +17,3 @@ TabWidget::~TabWidget() { void TabWidget::add( Session* ses ) { - qWarning("session ses " + ses->name() ); + owarn << "session ses " + ses->name() << oendl; if ( !ses->widgetStack() ) return; diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp index 6870487..087476b 100644 --- a/noncore/apps/opie-console/terminalwidget.cpp +++ b/noncore/apps/opie-console/terminalwidget.cpp @@ -1 +1,8 @@ +#include "terminalwidget.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qlabel.h> @@ -8,4 +15,2 @@ -#include "terminalwidget.h" - namespace { @@ -71,3 +76,3 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, // Fill in some options - qWarning("Options for terminal box"); + owarn << "Options for terminal box" << oendl; m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index df27055..45fd11d 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp @@ -28,3 +28,3 @@ SenderUI::SenderUI() - qWarning("prof " + prof.readEntry("Device") + " " + str); + owarn << "prof " + prof.readEntry("Device") + " " + str << oendl; ser = new IOSerial(prof); @@ -34,5 +34,5 @@ SenderUI::SenderUI() if ( ser->open() ) - qWarning("opened!!!"); + owarn << "opened!!!" << oendl; else - qWarning("could not open"); + owarn << "could not open" << oendl; @@ -54,3 +54,3 @@ void SenderUI::slotSend() { QCString str = MultiLineEdit1->text().utf8(); - qWarning("sending: %s", str.data() ); + owarn << "sending: " << str.data() << "" << oendl; str = str.replace( QRegExp("\n"), "\r"); @@ -59,3 +59,3 @@ void SenderUI::slotSend() { void SenderUI::got(const QByteArray& ar) { - qWarning("got:"); + owarn << "got:" << oendl; for ( uint i = 0; i < ar.count(); i++ ) { @@ -68,3 +68,3 @@ void SenderUI::fileTransComplete() { - qWarning("file transfer complete"); + owarn << "file transfer complete" << oendl; } @@ -74,3 +74,3 @@ void SenderUI::send() { void SenderUI::slotRev(){ -qWarning("Going to receive!"); +owarn << "Going to receive!" << oendl; FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); diff --git a/noncore/apps/opie-console/widget.cpp b/noncore/apps/opie-console/widget.cpp index e17dfd4..c51983f 100644 --- a/noncore/apps/opie-console/widget.cpp +++ b/noncore/apps/opie-console/widget.cpp @@ -997,3 +997,3 @@ bool Widget::eventFilter( QObject *obj, QEvent *e ) static bool alt = FALSE; -// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); +// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; bool dele=FALSE; @@ -1036,3 +1036,3 @@ bool Widget::eventFilter( QObject *obj, QEvent *e ) -// qDebug("key pressed is 0x%x",ke->key()); +// odebug << "key pressed is 0x" << ke->key() << "" << oendl; @@ -1040,3 +1040,3 @@ bool Widget::eventFilter( QObject *obj, QEvent *e ) -// qDebug("key pressed 2 is 0x%x",ke->key()); +// odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl; emitText("\\"); // expose diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp index 96dda1c..ab25919 100644 --- a/noncore/apps/opie-console/widget_layer.cpp +++ b/noncore/apps/opie-console/widget_layer.cpp @@ -77,3 +77,3 @@ bool WidgetLayer::eventFilter( QObject *obj, QEvent *e ) static bool alt = false; -// qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); +// odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; bool dele = false; @@ -117,3 +117,3 @@ QChar(a,0)); -// qDebug("key pressed is 0x%x",ke->key()); +// odebug << "key pressed is 0x" << ke->key() << "" << oendl; diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp index 90e1a70..aa03060 100644 --- a/noncore/apps/opie-write/mainwindow.cpp +++ b/noncore/apps/opie-write/mainwindow.cpp @@ -22,2 +22,5 @@ #include "mainwindow.h" + +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/fileselector.h> @@ -26,4 +29,5 @@ #include <qpe/fontdatabase.h> +using namespace Opie::Core; -//#include "qspellchecker.h" +/* QT */ #include "qtextedit.h" @@ -446,3 +450,3 @@ void MainWindow::fileRevert() { - qDebug( "QMainWindow::fileRevert needs to be done" ); + odebug << "QMainWindow::fileRevert needs to be done" << oendl; } @@ -458,3 +462,3 @@ void MainWindow::insertTable() { - qDebug( "MainWindow::insertTable() needs to be done" ); + odebug << "MainWindow::insertTable() needs to be done" << oendl; } @@ -477,3 +481,3 @@ void MainWindow::openFile( const DocLnk &dl ) if ( !fm.loadFile( dl, txt ) ) - qDebug( "couldn't open file" ); + odebug << "couldn't open file" << oendl; clear(); diff --git a/noncore/apps/opie-write/opie-write.pro b/noncore/apps/opie-write/opie-write.pro index 044ce7e..8e514d4 100644 --- a/noncore/apps/opie-write/opie-write.pro +++ b/noncore/apps/opie-write/opie-write.pro @@ -1,4 +1,3 @@ -CONFIG += qt warn on quick-app - +CONFIG += qt warn on quick-app diff --git a/noncore/apps/opie-write/qcomplextext.cpp b/noncore/apps/opie-write/qcomplextext.cpp index 473f184..00a91c5 100644 --- a/noncore/apps/opie-write/qcomplextext.cpp +++ b/noncore/apps/opie-write/qcomplextext.cpp @@ -108,3 +108,3 @@ static inline const QChar *prevChar( const QString &str, int pos ) { - //qDebug("leftChar: pos=%d", pos); + //odebug << "leftChar: pos=" << pos << "" << oendl; pos--; @@ -126,3 +126,3 @@ static inline const QChar *nextChar( const QString &str, int pos) while( pos < len ) { - //qDebug("rightChar: %d isLetter=%d, joining=%d", pos, ch.isLetter(), ch.joining()); + //odebug << "rightChar: " << pos << " isLetter=" << ch.isLetter() << ", joining=" << ch.joining() << "" << oendl; if( !ch->isMark() ) diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp index b77a0fc..c27eb1e 100644 --- a/noncore/apps/opie-write/qrichtext.cpp +++ b/noncore/apps/opie-write/qrichtext.cpp @@ -39,2 +39,7 @@ +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include "qdragobject.h" @@ -44,2 +49,3 @@ +/* STD */ #include <stdlib.h> @@ -186,3 +192,3 @@ QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) if ( !s ) { - qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); + owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; return 0; @@ -214,3 +220,3 @@ QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) if ( !s ) { - qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); + owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; return 0; @@ -1546,6 +1552,6 @@ void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* curso if ( !m ) { - qWarning("QRichText: no mimesource for %s", bg.latin1() ); + owarn << "QRichText: no mimesource for " << bg.latin1() << "" << oendl; } else { if ( !QImageDrag::decode( m, img ) ) { - qWarning("QTextImage: cannot decode %s", bg.latin1() ); + owarn << "QTextImage: cannot decode " << bg.latin1() << "" << oendl; } @@ -2154,3 +2160,3 @@ QString QTextDocument::richText() const if ( !item_p || !item_ul || !item_ol || !item_li ) { - qWarning( "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" ); + owarn << "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" << oendl; return QString::null; @@ -4098,3 +4104,3 @@ int QTextParagraph::lineHeightOfChar( int i, int *bl, int *y ) const - qWarning( "QTextParagraph::lineHeightOfChar: couldn't find lh for %d", i ); + owarn << "QTextParagraph::lineHeightOfChar: couldn't find lh for " << i << "" << oendl; return 15; @@ -4124,3 +4130,3 @@ QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) - qWarning( "QTextParagraph::lineStartOfChar: couldn't find %d", i ); + owarn << "QTextParagraph::lineStartOfChar: couldn't find " << i << "" << oendl; return 0; @@ -4151,3 +4157,3 @@ QTextStringChar *QTextParagraph::lineStartOfLine( int line, int *index ) const - qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line ); + owarn << "QTextParagraph::lineStartOfLine: couldn't find " << line << "" << oendl; return 0; @@ -5699,3 +5705,3 @@ QTextFormat *QTextFormatCollection::format( const QFont &f, const QColor &c ) if ( cachedFormat->key() != key ) - qWarning("ASSERT: keys for format not identical: '%s '%s'", cachedFormat->key().latin1(), key.latin1() ); + owarn << "ASSERT: keys for format not identical: '" << cachedFormat->key().latin1() << " '" << key.latin1() << "'" << oendl; return cachedFormat; @@ -6085,3 +6091,3 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co if ( !m ) { - qWarning("QTextImage: no mimesource for %s", imageName.latin1() ); + owarn << "QTextImage: no mimesource for " << imageName.latin1() << "" << oendl; } @@ -6089,3 +6095,3 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co if ( !QImageDrag::decode( m, img ) ) { - qWarning("QTextImage: cannot decode %s", imageName.latin1() ); + owarn << "QTextImage: cannot decode " << imageName.latin1() << "" << oendl; } diff --git a/noncore/apps/opie-write/qrichtext_p.cpp b/noncore/apps/opie-write/qrichtext_p.cpp index 6783e0b..2e8b09c 100644 --- a/noncore/apps/opie-write/qrichtext_p.cpp +++ b/noncore/apps/opie-write/qrichtext_p.cpp @@ -37,2 +37,5 @@ +#include <opie2/odebug.h> +using namespace Opie::Core; + #include "qrichtext_p.h" @@ -139,3 +142,3 @@ void QTextCursor::gotoPosition( QTextParagraph* p, int index ) #if defined(QT_CHECK_RANGE) - qWarning( "QTextCursor::gotoParagraph Index: %d out of range", index ); + owarn << "QTextCursor::gotoParagraph Index: " << index << " out of range" << oendl; #endif @@ -479,3 +482,3 @@ int QTextParagraph::lineY( int l ) const if ( l > (int)lineStarts.count() - 1 ) { - qWarning( "QTextParagraph::lineY: line %d out of range!", l ); + owarn << "QTextParagraph::lineY: line " << l << " out of range!" << oendl; return 0; @@ -495,3 +498,3 @@ int QTextParagraph::lineBaseLine( int l ) const if ( l > (int)lineStarts.count() - 1 ) { - qWarning( "QTextParagraph::lineBaseLine: line %d out of range!", l ); + owarn << "QTextParagraph::lineBaseLine: line " << l << " out of range!" << oendl; return 10; @@ -511,3 +514,3 @@ int QTextParagraph::lineHeight( int l ) const if ( l > (int)lineStarts.count() - 1 ) { - qWarning( "QTextParagraph::lineHeight: line %d out of range!", l ); + owarn << "QTextParagraph::lineHeight: line " << l << " out of range!" << oendl; return 15; @@ -527,4 +530,4 @@ void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const if ( l > (int)lineStarts.count() - 1 ) { - qWarning( "QTextParagraph::lineInfo: line %d out of range!", l ); - qDebug( "%d %d", (int)lineStarts.count() - 1, l ); + owarn << "QTextParagraph::lineInfo: line " << l << " out of range!" << oendl; + odebug << "" << (int)lineStarts.count() - 1 << " " << l << "" << oendl; y = 0; diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp index 0fe5b09..046d997 100755 --- a/noncore/apps/qashmoney/accountdisplay.cpp +++ b/noncore/apps/qashmoney/accountdisplay.cpp @@ -1,4 +1 @@ -#include <qmessagebox.h> -#include <qheader.h> - #include "accountdisplay.h" @@ -9,2 +6,10 @@ +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ +#include <qmessagebox.h> +#include <qheader.h> + extern Account *account; @@ -269,3 +274,3 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item ) cleared = 1; - qDebug("Year from transferdialog = %i",td->getYear()); + odebug << "Year from transferdialog = " << td->getYear() << "" << oendl; // add the transfer with a new date if its been edited or use the default date diff --git a/noncore/apps/qashmoney/config.in b/noncore/apps/qashmoney/config.in index 91739fe..aeed298 100644 --- a/noncore/apps/qashmoney/config.in +++ b/noncore/apps/qashmoney/config.in @@ -3,2 +3,2 @@ default "n" - depends ( LIBQPE || LIBQPE-X11 ) + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE diff --git a/noncore/apps/qashmoney/qashmoney.pro b/noncore/apps/qashmoney/qashmoney.pro index 6ad3db3..8a4302f 100755 --- a/noncore/apps/qashmoney/qashmoney.pro +++ b/noncore/apps/qashmoney/qashmoney.pro @@ -45,3 +45,3 @@ DESTDIR = $(OPIEDIR)/bin unix:LIBS += -lm -LIBS += -lqpe -lqte -lsqlite +LIBS += -lqpe -lopiecore2 -lsqlite diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp index dbf9370..6e544ba 100644 --- a/noncore/apps/tableviewer/db/common.cpp +++ b/noncore/apps/tableviewer/db/common.cpp @@ -19,3 +19,11 @@ **********************************************************************/ -#include <stdlib.h> +#include "common.h" +#include "datacache.h" + +/* OPIE */ +#include <opie2/odebug.h> +#include <qpe/timestring.h> +using namespace Opie::Core; + +/* QT */ #include <qstring.h> @@ -24,6 +32,6 @@ #include <qdatetime.h> -#include <qpe/timestring.h> -#include "common.h" -#include "datacache.h" + +/* STD */ #include <assert.h> +#include <stdlib.h> @@ -314,3 +322,3 @@ void TVVariant::load(QDataStream &s ) default: - qFatal("Unrecognized data type"); + ofatal << "Unrecognized data type" << oendl; } @@ -1080,3 +1088,3 @@ QDataStream &operator>>( QDataStream &s, DataElem &d) if (size != d.getNumFields()) { - qWarning("DataSize mis-match"); + owarn << "DataSize mis-match" << oendl; return s; /* sanity check failed.. don't load */ @@ -1379,3 +1387,3 @@ bool DataElem::contains(int i, TVVariant v) const default: - qWarning("Tried to compare unknown data type"); + owarn << "Tried to compare unknown data type" << oendl; } @@ -1405,3 +1413,3 @@ bool DataElem::startsWith(int i, TVVariant v) const default: - qWarning("Tried to compare unknown data type"); + owarn << "Tried to compare unknown data type" << oendl; } @@ -1431,3 +1439,3 @@ bool DataElem::endsWith(int i, TVVariant v) const default: - qWarning("Tried to compare unknown data type"); + owarn << "Tried to compare unknown data type" << oendl; } @@ -1463,3 +1471,3 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column) /* can't do compare */ - qWarning("Tried to compare two incompatable types"); + owarn << "Tried to compare two incompatable types" << oendl; return FALSE; diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp index 7c14eef..6380e1b 100644 --- a/noncore/apps/tableviewer/db/datacache.cpp +++ b/noncore/apps/tableviewer/db/datacache.cpp @@ -28,5 +28,13 @@ #include "csvsource.h" -#include <stdlib.h> + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qheader.h> +/* STD */ +#include <stdlib.h> + #define INIT_TABLE_SIZE 128 @@ -152,3 +160,3 @@ void DBStore::addItemInternal(DataElem *delem) if (full) { - qWarning("Attempted to add items to already full table"); + owarn << "Attempted to add items to already full table" << oendl; return; diff --git a/noncore/apps/tableviewer/db/xmlsource.cpp b/noncore/apps/tableviewer/db/xmlsource.cpp index 94fec36..4ca6aee 100644 --- a/noncore/apps/tableviewer/db/xmlsource.cpp +++ b/noncore/apps/tableviewer/db/xmlsource.cpp @@ -20,8 +20,14 @@ #include "xmlsource.h" -#include <qdict.h> -#include <stdlib.h> -#include <qtextstream.h> #include "../xmlencodeattr.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; +/* QT */ +#include <qdict.h> +#include <qtextstream.h> + +/* STD */ +#include <stdlib.h> @@ -142,3 +148,3 @@ QString DBXmlHandler::errorProtocol() { - qWarning("Error reading file"); + owarn << "Error reading file" << oendl; return errorProt; @@ -174,3 +180,3 @@ bool DBXmlHandler::startElement(const QString&, const QString&, if (key.isEmpty()) { - qWarning("empty key name"); + owarn << "empty key name" << oendl; return FALSE; @@ -192,3 +198,3 @@ bool DBXmlHandler::startElement(const QString&, const QString&, /* invalid key, we failed */ - qWarning("Invalid key in record"); + owarn << "Invalid key in record" << oendl; return FALSE; @@ -198,3 +204,3 @@ bool DBXmlHandler::startElement(const QString&, const QString&, } - qWarning("Unable to determine tag type"); + owarn << "Unable to determine tag type" << oendl; return FALSE; @@ -227,3 +233,3 @@ bool DBXmlHandler::endElement(const QString&, const QString&, // should only get a 'endElement' from one of the above states. - qWarning("Invalid end tag"); + owarn << "Invalid end tag" << oendl; return FALSE; @@ -256,3 +262,3 @@ bool DBXmlHandler::characters(const QString& ch) - qWarning("Junk characters found... ignored"); + owarn << "Junk characters found... ignored" << oendl; return TRUE; @@ -272,3 +278,3 @@ bool DBXmlHandler::warning(const QXmlParseException& exception) - qWarning(errorProt); + owarn << errorProt << oendl; return QXmlDefaultHandler::fatalError(exception); @@ -283,3 +289,3 @@ bool DBXmlHandler::error(const QXmlParseException& exception) - qWarning(errorProt); + owarn << errorProt << oendl; return QXmlDefaultHandler::fatalError(exception); @@ -294,3 +300,3 @@ bool DBXmlHandler::fatalError(const QXmlParseException& exception) - qWarning(errorProt); + owarn << errorProt << oendl; return QXmlDefaultHandler::fatalError(exception); diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp index 102b94c..9538cb3 100644 --- a/noncore/apps/tableviewer/tableviewer.cpp +++ b/noncore/apps/tableviewer/tableviewer.cpp @@ -20,3 +20,2 @@ -/* local includes */ #include "tableviewer.h" @@ -29,9 +28,11 @@ -/* QPE includes */ +/* OPIE */ +#include <opie2/odebug.h> #include <qpe/fileselector.h> #include <qpe/resource.h> -#include <qtoolbar.h> +using namespace Opie::Core; -/* QTE includes */ +/* QT */ #include <qmenubar.h> +#include <qtoolbar.h> #include <qpopupmenu.h> @@ -41,2 +42,3 @@ #include <qbuffer.h> + /*! @@ -203,3 +205,3 @@ void TableViewerWindow::saveDocument() if(!ds->saveSource(dev, doc.type())){ - qWarning("Save unsuccessful"); + owarn << "Save unsuccessful" << oendl; return; @@ -290,3 +292,3 @@ void TableViewerWindow::openDocument(const DocLnk &f) } else { - qWarning(tr("could not load Document")); + owarn << tr("could not load Document") << oendl; } diff --git a/noncore/apps/tableviewer/tableviewer.pro b/noncore/apps/tableviewer/tableviewer.pro index 1de23bb..564f50f 100644 --- a/noncore/apps/tableviewer/tableviewer.pro +++ b/noncore/apps/tableviewer/tableviewer.pro @@ -1,2 +1,2 @@ -CONFIG = qt warn_on quick-app +CONFIG = qt warn_on quick-app SUBDIRS = db ui @@ -33,5 +33,5 @@ INTERFACES = ui/tvkeyedit_gen.ui TARGET = tableviewer -INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopiecore2 +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -lopiecore2 diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp index b10ff1d..c3e6432 100644 --- a/noncore/apps/tableviewer/ui/tvlistview.cpp +++ b/noncore/apps/tableviewer/ui/tvlistview.cpp @@ -19,4 +19,11 @@ **********************************************************************/ + #include "tvlistview.h" #include "../db/common.h" + +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qtoolbutton.h> @@ -165,3 +172,3 @@ void TVListView::last() { - qWarning("TVListView::last not yet implemented"); + owarn << "TVListView::last not yet implemented" << oendl; } diff --git a/noncore/apps/tinykate/libkate/libkate.pro b/noncore/apps/tinykate/libkate/libkate.pro index 11ee275..1552dff 100644 --- a/noncore/apps/tinykate/libkate/libkate.pro +++ b/noncore/apps/tinykate/libkate/libkate.pro @@ -1,76 +1,73 @@ TEMPLATE = lib -CONFIG = qt warn_on -HEADERS = microkde/kapplication.h \ - kateconfig.h \ - microkde/kdebug.h \ - microkde/kdialog.h \ - microkde/kdialogbase.h \ - microkde/kfiledialog.h \ - microkde/kglobal.h \ - microkde/kiconloader.h \ - microkde/klineedit.h \ - microkde/klocale.h \ - microkde/kmessagebox.h \ - microkde/kprinter.h \ - microkde/krestrictedline.h \ - microkde/kseparator.h \ - microkde/kstandarddirs.h \ - microkde/ktempfile.h \ - microkde/kunload.h \ - microkde/kurlrequester.h \ - microkde/kfontdialog.h \ - microkde/krun.h \ - microkde/knumvalidator.h \ - microkde/kstaticdeleter.h \ - microkde/klistview.h \ - microkde/kglobalsettings.h \ - microkde/kcolorbtn.h \ - \ +CONFIG = qt warn_on +HEADERS = microkde/kapplication.h \ + kateconfig.h \ + microkde/kdebug.h \ + microkde/kdialog.h \ + microkde/kdialogbase.h \ + microkde/kfiledialog.h \ + microkde/kglobal.h \ + microkde/kiconloader.h \ + microkde/klineedit.h \ + microkde/klocale.h \ + microkde/kmessagebox.h \ + microkde/kprinter.h \ + microkde/krestrictedline.h \ + microkde/kseparator.h \ + microkde/kstandarddirs.h \ + microkde/ktempfile.h \ + microkde/kunload.h \ + microkde/kurlrequester.h \ + microkde/kfontdialog.h \ + microkde/krun.h \ + microkde/knumvalidator.h \ + microkde/kstaticdeleter.h \ + microkde/klistview.h \ + microkde/kglobalsettings.h \ + microkde/kcolorbtn.h \ \ - qt3back/qregexp3.h \ - microkde/ksharedptr.h \ - document/katebuffer.h document/katedialogs.h \ - document/katetextline.h \ - document/katecmd.h \ - document/katehighlight.h \ - document/katecmds.h document/katedocument.h \ - document/katesyntaxdocument.h \ - view/kateundohistory.h \ - view/kateview.h \ - view/kateviewdialog.h \ - interfaces/view.h \ - interfaces/document.h \ - ktexteditor/ktexteditor.h + qt3back/qregexp3.h \ + microkde/ksharedptr.h \ + document/katebuffer.h document/katedialogs.h \ + document/katetextline.h \ + document/katecmd.h \ + document/katehighlight.h \ + document/katecmds.h document/katedocument.h \ + document/katesyntaxdocument.h \ + view/kateundohistory.h \ + view/kateview.h \ + view/kateviewdialog.h \ + interfaces/view.h \ + interfaces/document.h \ + ktexteditor/ktexteditor.h -SOURCES = microkde/kapplication.cpp \ - microkde/kdialogbase.cpp \ - kateconfig.cpp \ - microkde/klocale.cpp \ - microkde/kmessagebox.cpp \ - microkde/kprocess.cpp \ - microkde/kstandarddirs.cpp \ - microkde/ktempfile.cpp \ - microkde/kurlrequester.cpp \ - microkde/kfontdialog.cpp \ - microkde/krun.cpp \ - microkde/knumvalidator.cpp \ - microkde/kglobal.cpp \ - microkde/kglobalsettings.cpp \ - microkde/kcolorbtn.cpp \ - \ - \ - qt3back/qregexp3.cpp \ - ktexteditor/ktexteditor.cpp \ - document/katebuffer.cpp document/katedialogs.cpp \ - document/katehighlight.cpp \ - document/katecmd.cpp \ - document/katesyntaxdocument.cpp document/katecmds.cpp \ - document/katedocument.cpp document/katetextline.cpp \ - view/kateundohistory.cpp \ - view/kateview.cpp \ - view/kateviewdialog.cpp \ - interfaces/interfaces.cpp - -INTERFACES = -INCLUDEPATH += $(OPIEDIR)/include \ +SOURCES = microkde/kapplication.cpp \ + microkde/kdialogbase.cpp \ + kateconfig.cpp \ + microkde/klocale.cpp \ + microkde/kmessagebox.cpp \ + microkde/kprocess.cpp \ + microkde/kstandarddirs.cpp \ + microkde/ktempfile.cpp \ + microkde/kurlrequester.cpp \ + microkde/kfontdialog.cpp \ + microkde/krun.cpp \ + microkde/knumvalidator.cpp \ + microkde/kglobal.cpp \ + microkde/kglobalsettings.cpp \ + microkde/kcolorbtn.cpp \ + \ + qt3back/qregexp3.cpp \ + ktexteditor/ktexteditor.cpp \ + document/katebuffer.cpp document/katedialogs.cpp \ + document/katehighlight.cpp \ + document/katecmd.cpp \ + document/katesyntaxdocument.cpp document/katecmds.cpp \ + document/katedocument.cpp document/katetextline.cpp \ + view/kateundohistory.cpp \ + view/kateview.cpp \ + view/kateviewdialog.cpp \ + interfaces/interfaces.cpp +INTERFACES = +INCLUDEPATH += $(OPIEDIR)/include \ $(OPIEDIR)/noncore/apps/tinykate/libkate \ @@ -82,5 +79,5 @@ INCLUDEPATH += $(OPIEDIR)/include \ $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back -DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lqtaux2 -lopiecore2 -lopieui2 -TARGET = tinykate +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -lqtaux2 -lopiecore2 -lopieui2 +TARGET = tinykate diff --git a/noncore/apps/tinykate/tinykate.pro b/noncore/apps/tinykate/tinykate.pro index 6f4baa8..d34e519 100644 --- a/noncore/apps/tinykate/tinykate.pro +++ b/noncore/apps/tinykate/tinykate.pro @@ -1,3 +1,3 @@ -TEMPLATE = app -CONFIG = qt warn_on quick-app +TEMPLATE = app +CONFIG = qt warn_on quick-app DESTDIR = $(OPIEDIR)/bin @@ -5,15 +5,13 @@ HEADERS = tinykate.h SOURCES = tinykate.cpp main.cpp -INTERFACES = INCLUDEPATH += $(OPIEDIR)/include \ - $(OPIEDIR)/noncore/apps/tinykate/libkate \ - $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ - $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ - $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ - $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ - $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ - $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back - -DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -ltinykate -lopiecore2 -lopieui2 -TARGET = kate + $(OPIEDIR)/noncore/apps/tinykate/libkate \ + $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ + $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ + $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ + $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ + $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ + $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -ltinykate -lopiecore2 -lopieui2 +TARGET = kate diff --git a/noncore/apps/zsafe/config.in b/noncore/apps/zsafe/config.in index 6e321f3..b6d3ffe 100644 --- a/noncore/apps/zsafe/config.in +++ b/noncore/apps/zsafe/config.in @@ -3,3 +3,3 @@ config ZSAFE default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI diff --git a/noncore/apps/zsafe/scqtfiledlg.cpp b/noncore/apps/zsafe/scqtfiledlg.cpp index 52b8d0d..c67bbd5 100644 --- a/noncore/apps/zsafe/scqtfiledlg.cpp +++ b/noncore/apps/zsafe/scqtfiledlg.cpp @@ -1,11 +1,8 @@ -/**************************************************************************** -** Form implementation generated from reading ui file 'scqtfiledlg.ui' -** -** Created: Sun Jun 8 15:51:12 2003 -** by: The User Interface Compiler (uic) -** -** WARNING! All changes made in this file will be lost! -****************************************************************************/ #include "scqtfiledlg.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include <qcombobox.h> @@ -218,3 +215,3 @@ void ScQtFileDlg::slotCancel() { - qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotCancel(): Not implemented yet!" << oendl; } @@ -223,3 +220,3 @@ void ScQtFileDlg::slotDirComboBoxChanged( int ) { - qWarning( "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" << oendl; } @@ -228,3 +225,3 @@ void ScQtFileDlg::slotDoubleClicked(QListViewItem *) { - qWarning( "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" << oendl; } @@ -233,3 +230,3 @@ void ScQtFileDlg::slotFileTextChanged( const QString & ) { - qWarning( "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" << oendl; } @@ -238,3 +235,3 @@ void ScQtFileDlg::slotMkDir() { - qWarning( "ScQtFileDlg::slotMkDir(): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotMkDir(): Not implemented yet!" << oendl; } @@ -243,3 +240,3 @@ void ScQtFileDlg::slotOK() { - qWarning( "ScQtFileDlg::slotOK(): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotOK(): Not implemented yet!" << oendl; } @@ -248,3 +245,3 @@ void ScQtFileDlg::slotSelectionChanged(QListViewItem *) { - qWarning( "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" << oendl; } @@ -253,3 +250,3 @@ void ScQtFileDlg::slotTypeComboBoxChanged( int ) { - qWarning( "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" ); + owarn << "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" << oendl; } diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 3df55eb..bf8f7f4 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp @@ -31,3 +31,4 @@ #include <opie2/ofiledialog.h> - +#include <opie2/odebug.h> +using namespace Opie::Core; using namespace Opie::Ui; @@ -40,4 +41,2 @@ using namespace Opie::Ui; -#include <stdio.h> - #include <sys/types.h> @@ -2071,3 +2070,2 @@ int ZSafe::loadInit(const char* _filename, const char *password) #else - printf ("LoadInit() read1"); size = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd); @@ -2091,3 +2089,2 @@ int ZSafe::loadInit(const char* _filename, const char *password) #else - printf ("LoadInit() read2"); while ((count = fread ((unsigned char *) (charbuf), sizeof(unsigned char), 8, fd)) > 0) { @@ -2261,3 +2258,3 @@ bool ZSafe::saveDocument(const char* _filename, if (retval == PWERR_DATA) { - qWarning("1: Error writing file, contents not saved"); + owarn << "1: Error writing file, contents not saved" << oendl; saveFinalize(); @@ -2305,3 +2302,3 @@ bool ZSafe::saveDocument(const char* _filename, if (retval == PWERR_DATA) { - qWarning("1: Error writing file, contents not saved"); + owarn << "1: Error writing file, contents not saved" << oendl; saveFinalize(); @@ -2314,3 +2311,3 @@ bool ZSafe::saveDocument(const char* _filename, if (saveFinalize() == PWERR_DATA) { - qWarning("2: Error writing file, contents not saved"); + owarn << "2: Error writing file, contents not saved" << oendl; return false; @@ -3192,3 +3189,3 @@ void ZSafe::editCategory() { - qWarning("Category found"); + owarn << "Category found" << oendl; diff --git a/noncore/apps/zsafe/zsafe.pro b/noncore/apps/zsafe/zsafe.pro index 72c8fe9..3cae706 100644 --- a/noncore/apps/zsafe/zsafe.pro +++ b/noncore/apps/zsafe/zsafe.pro @@ -1,3 +1,3 @@ -TEMPLATE = app -CONFIG = qt warn_on +TEMPLATE = app +CONFIG = qt warn_on DESTDIR = $(OPIEDIR)/bin @@ -9,7 +9,7 @@ SOURCES = main.cpp zsafe.cpp krc2.cpp category.cpp \ scqtfiledlg.cpp -INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui -INCLUDEPATH += $(OPIEDIR)/include -DEPENDPATH += $(OPIEDIR)/include -LIBS += -Wl,-rpath,$(OPIEDIR)/lib -L$(OPIEDIR)/lib -lqpe -lopiecore2 -lopieui2 -TARGET = zsafe +INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui +INCLUDEPATH += $(OPIEDIR)/include +DEPENDPATH += $(OPIEDIR)/include +LIBS += -lqpe -lopiecore2 -lopieui2 +TARGET = zsafe |