summaryrefslogtreecommitdiff
path: root/noncore
authorllornkcor <llornkcor>2003-11-07 12:37:57 (UTC)
committer llornkcor <llornkcor>2003-11-07 12:37:57 (UTC)
commitfa1e47631442d509e9c1603684bdc9e9590cf866 (patch) (unidiff)
tree5411adf72ccde8c46b13b0487a2602609b081d9e /noncore
parent82fdb639058354177d27b432f97e8750ac846ee6 (diff)
downloadopie-fa1e47631442d509e9c1603684bdc9e9590cf866.zip
opie-fa1e47631442d509e9c1603684bdc9e9590cf866.tar.gz
opie-fa1e47631442d509e9c1603684bdc9e9590cf866.tar.bz2
from 1.0, needs fix
Diffstat (limited to 'noncore') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp7
-rw-r--r--noncore/apps/advancedfm/advancedfm.h4
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp62
3 files changed, 63 insertions, 10 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index 2fc4b49..ecf471d 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -104,2 +104,4 @@ void AdvancedFm::tabChanged(QWidget *) {
104void AdvancedFm::populateView() { 104void AdvancedFm::populateView() {
105
106qWarning("PopulateView");
105 QPixmap pm; 107 QPixmap pm;
@@ -108,3 +110,4 @@ void AdvancedFm::populateView() {
108 QString path = thisDir->canonicalPath(); 110 QString path = thisDir->canonicalPath();
109// qWarning("path is "+path); 111
112qWarning("path is "+path);
110 thisView->clear(); 113 thisView->clear();
@@ -811,3 +814,3 @@ QListView * AdvancedFm::OtherView() {
811void AdvancedFm::setOtherTabCurrent() { 814void AdvancedFm::setOtherTabCurrent() {
812// qWarning("setOtherTabCurrent()"); 815 qWarning("setOtherTabCurrent() %d", whichTab);
813 if ( whichTab == 1) { 816 if ( whichTab == 1) {
diff --git a/noncore/apps/advancedfm/advancedfm.h b/noncore/apps/advancedfm/advancedfm.h
index 5f6eabb..be574c4 100644
--- a/noncore/apps/advancedfm/advancedfm.h
+++ b/noncore/apps/advancedfm/advancedfm.h
@@ -156,3 +156,5 @@ protected slots:
156 void fileBeamFinished( Ir *); 156 void fileBeamFinished( Ir *);
157 157 bool copyDirectory( const QString & , const QString & );
158// void navigateToSelected();
159 bool moveDirectory( const QString & , const QString & );
158// void slotSwitchtoLocal(int); 160// void slotSwitchtoLocal(int);
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index c0be948..90c887f 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -70,4 +70,4 @@ void AdvancedFm::showMenuHidden() {
70 } 70 }
71 rePopulate();
72 b = !b; 71 b = !b;
72 populateView();
73} 73}
@@ -82,3 +82,3 @@ void AdvancedFm::showHidden() {
82 } 82 }
83 rePopulate(); 83 populateView();
84} 84}
@@ -341,4 +341,4 @@ void AdvancedFm::copy() {
341 } 341 }
342 rePopulate();
343 setOtherTabCurrent(); 342 setOtherTabCurrent();
343 rePopulate();
344 } 344 }
@@ -440,3 +440,3 @@ void AdvancedFm::copySameDir() {
440 } 440 }
441 populateView(); 441 rePopulate();
442} 442}
@@ -467,2 +467,8 @@ void AdvancedFm::move() {
467 467
468 if(QFileInfo(curFile).isDir()) {
469 moveDirectory( curFile, destFile );
470 rePopulate();
471 return;
472 }
473
468 QFile f( curFile); 474 QFile f( curFile);
@@ -482,3 +488,45 @@ void AdvancedFm::move() {
482 488
489bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) {
490 int err = 0;
491 if( copyDirectory( src, dest ) ) { QString cmd = "rm -rf " + src;
492 err = system((const char*)cmd);
493 } else
494 err = -1;
495
496 if(err!=0) {
497 QMessageBox::message(tr("Note"),tr("Could not move\n") + src);
498 return false;
499 }
500 return true;
501}
502
503bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) {
504
505 QStringcmd = "/bin/cp -fpR " + src + " " + dest;
506 qWarning(cmd);
507 interr = system( (const char *) cmd );
508 if ( err != 0 ) {
509 QMessageBox::message("AdvancedFm",
510 tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) );
511 return false;
512 }
513
514 return true;
515}
516
517
483bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { 518bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
519
520
521 if(QFileInfo(src).isDir()) {
522 if( copyDirectory( src, dest )) {
523 setOtherTabCurrent();
524 populateView();
525 return true;
526 }
527 else
528 return false;
529 }
530
531
484 bool success = true; 532 bool success = true;
@@ -689,3 +737,3 @@ void AdvancedFm::startProcess(const QString & cmd) {
689void AdvancedFm::processEnded(OProcess *) { 737void AdvancedFm::processEnded(OProcess *) {
690 populateView(); 738 rePopulate();
691} 739}
@@ -777,3 +825,3 @@ void AdvancedFm::renameIt() {
777 doRename( thisView ); 825 doRename( thisView );
778 populateView(); 826 rePopulate();
779} 827}
@@ -796,3 +844,3 @@ void AdvancedFm::okRename() {
796 delete view->currentItem(); 844 delete view->currentItem();
797 populateView(); 845 rePopulate();
798} 846}