Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 102 |
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 @@ -67,10 +67,10 @@ void AdvancedFm::showMenuHidden() currentRemoteDir.setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); // b=TRUE; } - populateLocalView(); - populateRemoteView(); + populateView(); +// populateRemoteView(); // if(b) qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<< true"); if(b) b = false; else b = true; } @@ -88,9 +88,9 @@ void AdvancedFm::showHidden() CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); // fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); // b=TRUE; } - PopulateView(); + populateView(); } QString AdvancedFm::dealWithSymName(const QString &fileName) { @@ -164,9 +164,9 @@ void AdvancedFm::makeDir() QDir *thisDir = CurrentDir(); QString filename = fileDlg->LineEdit1->text(); thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); } - PopulateView(); + populateView(); } void AdvancedFm::doDelete() { @@ -213,9 +213,9 @@ void AdvancedFm::doDelete() { f=f.left(f.length()-1); QString cmd="rm -rf "+f; startProcess( (const QString)cmd.latin1() ); - PopulateView(); + populateView(); } break; case 1: // exit @@ -237,9 +237,9 @@ void AdvancedFm::doDelete() file.remove(); } } } - PopulateView(); + populateView(); } void AdvancedFm::filePerms() { @@ -256,9 +256,9 @@ void AdvancedFm::filePerms() filePerm->exec(); if( filePerm) delete filePerm; } - PopulateView(); + populateView(); } void AdvancedFm::doProperties() { @@ -292,9 +292,9 @@ void AdvancedFm::upDir() current = dir.canonicalPath(); chdir( current.latin1() ); thisDir->cd( current, TRUE); - PopulateView(); + populateView(); update(); } void AdvancedFm::copy() @@ -359,11 +359,10 @@ void AdvancedFm::copy() tr( "Could not copy %1 to %2").arg( curFile ).arg( destFile ) ); return; } } - - PopulateView(); -// TabWidget->setCurrentTab(1); + setOtherTabCurrent(); + populateView(); } } void AdvancedFm::copyAs() @@ -416,9 +415,10 @@ void AdvancedFm::copyAs() } delete fileDlg; } - PopulateView(); + setOtherTabCurrent(); + populateView(); } void AdvancedFm::copySameDir() { @@ -469,9 +469,9 @@ void AdvancedFm::copySameDir() qDebug("copy "+curFile+" as "+destFile); } delete fileDlg; } - PopulateView(); + populateView(); } void AdvancedFm::move() { @@ -511,10 +511,11 @@ void AdvancedFm::move() } } } - populateRemoteView(); - populateLocalView(); + setOtherTabCurrent(); + populateView(); +// populateLocalView(); } bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { @@ -642,54 +643,34 @@ void AdvancedFm::mkSym() QString cmd; QStringList curFileList = getPath(); if( curFileList.count() > 0) { - if ( whichTab == 1) - { - for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) - { + QDir *thisDir = CurrentDir(); + QDir * thatDir = OtherDir(); - QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); - if(destName.right(1) == "/") - { - destName = destName.left( destName.length() -1); - } - QString curFile = currentDir.canonicalPath()+"/"+(*it); - if( curFile.right(1) == "/") - { - curFile = curFile.left( curFile.length() -1); - } - cmd = "ln -s "+curFile+" "+destName; - qDebug(cmd); - startProcess( (const QString)cmd ); - } - populateRemoteView(); - TabWidget->setCurrentTab(1); - } - else + for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { - 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 destName = currentDir.canonicalPath()+"/"+(*it); - if(destName.right(1) == "/") - { - destName = destName.left( destName.length() -1); - } - QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); - if( curFile.right(1) == "/") - { - curFile = curFile.left( curFile.length() -1); - } + QString curFile = thisDir->canonicalPath()+"/"+(*it); - cmd = "ln -s "+curFile+" "+destName; - qDebug(cmd); - startProcess( (const QString)cmd ); - } - populateLocalView(); - TabWidget->setCurrentTab(0); - } - } + if( curFile.right(1) == "/") + { + curFile = curFile.left( curFile.length() -1); + } + + cmd = "ln -s "+curFile+" "+destName; + qDebug(cmd); + startProcess( (const QString)cmd ); + } + setOtherTabCurrent(); + populateView(); + } } void AdvancedFm::doBeam() { @@ -698,9 +679,8 @@ void AdvancedFm::doBeam() { } else { - QStringList curFileList = getPath(); if( curFileList.count() > 0) { for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) @@ -754,10 +734,10 @@ void AdvancedFm::startProcess(const QString & cmd) } void AdvancedFm::processEnded() { - populateLocalView(); - populateRemoteView(); +// populateLocalView(); + populateView(); } bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { @@ -842,9 +822,9 @@ void AdvancedFm::renameIt() { QListView *thisView = CurrentView(); oldName = thisView->currentItem()->text(0); doRename( thisView ); - PopulateView(); + populateView(); } void AdvancedFm::okRename() { @@ -864,6 +844,6 @@ void AdvancedFm::okRename() oldName = ""; view->takeItem( view->currentItem() ); delete view->currentItem(); - PopulateView(); + populateView(); } |