summaryrefslogtreecommitdiff
path: root/noncore/apps/advancedfm/advancedfmMenu.cpp
authorllornkcor <llornkcor>2003-02-24 02:38:01 (UTC)
committer llornkcor <llornkcor>2003-02-24 02:38:01 (UTC)
commite144592570ddacf26d27f3e2759dbe7f2370d0a0 (patch) (unidiff)
tree054221a40b03bd91945161570a8996a5427e6456 /noncore/apps/advancedfm/advancedfmMenu.cpp
parent56b89312a374b62ee20f6ad2b62b6426183d4d26 (diff)
downloadopie-e144592570ddacf26d27f3e2759dbe7f2370d0a0.zip
opie-e144592570ddacf26d27f3e2759dbe7f2370d0a0.tar.gz
opie-e144592570ddacf26d27f3e2759dbe7f2370d0a0.tar.bz2
cleanup
Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp102
1 files changed, 41 insertions, 61 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 13dad33..c553017 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -68,8 +68,8 @@ void AdvancedFm::showMenuHidden()
68 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 68 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
69// b=TRUE; 69// b=TRUE;
70 } 70 }
71 populateLocalView(); 71 populateView();
72 populateRemoteView(); 72// populateRemoteView();
73// if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); 73// if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true");
74 if(b) b = false; else b = true; 74 if(b) b = false; else b = true;
75} 75}
@@ -89,7 +89,7 @@ void AdvancedFm::showHidden()
89// fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 89// fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
90// b=TRUE; 90// b=TRUE;
91 } 91 }
92 PopulateView(); 92 populateView();
93} 93}
94 94
95QString AdvancedFm::dealWithSymName(const QString &fileName) 95QString AdvancedFm::dealWithSymName(const QString &fileName)
@@ -165,7 +165,7 @@ void AdvancedFm::makeDir()
165 QString filename = fileDlg->LineEdit1->text(); 165 QString filename = fileDlg->LineEdit1->text();
166 thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); 166 thisDir->mkdir( thisDir->canonicalPath()+"/"+filename);
167 } 167 }
168 PopulateView(); 168 populateView();
169} 169}
170 170
171void AdvancedFm::doDelete() 171void AdvancedFm::doDelete()
@@ -214,7 +214,7 @@ void AdvancedFm::doDelete()
214 f=f.left(f.length()-1); 214 f=f.left(f.length()-1);
215 QString cmd="rm -rf "+f; 215 QString cmd="rm -rf "+f;
216 startProcess( (const QString)cmd.latin1() ); 216 startProcess( (const QString)cmd.latin1() );
217 PopulateView(); 217 populateView();
218 } 218 }
219 break; 219 break;
220 case 1: 220 case 1:
@@ -238,7 +238,7 @@ void AdvancedFm::doDelete()
238 } 238 }
239 } 239 }
240 } 240 }
241 PopulateView(); 241 populateView();
242} 242}
243 243
244void AdvancedFm::filePerms() 244void AdvancedFm::filePerms()
@@ -257,7 +257,7 @@ void AdvancedFm::filePerms()
257 if( filePerm) 257 if( filePerm)
258 delete filePerm; 258 delete filePerm;
259 } 259 }
260 PopulateView(); 260 populateView();
261} 261}
262 262
263void AdvancedFm::doProperties() 263void AdvancedFm::doProperties()
@@ -293,7 +293,7 @@ void AdvancedFm::upDir()
293 chdir( current.latin1() ); 293 chdir( current.latin1() );
294 thisDir->cd( current, TRUE); 294 thisDir->cd( current, TRUE);
295 295
296 PopulateView(); 296 populateView();
297 update(); 297 update();
298} 298}
299 299
@@ -360,9 +360,8 @@ void AdvancedFm::copy()
360 return; 360 return;
361 } 361 }
362 } 362 }
363 363 setOtherTabCurrent();
364 PopulateView(); 364 populateView();
365 // TabWidget->setCurrentTab(1);
366 } 365 }
367} 366}
368 367
@@ -417,7 +416,8 @@ void AdvancedFm::copyAs()
417 delete fileDlg; 416 delete fileDlg;
418 417
419 } 418 }
420 PopulateView(); 419 setOtherTabCurrent();
420 populateView();
421} 421}
422 422
423void AdvancedFm::copySameDir() 423void AdvancedFm::copySameDir()
@@ -470,7 +470,7 @@ void AdvancedFm::copySameDir()
470 } 470 }
471 delete fileDlg; 471 delete fileDlg;
472 } 472 }
473 PopulateView(); 473 populateView();
474} 474}
475 475
476void AdvancedFm::move() 476void AdvancedFm::move()
@@ -512,8 +512,9 @@ void AdvancedFm::move()
512 } 512 }
513 513
514 } 514 }
515 populateRemoteView(); 515 setOtherTabCurrent();
516 populateLocalView(); 516 populateView();
517 // populateLocalView();
517} 518}
518 519
519bool AdvancedFm::copyFile( const QString & src, const QString & dest ) 520bool AdvancedFm::copyFile( const QString & src, const QString & dest )
@@ -643,52 +644,32 @@ void AdvancedFm::mkSym()
643 QStringList curFileList = getPath(); 644 QStringList curFileList = getPath();
644 if( curFileList.count() > 0) 645 if( curFileList.count() > 0)
645 { 646 {
646 if ( whichTab == 1) 647 QDir *thisDir = CurrentDir();
647 { 648 QDir * thatDir = OtherDir();
648 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it )
649 {
650 649
651 QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); 650 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it )
652 if(destName.right(1) == "/")
653 {
654 destName = destName.left( destName.length() -1);
655 }
656 QString curFile = currentDir.canonicalPath()+"/"+(*it);
657 if( curFile.right(1) == "/")
658 {
659 curFile = curFile.left( curFile.length() -1);
660 }
661 cmd = "ln -s "+curFile+" "+destName;
662 qDebug(cmd);
663 startProcess( (const QString)cmd );
664 }
665 populateRemoteView();
666 TabWidget->setCurrentTab(1);
667 }
668 else
669 { 651 {
670 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) 652
653 QString destName = thatDir->canonicalPath()+"/"+(*it);
654 if(destName.right(1) == "/")
671 { 655 {
656 destName = destName.left( destName.length() -1);
657 }
672 658
673 QString destName = currentDir.canonicalPath()+"/"+(*it); 659 QString curFile = thisDir->canonicalPath()+"/"+(*it);
674 if(destName.right(1) == "/")
675 {
676 destName = destName.left( destName.length() -1);
677 }
678 QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it);
679 if( curFile.right(1) == "/")
680 {
681 curFile = curFile.left( curFile.length() -1);
682 }
683 660
684 cmd = "ln -s "+curFile+" "+destName; 661 if( curFile.right(1) == "/")
685 qDebug(cmd); 662 {
686 startProcess( (const QString)cmd ); 663 curFile = curFile.left( curFile.length() -1);
687 } 664 }
688 populateLocalView(); 665
689 TabWidget->setCurrentTab(0); 666 cmd = "ln -s "+curFile+" "+destName;
690 } 667 qDebug(cmd);
691 } 668 startProcess( (const QString)cmd );
669 }
670 setOtherTabCurrent();
671 populateView();
672 }
692} 673}
693 674
694void AdvancedFm::doBeam() 675void AdvancedFm::doBeam()
@@ -699,7 +680,6 @@ void AdvancedFm::doBeam()
699 } 680 }
700 else 681 else
701 { 682 {
702
703 QStringList curFileList = getPath(); 683 QStringList curFileList = getPath();
704 if( curFileList.count() > 0) 684 if( curFileList.count() > 0)
705 { 685 {
@@ -755,8 +735,8 @@ void AdvancedFm::startProcess(const QString & cmd)
755 735
756void AdvancedFm::processEnded() 736void AdvancedFm::processEnded()
757{ 737{
758 populateLocalView(); 738// populateLocalView();
759 populateRemoteView(); 739 populateView();
760} 740}
761 741
762bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) 742bool AdvancedFm::eventFilter( QObject * o, QEvent * e )
@@ -843,7 +823,7 @@ void AdvancedFm::renameIt()
843 QListView *thisView = CurrentView(); 823 QListView *thisView = CurrentView();
844 oldName = thisView->currentItem()->text(0); 824 oldName = thisView->currentItem()->text(0);
845 doRename( thisView ); 825 doRename( thisView );
846 PopulateView(); 826 populateView();
847} 827}
848 828
849void AdvancedFm::okRename() 829void AdvancedFm::okRename()
@@ -865,5 +845,5 @@ void AdvancedFm::okRename()
865 845
866 view->takeItem( view->currentItem() ); 846 view->takeItem( view->currentItem() );
867 delete view->currentItem(); 847 delete view->currentItem();
868 PopulateView(); 848 populateView();
869} 849}