summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm
Unidiff
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
@@ -68,13 +68,13 @@ void AdvancedFm::cleanUp() {
68 QFile file( sfile); 68 QFile file( sfile);
69 if(file.exists()) 69 if(file.exists())
70 file.remove(); 70 file.remove();
71} 71}
72 72
73void AdvancedFm::tabChanged(QWidget *) { 73void AdvancedFm::tabChanged(QWidget *) {
74// qWarning("tab changed"); 74// owarn << "tab changed" << oendl;
75 QString path = CurrentDir()->canonicalPath(); 75 QString path = CurrentDir()->canonicalPath();
76 currentPathCombo->lineEdit()->setText( path ); 76 currentPathCombo->lineEdit()->setText( path );
77 77
78 if(whichTab == 1) { 78 if(whichTab == 1) {
79 viewMenu->setItemChecked(viewMenu->idAt(0), true); 79 viewMenu->setItemChecked(viewMenu->idAt(0), true);
80 viewMenu->setItemChecked(viewMenu->idAt(1), false); 80 viewMenu->setItemChecked(viewMenu->idAt(1), false);
@@ -90,19 +90,19 @@ void AdvancedFm::tabChanged(QWidget *) {
90 chdir( path.latin1()); 90 chdir( path.latin1());
91} 91}
92 92
93 93
94void AdvancedFm::populateView() { 94void AdvancedFm::populateView() {
95 95
96// qWarning("PopulateView"); 96// owarn << "PopulateView" << oendl;
97 QPixmap pm; 97 QPixmap pm;
98 QListView *thisView = CurrentView(); 98 QListView *thisView = CurrentView();
99 QDir *thisDir = CurrentDir(); 99 QDir *thisDir = CurrentDir();
100 QString path = thisDir->canonicalPath(); 100 QString path = thisDir->canonicalPath();
101 101
102//qWarning("path is "+path); 102//owarn << "path is "+path << oendl;
103 thisView->clear(); 103 thisView->clear();
104 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); 104 thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst);
105 thisDir->setMatchAllDirs(TRUE); 105 thisDir->setMatchAllDirs(TRUE);
106 thisDir->setNameFilter(filterStr); 106 thisDir->setNameFilter(filterStr);
107 QString fileL, fileS, fileDate; 107 QString fileL, fileS, fileDate;
108 QString fs= getFileSystemType((const QString &) path); 108 QString fs= getFileSystemType((const QString &) path);
@@ -157,13 +157,13 @@ void AdvancedFm::populateView() {
157 pm=mt.pixmap(); //sets the correct pixmap for mimetype 157 pm=mt.pixmap(); //sets the correct pixmap for mimetype
158 if(pm.isNull()) { 158 if(pm.isNull()) {
159 pm = unknownXpm; 159 pm = unknownXpm;
160 } 160 }
161 } 161 }
162 if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { 162 if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) {
163 // qDebug(" overlay link image"); 163 // odebug << " overlay link image" << oendl;
164 pm= Resource::loadPixmap( "advancedfm/symlink" ); 164 pm= Resource::loadPixmap( "advancedfm/symlink" );
165 // pm= Resource::loadPixmap( "folder" ); 165 // pm= Resource::loadPixmap( "folder" );
166// QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); 166// QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
167// QPainter painter( &pm ); 167// QPainter painter( &pm );
168// painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); 168// painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
169// pm.setMask( pm.createHeuristicMask( FALSE ) ); 169// pm.setMask( pm.createHeuristicMask( FALSE ) );
@@ -181,13 +181,13 @@ void AdvancedFm::populateView() {
181 DIR *dir; 181 DIR *dir;
182 struct dirent *mydirent; 182 struct dirent *mydirent;
183 183
184 if((dir = opendir( path.latin1())) != NULL) 184 if((dir = opendir( path.latin1())) != NULL)
185 while ((mydirent = readdir(dir)) != NULL) { 185 while ((mydirent = readdir(dir)) != NULL) {
186 lstat( mydirent->d_name, &buf); 186 lstat( mydirent->d_name, &buf);
187// qDebug(mydirent->d_name); 187// odebug << mydirent->d_name << oendl;
188 fileL.sprintf("%s", mydirent->d_name); 188 fileL.sprintf("%s", mydirent->d_name);
189 devT = buf.st_dev; 189 devT = buf.st_dev;
190 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); 190 fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF);
191 fileDate.sprintf("%s", ctime( &buf.st_mtime)); 191 fileDate.sprintf("%s", ctime( &buf.st_mtime));
192 if( fileL.find(".") == -1 ) { 192 if( fileL.find(".") == -1 ) {
193 item= new QListViewItem( thisView, fileL, fileS, fileDate); 193 item= new QListViewItem( thisView, fileL, fileS, fileDate);
@@ -206,26 +206,26 @@ void AdvancedFm::populateView() {
206void AdvancedFm::rePopulate() { 206void AdvancedFm::rePopulate() {
207 populateView(); 207 populateView();
208 setOtherTabCurrent(); 208 setOtherTabCurrent();
209 populateView(); 209 populateView();
210 210
211// int tmpTab = whichTab; 211// int tmpTab = whichTab;
212// // qDebug("%d", tmpTab); 212// // odebug << "" << tmpTab << "" << oendl;
213 213
214// for(int i =1; i < 3; i++) { 214// for(int i =1; i < 3; i++) {
215// TabWidget->setCurrentWidget(i - 1); 215// TabWidget->setCurrentWidget(i - 1);
216// populateView(); 216// populateView();
217// } 217// }
218// TabWidget->setCurrentWidget( tmpTab - 1); 218// TabWidget->setCurrentWidget( tmpTab - 1);
219} 219}
220 220
221void AdvancedFm::ListClicked(QListViewItem *selectedItem) { 221void AdvancedFm::ListClicked(QListViewItem *selectedItem) {
222//qWarning("listclicked"); 222//owarn << "listclicked" << oendl;
223 if(selectedItem) { 223 if(selectedItem) {
224 QString strItem=selectedItem->text(0); 224 QString strItem=selectedItem->text(0);
225// qWarning(strItem); 225// owarn << strItem << oendl;
226 QString strSize=selectedItem->text(1); 226 QString strSize=selectedItem->text(1);
227 strSize=strSize.stripWhiteSpace(); 227 strSize=strSize.stripWhiteSpace();
228 bool isDirectory = false; 228 bool isDirectory = false;
229 QString strItem2; 229 QString strItem2;
230 230
231 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink 231 if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink
@@ -264,19 +264,19 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in
264 break; 264 break;
265 }; 265 };
266} 266}
267 267
268 268
269void AdvancedFm::switchToLocalTab() { 269void AdvancedFm::switchToLocalTab() {
270//qWarning("switch to local view"); 270//owarn << "switch to local view" << oendl;
271 TabWidget->setCurrentWidget(0); 271 TabWidget->setCurrentWidget(0);
272 Local_View->setFocus(); 272 Local_View->setFocus();
273} 273}
274 274
275void AdvancedFm::switchToRemoteTab() { 275void AdvancedFm::switchToRemoteTab() {
276//qWarning("switch to local view"); 276//owarn << "switch to local view" << oendl;
277 TabWidget->setCurrentWidget(1); 277 TabWidget->setCurrentWidget(1);
278 Remote_View->setFocus(); 278 Remote_View->setFocus();
279} 279}
280 280
281void AdvancedFm::readConfig() { 281void AdvancedFm::readConfig() {
282 Config cfg("AdvancedFm"); 282 Config cfg("AdvancedFm");
@@ -326,13 +326,13 @@ QStringList AdvancedFm::getPath() {
326 QListView *thisView=CurrentView(); 326 QListView *thisView=CurrentView();
327 QList<QListViewItem> * getSelectedItems( QListView * thisView ); 327 QList<QListViewItem> * getSelectedItems( QListView * thisView );
328 QListViewItemIterator it( thisView ); 328 QListViewItemIterator it( thisView );
329 for ( ; it.current(); ++it ) { 329 for ( ; it.current(); ++it ) {
330 if ( it.current()->isSelected() ) { 330 if ( it.current()->isSelected() ) {
331 strList << it.current()->text(0); 331 strList << it.current()->text(0);
332// qDebug(it.current()->text(0)); 332// odebug << it.current()->text(0) << oendl;
333 } 333 }
334 } 334 }
335 return strList; 335 return strList;
336} 336}
337 337
338void AdvancedFm::homeButtonPushed() { 338void AdvancedFm::homeButtonPushed() {
@@ -377,13 +377,13 @@ void AdvancedFm::doAbout() {
377 "is copyright 2002-2003 by\n" 377 "is copyright 2002-2003 by\n"
378 "L.J.Potter<llornkcor@handhelds.org>\n" 378 "L.J.Potter<llornkcor@handhelds.org>\n"
379 "and is licensed by the GPL")); 379 "and is licensed by the GPL"));
380} 380}
381 381
382void AdvancedFm::keyPressEvent( QKeyEvent *e) { 382void AdvancedFm::keyPressEvent( QKeyEvent *e) {
383// qWarning("key %d", e->key()); 383// owarn << "key " << e->key() << "" << oendl;
384// if( CurrentView()->hasFocus() ) 384// if( CurrentView()->hasFocus() )
385 { 385 {
386 switch ( e->key() ) { 386 switch ( e->key() ) {
387 case Key_Left: 387 case Key_Left:
388 upDir(); 388 upDir();
389 break; 389 break;
@@ -635,13 +635,13 @@ void AdvancedFm::addToDocs() {
635 QDir *thisDir = CurrentDir(); 635 QDir *thisDir = CurrentDir();
636 636
637 if( strListPaths.count() > 0) { 637 if( strListPaths.count() > 0) {
638 QString curFile; 638 QString curFile;
639 for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { 639 for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) {
640 curFile = thisDir->canonicalPath()+"/"+(*it); 640 curFile = thisDir->canonicalPath()+"/"+(*it);
641// qDebug(curFile); 641// odebug << curFile << oendl;
642 QFileInfo fi(curFile); 642 QFileInfo fi(curFile);
643 DocLnk f; 643 DocLnk f;
644// curFile.replace(QRegExp("\\..*"),""); 644// curFile.replace(QRegExp("\\..*"),"");
645 f.setName(fi.baseName() ); 645 f.setName(fi.baseName() );
646 f.setFile( curFile); 646 f.setFile( curFile);
647 f.writeLink(); 647 f.writeLink();
@@ -708,13 +708,13 @@ void AdvancedFm::addCustomDir() {
708 708
709 cfg.writeEntry("CustomDir", list, ','); 709 cfg.writeEntry("CustomDir", list, ',');
710 cfg.write(); 710 cfg.write();
711} 711}
712 712
713void AdvancedFm::removeCustomDir() { 713void AdvancedFm::removeCustomDir() {
714// qDebug("remove custom dir"); 714// odebug << "remove custom dir" << oendl;
715 Config cfg("AdvancedFm"); 715 Config cfg("AdvancedFm");
716 cfg.setGroup("Menu"); 716 cfg.setGroup("Menu");
717 QString dir; 717 QString dir;
718 QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); 718 QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)',');
719 QStringList list2; 719 QStringList list2;
720 dir = CurrentDir()->canonicalPath(); 720 dir = CurrentDir()->canonicalPath();
@@ -743,13 +743,13 @@ void AdvancedFm::removeCustomDir() {
743 } 743 }
744// customDirsToMenu(); 744// customDirsToMenu();
745 745
746} 746}
747 747
748void AdvancedFm::gotoCustomDir(const QString &dir) { 748void AdvancedFm::gotoCustomDir(const QString &dir) {
749// qDebug("gotoCustomDir(const QString &dir) " +dir ); 749// odebug << "gotoCustomDir(const QString &dir) " +dir << oendl;
750// QString curDir = dir; 750// QString curDir = dir;
751// QDir *thisDir = CurrentDir(); 751// QDir *thisDir = CurrentDir();
752// if( curDir.isEmpty()) { 752// if( curDir.isEmpty()) {
753// } 753// }
754 if( dir == s_addBookmark) { 754 if( dir == s_addBookmark) {
755 addCustomDir(); 755 addCustomDir();
@@ -784,56 +784,56 @@ QDir *AdvancedFm::OtherDir() {
784 return &currentDir; 784 return &currentDir;
785 } 785 }
786} 786}
787 787
788QListView * AdvancedFm::CurrentView() { 788QListView * AdvancedFm::CurrentView() {
789 if ( whichTab == 1) { 789 if ( whichTab == 1) {
790// qWarning("CurrentView Tab 1"); 790// owarn << "CurrentView Tab 1" << oendl;
791 return Local_View; 791 return Local_View;
792 } else { 792 } else {
793// qWarning("CurrentView Tab 2"); 793// owarn << "CurrentView Tab 2" << oendl;
794 return Remote_View; 794 return Remote_View;
795 } 795 }
796} 796}
797 797
798QListView * AdvancedFm::OtherView() { 798QListView * AdvancedFm::OtherView() {
799 if ( whichTab == 1) 799 if ( whichTab == 1)
800 return Remote_View; 800 return Remote_View;
801 else 801 else
802 return Local_View; 802 return Local_View;
803} 803}
804 804
805void AdvancedFm::setOtherTabCurrent() { 805void AdvancedFm::setOtherTabCurrent() {
806// qWarning("setOtherTabCurrent() %d", whichTab); 806// owarn << "setOtherTabCurrent() " << whichTab << "" << oendl;
807 if ( whichTab == 1) { 807 if ( whichTab == 1) {
808 TabWidget->setCurrentWidget(1); 808 TabWidget->setCurrentWidget(1);
809 } else { 809 } else {
810 TabWidget->setCurrentWidget(0); 810 TabWidget->setCurrentWidget(0);
811 } 811 }
812 OtherView()->setFocus(); 812 OtherView()->setFocus();
813 OtherView()->setSelected( CurrentView()->firstChild(), true); 813 OtherView()->setSelected( CurrentView()->firstChild(), true);
814} 814}
815 815
816void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { 816void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) {
817// qDebug("qcop message "+msg ); 817// odebug << "qcop message "+msg << oendl;
818 QDataStream stream ( data, IO_ReadOnly ); 818 QDataStream stream ( data, IO_ReadOnly );
819 if ( msg == "openDirectory(QString)" ) { 819 if ( msg == "openDirectory(QString)" ) {
820// qDebug("received"); 820// odebug << "received" << oendl;
821 QString file; 821 QString file;
822 stream >> file; 822 stream >> file;
823 gotoDirectory( (const QString &) file); 823 gotoDirectory( (const QString &) file);
824 } 824 }
825} 825}
826 826
827void AdvancedFm::setDocument(const QString &file) { 827void AdvancedFm::setDocument(const QString &file) {
828 gotoDirectory( file); 828 gotoDirectory( file);
829 829
830} 830}
831 831
832void AdvancedFm::gotoDirectory(const QString &file) { 832void AdvancedFm::gotoDirectory(const QString &file) {
833// qWarning("goto dir "+file); 833// owarn << "goto dir "+file << oendl;
834 QString curDir = file; 834 QString curDir = file;
835 QDir *thisDir = CurrentDir(); 835 QDir *thisDir = CurrentDir();
836 if(QDir( curDir).exists() ) { 836 if(QDir( curDir).exists() ) {
837 thisDir->setPath( curDir ); 837 thisDir->setPath( curDir );
838 chdir( curDir.latin1() ); 838 chdir( curDir.latin1() );
839 thisDir->cd( curDir, TRUE); 839 thisDir->cd( curDir, TRUE);
@@ -863,13 +863,13 @@ void AdvancedFm::findFile(const QString &fileName) {
863 thisView->ensureItemVisible(it.current()); 863 thisView->ensureItemVisible(it.current());
864 } 864 }
865 } 865 }
866} 866}
867 867
868void AdvancedFm::slotSwitchMenu(int ) { 868void AdvancedFm::slotSwitchMenu(int ) {
869// qDebug("Switch %d", item); 869// odebug << "Switch " << item << "" << oendl;
870 // viewMenu->setItemChecked(item, true); 870 // viewMenu->setItemChecked(item, true);
871} 871}
872 872
873void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { 873void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) {
874 tabChanged( w); 874 tabChanged( w);
875 if( w == Local_View) { 875 if( w == Local_View) {
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,35 +1,15 @@
1TEMPLATE = app 1TEMPLATE = app
2CONFIG += qt warn_on quick-app 2CONFIG += qt warn_on quick-app
3# CONFIG += qt warn_on
4HEADERS = advancedfm.h filePermissions.h output.h 3HEADERS = advancedfm.h filePermissions.h output.h
5SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp 4SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp
6TARGET = advancedfm 5TARGET = advancedfm
7INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 7DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe -lopiecore2 -lopieui2 8LIBS += -lqpe -lopiecore2 -lopieui2
10 9
11TRANSLATIONS = ../../../i18n/de/advancedfm.ts \
12 ../../../i18n/nl/advancedfm.ts \
13 ../../../i18n/da/advancedfm.ts \
14 ../../../i18n/xx/advancedfm.ts \
15 ../../../i18n/en/advancedfm.ts \
16 ../../../i18n/es/advancedfm.ts \
17 ../../../i18n/fr/advancedfm.ts \
18 ../../../i18n/hu/advancedfm.ts \
19 ../../../i18n/ja/advancedfm.ts \
20 ../../../i18n/ko/advancedfm.ts \
21 ../../../i18n/no/advancedfm.ts \
22 ../../../i18n/pl/advancedfm.ts \
23 ../../../i18n/pt/advancedfm.ts \
24 ../../../i18n/pt_BR/advancedfm.ts \
25 ../../../i18n/sl/advancedfm.ts \
26 ../../../i18n/zh_CN/advancedfm.ts \
27 ../../../i18n/zh_TW/advancedfm.ts
28
29
30!contains(CONFIG,quick-app) { 10!contains(CONFIG,quick-app) {
31 DESTDIR = $(OPIEDIR)/bin 11 DESTDIR = $(OPIEDIR)/bin
32 DEFINES += NOQUICKLAUNCH 12 DEFINES += NOQUICKLAUNCH
33} 13}
34 14
35include ( $(OPIEDIR)/include.pro ) 15include ( $(OPIEDIR)/include.pro )
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
@@ -8,29 +8,33 @@
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#include "advancedfm.h" 12#include "advancedfm.h"
13 13
14/* OPIE */
15#include <opie2/odebug.h>
14#include <qpe/storage.h> 16#include <qpe/storage.h>
15#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
16#include <qpe/resource.h> 18#include <qpe/resource.h>
17#include <qpe/menubutton.h> 19#include <qpe/menubutton.h>
20using namespace Opie::Core;
21using namespace Opie::Ui;
18 22
23/* QT */
19#include <qlayout.h> 24#include <qlayout.h>
20#include <qhbox.h> 25#include <qhbox.h>
21#include <qmenubar.h> 26#include <qmenubar.h>
22#include <qcombobox.h> 27#include <qcombobox.h>
23#include <qtoolbutton.h> 28#include <qtoolbutton.h>
24#include <qlineedit.h> 29#include <qlineedit.h>
25#include <qlistview.h> 30#include <qlistview.h>
26 31
32/* STD */
27#include <sys/utsname.h> 33#include <sys/utsname.h>
28 34
29
30using namespace Opie::Ui;
31void AdvancedFm::init() { 35void AdvancedFm::init() {
32 b = false; 36 b = false;
33 setCaption( tr( "AdvancedFm" ) ); 37 setCaption( tr( "AdvancedFm" ) );
34 38
35 QVBoxLayout *layout = new QVBoxLayout( this ); 39 QVBoxLayout *layout = new QVBoxLayout( this );
36 layout->setSpacing( 2); 40 layout->setSpacing( 2);
@@ -216,17 +220,17 @@ void AdvancedFm::init() {
216 zaurusDevice=TRUE; 220 zaurusDevice=TRUE;
217 else 221 else
218 zaurusDevice=FALSE; 222 zaurusDevice=FALSE;
219 223
220 224
221 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { 225 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) {
222 qDebug("not have sd"); 226 odebug << "not have sd" << oendl;
223 sdButton->hide(); 227 sdButton->hide();
224 } 228 }
225 if( !StorageInfo::hasCf() ) { 229 if( !StorageInfo::hasCf() ) {
226 qDebug("not have cf"); 230 odebug << "not have cf" << oendl;
227 cfButton->hide(); 231 cfButton->hide();
228 } 232 }
229 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 233 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
230 currentDir.setPath( QDir::currentDirPath()); 234 currentDir.setPath( QDir::currentDirPath());
231 235
232 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 236 currentRemoteDir.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
@@ -6,45 +6,48 @@
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12
12#include "advancedfm.h" 13#include "advancedfm.h"
13#include "output.h" 14#include "output.h"
14#include "filePermissions.h" 15#include "filePermissions.h"
15 16
17/* OPIE */
18#include <opie2/odebug.h>
16#include <qpe/lnkproperties.h> 19#include <qpe/lnkproperties.h>
17#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
18#include <qpe/applnk.h> 21#include <qpe/applnk.h>
22using namespace Opie::Core;
19 23
20#include <qmessagebox.h> 24/* QT*/
21
22 25
26#include <qmessagebox.h>
23#include <qpopupmenu.h> 27#include <qpopupmenu.h>
24#include <qlistview.h> 28#include <qlistview.h>
25 29
30/* STD */
31
26#include <errno.h> 32#include <errno.h>
27#include <stdlib.h> 33#include <stdlib.h>
28#include <unistd.h> 34#include <unistd.h>
29#include <sys/stat.h> 35#include <sys/stat.h>
30#include <dirent.h> 36#include <dirent.h>
31#include <sys/sendfile.h> 37#include <sys/sendfile.h>
32#include <fcntl.h> 38#include <fcntl.h>
33 39
34
35using namespace Opie::Core;
36using namespace Opie::Core;
37void AdvancedFm::doDirChange() { 40void AdvancedFm::doDirChange() {
38 QString pathItem = CurrentView()->currentItem()->text(0); 41 QString pathItem = CurrentView()->currentItem()->text(0);
39 if( pathItem == "../") { 42 if( pathItem == "../") {
40 ListClicked( CurrentView()->currentItem()); 43 ListClicked( CurrentView()->currentItem());
41 } else { 44 } else {
42 if( pathItem.find(" -> ",0,TRUE) != -1) 45 if( pathItem.find(" -> ",0,TRUE) != -1)
43 pathItem = dealWithSymName((const QString&)pathItem)+"/"; 46 pathItem = dealWithSymName((const QString&)pathItem)+"/";
44// qWarning(pathItem); 47// owarn << pathItem << oendl;
45 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); 48 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) );
46 } 49 }
47} 50}
48 51
49void AdvancedFm::showMenuHidden() { 52void AdvancedFm::showMenuHidden() {
50 if (b) { 53 if (b) {
@@ -89,25 +92,25 @@ void AdvancedFm::runThis() {
89 curFile = dealWithSymName((const QString&)curFile); 92 curFile = dealWithSymName((const QString&)curFile);
90 93
91 if(curFile != "../") { 94 if(curFile != "../") {
92 95
93 fs = getFileSystemType((const QString &) path); 96 fs = getFileSystemType((const QString &) path);
94 QFileInfo fileInfo( path + "/" + curFile); 97 QFileInfo fileInfo( path + "/" + curFile);
95// qDebug( fileInfo.owner()); 98// odebug << fileInfo.owner() << oendl;
96 99
97 if( (fileInfo.permission( QFileInfo::ExeUser) 100 if( (fileInfo.permission( QFileInfo::ExeUser)
98 | fileInfo.permission( QFileInfo::ExeGroup) 101 | fileInfo.permission( QFileInfo::ExeGroup)
99 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { 102 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) {
100 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { 103 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
101 QCopEnvelope e("QPE/System", "execute(QString)" ); 104 QCopEnvelope e("QPE/System", "execute(QString)" );
102 e << curFile; 105 e << curFile;
103 } else { 106 } else {
104 curFile = path + "/" + curFile; 107 curFile = path + "/" + curFile;
105 DocLnk nf(curFile); 108 DocLnk nf(curFile);
106 QString execStr = nf.exec(); 109 QString execStr = nf.exec();
107// qDebug( execStr); 110// odebug << execStr << oendl;
108 if( execStr.isEmpty() ) { 111 if( execStr.isEmpty() ) {
109 } else { 112 } else {
110 nf.execute(); 113 nf.execute();
111 } 114 }
112 } 115 }
113 } 116 }
@@ -199,18 +202,18 @@ void AdvancedFm::doDelete() {
199 } 202 }
200 203
201 QString cmd="rm "+f; 204 QString cmd="rm "+f;
202 QFile file(f); 205 QFile file(f);
203 QFileInfo fi(myFile); 206 QFileInfo fi(myFile);
204 if( fi.fileName().find("../",0,TRUE)==-1) { 207 if( fi.fileName().find("../",0,TRUE)==-1) {
205// qDebug("remove link files "+myFile); 208// odebug << "remove link files "+myFile << oendl;
206 209
207// DocLnk lnk(f); 210// DocLnk lnk(f);
208 DocLnk *lnk; 211 DocLnk *lnk;
209 lnk = new DocLnk(f); 212 lnk = new DocLnk(f);
210// qDebug("Deleting doclnk " + lnk->linkFile()); 213// odebug << "Deleting doclnk " + lnk->linkFile() << oendl;
211 if(lnk->isValid()) 214 if(lnk->isValid())
212 lnk->removeLinkFile(); 215 lnk->removeLinkFile();
213 // delete lnk; 216 // delete lnk;
214 file.remove(); 217 file.remove();
215 } 218 }
216 } 219 }
@@ -240,16 +243,16 @@ void AdvancedFm::doProperties() {
240 243
241 QStringList curFileList = getPath(); 244 QStringList curFileList = getPath();
242 245
243 QString filePath; 246 QString filePath;
244 filePath = CurrentDir()->canonicalPath()+"/"; 247 filePath = CurrentDir()->canonicalPath()+"/";
245 248
246// qDebug("%d",curFileList.count()); 249// odebug << "" << curFileList.count() << "" << oendl;
247 250
248 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 251 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
249// qDebug((filePath+*it)); 252// odebug << (filePath+*it) << oendl;
250 DocLnk lnk( (filePath+*it)); 253 DocLnk lnk( (filePath+*it));
251 LnkProperties prop( &lnk ); 254 LnkProperties prop( &lnk );
252 QPEApplication::execDialog( &prop ); 255 QPEApplication::execDialog( &prop );
253 } 256 }
254#endif 257#endif
255 258
@@ -299,14 +302,14 @@ void AdvancedFm::copy() {
299 if(item.find("->",0,TRUE)) //symlink 302 if(item.find("->",0,TRUE)) //symlink
300 item = item.left(item.find("->",0,TRUE)); 303 item = item.left(item.find("->",0,TRUE));
301 304
302 curFile = thisDir->canonicalPath()+"/"+ item; 305 curFile = thisDir->canonicalPath()+"/"+ item;
303 destFile = thatDir->canonicalPath()+"/"+ item; 306 destFile = thatDir->canonicalPath()+"/"+ item;
304 307
305// qDebug("Destination file is "+destFile); 308// odebug << "Destination file is "+destFile << oendl;
306// qDebug("CurrentFile file is " + curFile); 309// odebug << "CurrentFile file is " + curFile << oendl;
307 310
308 QFile f(destFile); 311 QFile f(destFile);
309 if( f.exists()) { 312 if( f.exists()) {
310 if(doMsg) { 313 if(doMsg) {
311 switch ( QMessageBox::warning(this,tr("File Exists!"), 314 switch ( QMessageBox::warning(this,tr("File Exists!"),
312 tr("%1 exists. Ok to overwrite?").arg( item ), 315 tr("%1 exists. Ok to overwrite?").arg( item ),
@@ -417,13 +420,13 @@ void AdvancedFm::copySameDir() {
417 if(!copyFile( curFile,destFile) ) { 420 if(!copyFile( curFile,destFile) ) {
418 QMessageBox::message("AdvancedFm",tr("Could not copy\n") 421 QMessageBox::message("AdvancedFm",tr("Could not copy\n")
419 +curFile +tr("to\n")+destFile); 422 +curFile +tr("to\n")+destFile);
420 return; 423 return;
421 } 424 }
422 425
423// qDebug("copy "+curFile+" as "+destFile); 426// odebug << "copy "+curFile+" as "+destFile << oendl;
424 } 427 }
425 delete fileDlg; 428 delete fileDlg;
426 } 429 }
427 rePopulate(); 430 rePopulate();
428} 431}
429 432
@@ -440,19 +443,19 @@ void AdvancedFm::move() {
440 item=(*it); 443 item=(*it);
441 QString destFile = thatDir->canonicalPath(); 444 QString destFile = thatDir->canonicalPath();
442 445
443 if(destFile.right(1).find("/",0,TRUE) == -1) 446 if(destFile.right(1).find("/",0,TRUE) == -1)
444 destFile+="/"; 447 destFile+="/";
445 destFile += item; 448 destFile += item;
446// qDebug("Destination file is "+destFile); 449// odebug << "Destination file is "+destFile << oendl;
447 450
448 curFile = thisDir->canonicalPath(); 451 curFile = thisDir->canonicalPath();
449 if(curFile.right(1).find("/",0,TRUE) == -1) 452 if(curFile.right(1).find("/",0,TRUE) == -1)
450 curFile +="/"; 453 curFile +="/";
451 curFile+= item; 454 curFile+= item;
452// qDebug("CurrentFile file is " + curFile); 455// odebug << "CurrentFile file is " + curFile << oendl;
453 456
454 if(QFileInfo(curFile).isDir()) { 457 if(QFileInfo(curFile).isDir()) {
455 moveDirectory( curFile, destFile ); 458 moveDirectory( curFile, destFile );
456 rePopulate(); 459 rePopulate();
457 return; 460 return;
458 } 461 }
@@ -486,13 +489,13 @@ bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
486 return true; 489 return true;
487} 490}
488 491
489bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { 492bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
490 493
491 QString cmd = "/bin/cp -fpR " + src + " " + dest; 494 QString cmd = "/bin/cp -fpR " + src + " " + dest;
492 qWarning(cmd); 495 owarn << cmd << oendl;
493 int err = system( (const char *) cmd ); 496 int err = system( (const char *) cmd );
494 if ( err != 0 ) { 497 if ( err != 0 ) {
495 QMessageBox::message("AdvancedFm", 498 QMessageBox::message("AdvancedFm",
496 tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); 499 tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) );
497 return false; 500 return false;
498 } 501 }
@@ -522,20 +525,20 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
522 int err=0; 525 int err=0;
523 int read_fd=0; 526 int read_fd=0;
524 int write_fd=0; 527 int write_fd=0;
525 struct stat stat_buf; 528 struct stat stat_buf;
526 off_t offset = 0; 529 off_t offset = 0;
527 if(!srcFile.open( IO_ReadOnly|IO_Raw)) { 530 if(!srcFile.open( IO_ReadOnly|IO_Raw)) {
528// qWarning("open failed"); 531// owarn << "open failed" << oendl;
529 return success = false; 532 return success = false;
530 } 533 }
531 read_fd = srcFile.handle(); 534 read_fd = srcFile.handle();
532 if(read_fd != -1) { 535 if(read_fd != -1) {
533 fstat (read_fd, &stat_buf); 536 fstat (read_fd, &stat_buf);
534 if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { 537 if( !destFile.open( IO_WriteOnly|IO_Raw ) ) {
535// qWarning("destfile open failed"); 538// owarn << "destfile open failed" << oendl;
536 return success = false; 539 return success = false;
537 } 540 }
538 write_fd = destFile.handle(); 541 write_fd = destFile.handle();
539 if(write_fd != -1) { 542 if(write_fd != -1) {
540 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); 543 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size);
541 if( err == -1) { 544 if( err == -1) {
@@ -544,13 +547,13 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
544 case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; 547 case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. ";
545 case EINVAL: msg = "Descriptor is not valid or locked. "; 548 case EINVAL: msg = "Descriptor is not valid or locked. ";
546 case ENOMEM: msg = "Insufficient memory to read from in_fd."; 549 case ENOMEM: msg = "Insufficient memory to read from in_fd.";
547 case EIO: msg = "Unspecified error while reading from in_fd."; 550 case EIO: msg = "Unspecified error while reading from in_fd.";
548 }; 551 };
549 success = false; 552 success = false;
550// qWarning(msg); 553// owarn << msg << oendl;
551 } 554 }
552 } else { 555 } else {
553 success = false; 556 success = false;
554 } 557 }
555 } else { 558 } else {
556 success = false; 559 success = false;
@@ -576,13 +579,13 @@ void AdvancedFm::runCommand() {
576 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 579 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
577 fileDlg->setInputText(curFile); 580 fileDlg->setInputText(curFile);
578 fileDlg->exec(); 581 fileDlg->exec();
579 //QString command; 582 //QString command;
580 583
581 if( fileDlg->result() == 1 ) { 584 if( fileDlg->result() == 1 ) {
582// qDebug(fileDlg->LineEdit1->text()); 585// odebug << fileDlg->LineEdit1->text() << oendl;
583 QStringList command; 586 QStringList command;
584 587
585 command << "/bin/sh"; 588 command << "/bin/sh";
586 command << "-c"; 589 command << "-c";
587 command << fileDlg->LineEdit1->text(); 590 command << fileDlg->LineEdit1->text();
588 Output *outDlg; 591 Output *outDlg;
@@ -659,13 +662,13 @@ void AdvancedFm::mkSym() {
659 662
660 if( curFile.right(1) == "/") { 663 if( curFile.right(1) == "/") {
661 curFile = curFile.left( curFile.length() -1); 664 curFile = curFile.left( curFile.length() -1);
662 } 665 }
663 666
664 cmd = "ln -s "+curFile+" "+destName; 667 cmd = "ln -s "+curFile+" "+destName;
665// qDebug(cmd); 668// odebug << cmd << oendl;
666 startProcess( (const QString)cmd ); 669 startProcess( (const QString)cmd );
667 } 670 }
668 rePopulate(); 671 rePopulate();
669 setOtherTabCurrent(); 672 setOtherTabCurrent();
670 } 673 }
671} 674}
@@ -712,21 +715,21 @@ void AdvancedFm::startProcess(const QString & cmd) {
712 715
713 command << "/bin/sh"; 716 command << "/bin/sh";
714 command << "-c"; 717 command << "-c";
715 command << cmd.latin1(); 718 command << cmd.latin1();
716 *process << command; 719 *process << command;
717 if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) 720 if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
718 qDebug("could not start process"); 721 odebug << "could not start process" << oendl;
719} 722}
720 723
721void AdvancedFm::processEnded(OProcess *) { 724void AdvancedFm::processEnded(OProcess *) {
722 rePopulate(); 725 rePopulate();
723} 726}
724 727
725void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { 728void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) {
726// qWarning("received stderrt %d bytes", buflen); 729// owarn << "received stderrt " << buflen << " bytes" << oendl;
727 730
728 QString lineStr = buffer; 731 QString lineStr = buffer;
729 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); 732 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
730} 733}
731 734
732bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { 735bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
@@ -762,13 +765,13 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
762 765
763 return QWidget::eventFilter( o, e ); 766 return QWidget::eventFilter( o, e );
764} 767}
765 768
766 769
767void AdvancedFm::cancelRename() { 770void AdvancedFm::cancelRename() {
768// qDebug("cancel rename"); 771// odebug << "cancel rename" << oendl;
769 QListView * view; 772 QListView * view;
770 view = CurrentView(); 773 view = CurrentView();
771 774
772 bool resetFocus = view->viewport()->focusProxy() == renameBox; 775 bool resetFocus = view->viewport()->focusProxy() == renameBox;
773 delete renameBox; 776 delete renameBox;
774 renameBox = 0; 777 renameBox = 0;
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
@@ -29,13 +29,13 @@
29 29
30filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) 30filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName )
31 : QDialog( parent, name, modal, fl ) 31 : QDialog( parent, name, modal, fl )
32{ 32{
33 if ( !name ) 33 if ( !name )
34 setName( tr("filePermissions") ); 34 setName( tr("filePermissions") );
35// qDebug("FilePermissions "+fileName); 35// odebug << "FilePermissions "+fileName << oendl;
36/* resize( 236, 210 ); 36/* resize( 236, 210 );
37 setMaximumSize( QSize( 236, 210 ) ); 37 setMaximumSize( QSize( 236, 210 ) );
38*/ setCaption( tr( "Set File Permissions" ) ); 38*/ setCaption( tr( "Set File Permissions" ) );
39 39
40 TextLabel1 = new QLabel( this, "TextLabel1" ); 40 TextLabel1 = new QLabel( this, "TextLabel1" );
41 TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); 41 TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) );
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
@@ -2,25 +2,28 @@
2** outputEdit.cpp 2** outputEdit.cpp
3** 3**
4** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> 4** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com>
5****************************************************************************/ 5****************************************************************************/
6#include "output.h" 6#include "output.h"
7 7
8/* OPIE */
9#include <opie2/odebug.h>
8#include <qpe/qpeapplication.h> 10#include <qpe/qpeapplication.h>
9#include <qpe/applnk.h> 11#include <qpe/applnk.h>
12using namespace Opie::Core;
10 13
14/* QT */
11#include <qfile.h> 15#include <qfile.h>
12#include <qmultilineedit.h> 16#include <qmultilineedit.h>
13#include <qpushbutton.h> 17#include <qpushbutton.h>
14#include <qlayout.h> 18#include <qlayout.h>
15 19
20/* STD */
16#include <errno.h> 21#include <errno.h>
17 22
18/* XPM */ 23/* XPM */
19using namespace Opie::Core;
20using namespace Opie::Core;
21static char * filesave_xpm[] = { 24static char * filesave_xpm[] = {
22"16 16 78 1", 25"16 16 78 1",
23" c None", 26" c None",
24". c #343434", 27". c #343434",
25"+ c #A0A0A0", 28"+ c #A0A0A0",
26"@ c #565656", 29"@ c #565656",
@@ -118,13 +121,13 @@ static char * filesave_xpm[] = {
118Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) 121Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl)
119 : QDialog( parent, name, modal, fl ) 122 : QDialog( parent, name, modal, fl )
120{ 123{
121 QStringList cmmds; 124 QStringList cmmds;
122// cmmds=QStringList::split( " ", commands, false); 125// cmmds=QStringList::split( " ", commands, false);
123 cmmds=commands; 126 cmmds=commands;
124// qDebug("count %d", cmmds.count()); 127// odebug << "count " << cmmds.count() << "" << oendl;
125 if ( !name ) 128 if ( !name )
126 setName( tr("Output")); 129 setName( tr("Output"));
127 resize( 196, 269 ); 130 resize( 196, 269 );
128 setCaption( name ); 131 setCaption( name );
129 132
130 OutputLayout = new QGridLayout( this ); 133 OutputLayout = new QGridLayout( this );
@@ -154,13 +157,13 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name,
154 157
155// connect( , SIGNAL(received(const QByteArray&)), 158// connect( , SIGNAL(received(const QByteArray&)),
156// this, SLOT(commandStdin(const QByteArray&))); 159// this, SLOT(commandStdin(const QByteArray&)));
157 160
158// * proc << commands.latin1(); 161// * proc << commands.latin1();
159 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { 162 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) {
160 qDebug( "%s", (*it).latin1() ); 163 odebug << "" << (*it).latin1() << "" << oendl;
161 * proc << (*it).latin1(); 164 * proc << (*it).latin1();
162 } 165 }
163 166
164 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { 167 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) {
165 168
166 OutputEdit->append(tr("Process could not start") ); 169 OutputEdit->append(tr("Process could not start") );
@@ -183,32 +186,32 @@ void Output::saveOutput() {
183 if( fileDlg->result() == 1 ) { 186 if( fileDlg->result() == 1 ) {
184 QString filename = QPEApplication::documentDir(); 187 QString filename = QPEApplication::documentDir();
185 if(filename.right(1).find('/') == -1) 188 if(filename.right(1).find('/') == -1)
186 filename+="/"; 189 filename+="/";
187 QString name = fileDlg->LineEdit1->text(); 190 QString name = fileDlg->LineEdit1->text();
188 filename+="text/plain/"+name; 191 filename+="text/plain/"+name;
189 qDebug(filename); 192 odebug << filename << oendl;
190 193
191 QFile f(filename); 194 QFile f(filename);
192 f.open( IO_WriteOnly); 195 f.open( IO_WriteOnly);
193 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { 196 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
194 DocLnk lnk; 197 DocLnk lnk;
195 lnk.setName(name); //sets file name 198 lnk.setName(name); //sets file name
196 lnk.setFile(filename); //sets File property 199 lnk.setFile(filename); //sets File property
197 lnk.setType("text/plain"); 200 lnk.setType("text/plain");
198 if(!lnk.writeLink()) { 201 if(!lnk.writeLink()) {
199 qDebug("Writing doclink did not work"); 202 odebug << "Writing doclink did not work" << oendl;
200 } 203 }
201 } else 204 } else
202 qWarning("Could not write file"); 205 owarn << "Could not write file" << oendl;
203 f.close(); 206 f.close();
204 } 207 }
205} 208}
206 209
207void Output::commandStdout(OProcess*, char *buffer, int buflen) { 210void Output::commandStdout(OProcess*, char *buffer, int buflen) {
208 qWarning("received stdout %d bytes", buflen); 211 owarn << "received stdout " << buflen << " bytes" << oendl;
209 212
210// QByteArray data(buflen); 213// QByteArray data(buflen);
211// data.fill(*buffer, buflen); 214// data.fill(*buffer, buflen);
212// for (uint i = 0; i < data.count(); i++ ) { 215// for (uint i = 0; i < data.count(); i++ ) {
213// printf("%c", buffer[i] ); 216// printf("%c", buffer[i] );
214// } 217// }
@@ -219,19 +222,19 @@ void Output::commandStdout(OProcess*, char *buffer, int buflen) {
219 OutputEdit->append(lineStr); 222 OutputEdit->append(lineStr);
220 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 223 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
221} 224}
222 225
223 226
224void Output::commandStdin( const QByteArray &data) { 227void Output::commandStdin( const QByteArray &data) {
225 qWarning("received stdin %d bytes", data.size()); 228 owarn << "received stdin " << data.size() << " bytes" << oendl;
226 // recieved data from the io layer goes to sz 229 // recieved data from the io layer goes to sz
227 proc->writeStdin(data.data(), data.size()); 230 proc->writeStdin(data.data(), data.size());
228} 231}
229 232
230void Output::commandStderr(OProcess*, char *buffer, int buflen) { 233void Output::commandStderr(OProcess*, char *buffer, int buflen) {
231 qWarning("received stderrt %d bytes", buflen); 234 owarn << "received stderrt " << buflen << " bytes" << oendl;
232 235
233 QString lineStr = buffer; 236 QString lineStr = buffer;
234// lineStr=lineStr.left(lineStr.length()-1); 237// lineStr=lineStr.left(lineStr.length()-1);
235 OutputEdit->append(lineStr); 238 OutputEdit->append(lineStr);
236 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 239 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
237} 240}