summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
authormickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
committer mickeyl <mickeyl>2004-04-04 13:54:40 (UTC)
commit16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff)
tree0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/advancedfm
parent8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff)
downloadopie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz
opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/apps/advancedfm') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp44
-rw-r--r--noncore/apps/advancedfm/advancedfm.pro20
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp12
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp55
-rw-r--r--noncore/apps/advancedfm/filePermissions.cpp2
-rw-r--r--noncore/apps/advancedfm/output.cpp23
6 files changed, 73 insertions, 83 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
@@ -71,7 +71,7 @@ void AdvancedFm::cleanUp() {
}
void AdvancedFm::tabChanged(QWidget *) {
-// qWarning("tab changed");
+// owarn << "tab changed" << oendl;
QString path = CurrentDir()->canonicalPath();
currentPathCombo->lineEdit()->setText( path );
@@ -93,13 +93,13 @@ void AdvancedFm::tabChanged(QWidget *) {
void AdvancedFm::populateView() {
-// qWarning("PopulateView");
+// owarn << "PopulateView" << oendl;
QPixmap pm;
QListView *thisView = CurrentView();
QDir *thisDir = CurrentDir();
QString path = thisDir->canonicalPath();
-//qWarning("path is "+path);
+//owarn << "path is "+path << oendl;
thisView->clear();
thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
thisDir->setMatchAllDirs(TRUE);
@@ -160,7 +160,7 @@ 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" );
// pm= Resource::loadPixmap( "folder" );
// QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
@@ -184,7 +184,7 @@ void AdvancedFm::populateView() {
if((dir = opendir( path.latin1())) != NULL)
while ((mydirent = readdir(dir)) != NULL) {
lstat( mydirent->d_name, &buf);
-// qDebug(mydirent->d_name);
+// odebug << mydirent->d_name << oendl;
fileL.sprintf("%s", mydirent->d_name);
devT = buf.st_dev;
fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF);
@@ -209,7 +209,7 @@ void AdvancedFm::rePopulate() {
populateView();
// int tmpTab = whichTab;
-// // qDebug("%d", tmpTab);
+// // odebug << "" << tmpTab << "" << oendl;
// for(int i =1; i < 3; i++) {
// TabWidget->setCurrentWidget(i - 1);
@@ -219,10 +219,10 @@ 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);
strSize=strSize.stripWhiteSpace();
bool isDirectory = false;
@@ -267,13 +267,13 @@ 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);
Local_View->setFocus();
}
void AdvancedFm::switchToRemoteTab() {
-//qWarning("switch to local view");
+//owarn << "switch to local view" << oendl;
TabWidget->setCurrentWidget(1);
Remote_View->setFocus();
}
@@ -329,7 +329,7 @@ QStringList AdvancedFm::getPath() {
for ( ; it.current(); ++it ) {
if ( it.current()->isSelected() ) {
strList << it.current()->text(0);
-// qDebug(it.current()->text(0));
+// odebug << it.current()->text(0) << oendl;
}
}
return strList;
@@ -380,7 +380,7 @@ void AdvancedFm::doAbout() {
}
void AdvancedFm::keyPressEvent( QKeyEvent *e) {
-// qWarning("key %d", e->key());
+// owarn << "key " << e->key() << "" << oendl;
// if( CurrentView()->hasFocus() )
{
switch ( e->key() ) {
@@ -638,7 +638,7 @@ void AdvancedFm::addToDocs() {
QString curFile;
for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) {
curFile = thisDir->canonicalPath()+"/"+(*it);
-// qDebug(curFile);
+// odebug << curFile << oendl;
QFileInfo fi(curFile);
DocLnk f;
// curFile.replace(QRegExp("\\..*"),"");
@@ -711,7 +711,7 @@ void AdvancedFm::addCustomDir() {
}
void AdvancedFm::removeCustomDir() {
-// qDebug("remove custom dir");
+// odebug << "remove custom dir" << oendl;
Config cfg("AdvancedFm");
cfg.setGroup("Menu");
QString dir;
@@ -746,7 +746,7 @@ 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;
// QDir *thisDir = CurrentDir();
// if( curDir.isEmpty()) {
@@ -787,10 +787,10 @@ QDir *AdvancedFm::OtherDir() {
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;
}
}
@@ -803,7 +803,7 @@ QListView * AdvancedFm::OtherView() {
}
void AdvancedFm::setOtherTabCurrent() {
-// qWarning("setOtherTabCurrent() %d", whichTab);
+// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl;
if ( whichTab == 1) {
TabWidget->setCurrentWidget(1);
} else {
@@ -814,10 +814,10 @@ 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;
stream >> file;
gotoDirectory( (const QString &) file);
@@ -830,7 +830,7 @@ void AdvancedFm::setDocument(const QString &file) {
}
void AdvancedFm::gotoDirectory(const QString &file) {
-// qWarning("goto dir "+file);
+// owarn << "goto dir "+file << oendl;
QString curDir = file;
QDir *thisDir = CurrentDir();
if(QDir( curDir).exists() ) {
@@ -866,7 +866,7 @@ 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,6 +1,5 @@
TEMPLATE = app
CONFIG += qt warn_on quick-app
-# CONFIG += qt warn_on
HEADERS = advancedfm.h filePermissions.h output.h
SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp
TARGET = advancedfm
@@ -8,25 +7,6 @@ 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
-
-
!contains(CONFIG,quick-app) {
DESTDIR = $(OPIEDIR)/bin
DEFINES += NOQUICKLAUNCH
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
@@ -11,11 +11,16 @@
***************************************************************************/
#include "advancedfm.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/storage.h>
#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
#include <qpe/menubutton.h>
+using namespace Opie::Core;
+using namespace Opie::Ui;
+/* QT */
#include <qlayout.h>
#include <qhbox.h>
#include <qmenubar.h>
@@ -24,10 +29,9 @@
#include <qlineedit.h>
#include <qlistview.h>
+/* STD */
#include <sys/utsname.h>
-
-using namespace Opie::Ui;
void AdvancedFm::init() {
b = false;
setCaption( tr( "AdvancedFm" ) );
@@ -219,11 +223,11 @@ void AdvancedFm::init() {
if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) {
- qDebug("not have sd");
+ odebug << "not have sd" << oendl;
sdButton->hide();
}
if( !StorageInfo::hasCf() ) {
- qDebug("not have cf");
+ odebug << "not have cf" << oendl;
cfButton->hide();
}
currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
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
@@ -9,20 +9,26 @@
* 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;
-#include <qmessagebox.h>
-
+/* QT*/
+#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qlistview.h>
+/* STD */
+
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
@@ -31,9 +37,6 @@
#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 == "../") {
@@ -41,7 +44,7 @@ void AdvancedFm::doDirChange() {
} else {
if( pathItem.find(" -> ",0,TRUE) != -1)
pathItem = dealWithSymName((const QString&)pathItem)+"/";
-// qWarning(pathItem);
+// owarn << pathItem << oendl;
gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) );
}
}
@@ -92,7 +95,7 @@ void AdvancedFm::runThis() {
fs = getFileSystemType((const QString &) path);
QFileInfo fileInfo( path + "/" + curFile);
-// qDebug( fileInfo.owner());
+// odebug << fileInfo.owner() << oendl;
if( (fileInfo.permission( QFileInfo::ExeUser)
| fileInfo.permission( QFileInfo::ExeGroup)
@@ -104,7 +107,7 @@ void AdvancedFm::runThis() {
curFile = path + "/" + curFile;
DocLnk nf(curFile);
QString execStr = nf.exec();
-// qDebug( execStr);
+// odebug << execStr << oendl;
if( execStr.isEmpty() ) {
} else {
nf.execute();
@@ -202,12 +205,12 @@ void AdvancedFm::doDelete() {
QFile file(f);
QFileInfo fi(myFile);
if( fi.fileName().find("../",0,TRUE)==-1) {
-// qDebug("remove link files "+myFile);
+// odebug << "remove link files "+myFile << oendl;
// DocLnk lnk(f);
DocLnk *lnk;
lnk = new DocLnk(f);
-// qDebug("Deleting doclnk " + lnk->linkFile());
+// odebug << "Deleting doclnk " + lnk->linkFile() << oendl;
if(lnk->isValid())
lnk->removeLinkFile();
// delete lnk;
@@ -243,10 +246,10 @@ void AdvancedFm::doProperties() {
QString filePath;
filePath = CurrentDir()->canonicalPath()+"/";
-// qDebug("%d",curFileList.count());
+// odebug << "" << curFileList.count() << "" << oendl;
for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
-// qDebug((filePath+*it));
+// odebug << (filePath+*it) << oendl;
DocLnk lnk( (filePath+*it));
LnkProperties prop( &lnk );
QPEApplication::execDialog( &prop );
@@ -302,8 +305,8 @@ void AdvancedFm::copy() {
curFile = thisDir->canonicalPath()+"/"+ item;
destFile = thatDir->canonicalPath()+"/"+ item;
-// qDebug("Destination file is "+destFile);
-// qDebug("CurrentFile file is " + curFile);
+// odebug << "Destination file is "+destFile << oendl;
+// odebug << "CurrentFile file is " + curFile << oendl;
QFile f(destFile);
if( f.exists()) {
@@ -420,7 +423,7 @@ void AdvancedFm::copySameDir() {
return;
}
-// qDebug("copy "+curFile+" as "+destFile);
+// odebug << "copy "+curFile+" as "+destFile << oendl;
}
delete fileDlg;
}
@@ -443,13 +446,13 @@ void AdvancedFm::move() {
if(destFile.right(1).find("/",0,TRUE) == -1)
destFile+="/";
destFile += item;
-// qDebug("Destination file is "+destFile);
+// odebug << "Destination file is "+destFile << oendl;
curFile = thisDir->canonicalPath();
if(curFile.right(1).find("/",0,TRUE) == -1)
curFile +="/";
curFile+= item;
-// qDebug("CurrentFile file is " + curFile);
+// odebug << "CurrentFile file is " + curFile << oendl;
if(QFileInfo(curFile).isDir()) {
moveDirectory( curFile, destFile );
@@ -489,7 +492,7 @@ bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
QString cmd = "/bin/cp -fpR " + src + " " + dest;
- qWarning(cmd);
+ owarn << cmd << oendl;
int err = system( (const char *) cmd );
if ( err != 0 ) {
QMessageBox::message("AdvancedFm",
@@ -525,14 +528,14 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
struct stat stat_buf;
off_t offset = 0;
if(!srcFile.open( IO_ReadOnly|IO_Raw)) {
-// qWarning("open failed");
+// 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 ) ) {
-// qWarning("destfile open failed");
+// owarn << "destfile open failed" << oendl;
return success = false;
}
write_fd = destFile.handle();
@@ -547,7 +550,7 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
case EIO: msg = "Unspecified error while reading from in_fd.";
};
success = false;
-// qWarning(msg);
+// owarn << msg << oendl;
}
} else {
success = false;
@@ -579,7 +582,7 @@ void AdvancedFm::runCommand() {
//QString command;
if( fileDlg->result() == 1 ) {
-// qDebug(fileDlg->LineEdit1->text());
+// odebug << fileDlg->LineEdit1->text() << oendl;
QStringList command;
command << "/bin/sh";
@@ -662,7 +665,7 @@ void AdvancedFm::mkSym() {
}
cmd = "ln -s "+curFile+" "+destName;
-// qDebug(cmd);
+// odebug << cmd << oendl;
startProcess( (const QString)cmd );
}
rePopulate();
@@ -715,7 +718,7 @@ void AdvancedFm::startProcess(const QString & cmd) {
command << cmd.latin1();
*process << command;
if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
- qDebug("could not start process");
+ odebug << "could not start process" << oendl;
}
void AdvancedFm::processEnded(OProcess *) {
@@ -723,7 +726,7 @@ void AdvancedFm::processEnded(OProcess *) {
}
void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) {
-// qWarning("received stderrt %d bytes", buflen);
+// owarn << "received stderrt " << buflen << " bytes" << oendl;
QString lineStr = buffer;
QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
@@ -765,7 +768,7 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
void AdvancedFm::cancelRename() {
-// qDebug("cancel rename");
+// odebug << "cancel rename" << oendl;
QListView * view;
view = CurrentView();
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
@@ -32,7 +32,7 @@ filePermissions::filePermissions( QWidget* parent, const char* name, bool modal
{
if ( !name )
setName( tr("filePermissions") );
-// qDebug("FilePermissions "+fileName);
+// odebug << "FilePermissions "+fileName << oendl;
/* resize( 236, 210 );
setMaximumSize( QSize( 236, 210 ) );
*/ setCaption( tr( "Set File Permissions" ) );
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
@@ -5,19 +5,22 @@
****************************************************************************/
#include "output.h"
+/* OPIE */
+#include <opie2/odebug.h>
#include <qpe/qpeapplication.h>
#include <qpe/applnk.h>
+using namespace Opie::Core;
+/* QT */
#include <qfile.h>
#include <qmultilineedit.h>
#include <qpushbutton.h>
#include <qlayout.h>
+/* STD */
#include <errno.h>
/* XPM */
-using namespace Opie::Core;
-using namespace Opie::Core;
static char * filesave_xpm[] = {
"16 16 78 1",
" c None",
@@ -121,7 +124,7 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name,
QStringList cmmds;
// cmmds=QStringList::split( " ", commands, false);
cmmds=commands;
-// qDebug("count %d", cmmds.count());
+// odebug << "count " << cmmds.count() << "" << oendl;
if ( !name )
setName( tr("Output"));
resize( 196, 269 );
@@ -157,7 +160,7 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name,
// * proc << commands.latin1();
for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) {
- qDebug( "%s", (*it).latin1() );
+ odebug << "" << (*it).latin1() << "" << oendl;
* proc << (*it).latin1();
}
@@ -186,7 +189,7 @@ void Output::saveOutput() {
filename+="/";
QString name = fileDlg->LineEdit1->text();
filename+="text/plain/"+name;
- qDebug(filename);
+ odebug << filename << oendl;
QFile f(filename);
f.open( IO_WriteOnly);
@@ -196,16 +199,16 @@ void Output::saveOutput() {
lnk.setFile(filename); //sets File property
lnk.setType("text/plain");
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();
}
}
void Output::commandStdout(OProcess*, char *buffer, int buflen) {
- qWarning("received stdout %d bytes", buflen);
+ owarn << "received stdout " << buflen << " bytes" << oendl;
// QByteArray data(buflen);
// data.fill(*buffer, buflen);
@@ -222,13 +225,13 @@ 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
proc->writeStdin(data.data(), data.size());
}
void Output::commandStderr(OProcess*, char *buffer, int buflen) {
- qWarning("received stderrt %d bytes", buflen);
+ owarn << "received stderrt " << buflen << " bytes" << oendl;
QString lineStr = buffer;
// lineStr=lineStr.left(lineStr.length()-1);