-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index f4ca349..b9e254e 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -534,9 +534,12 @@ void AdvancedFm::localListClicked(QListViewItem *selectedItem) | |||
534 | } | 534 | } |
535 | } else { | 535 | } else { |
536 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); | 536 | strItem=QDir::cleanDirPath(currentDir.canonicalPath()+"/"+strItem); |
537 | if( QFile::exists(strItem ) ) { | 537 | if( QFile::exists(strItem ) ) { |
538 | // qDebug("upload "+strItem); | 538 | qDebug("clicked item "+strItem); |
539 | DocLnk doc( strItem, FALSE ); | ||
540 | doc.execute(); | ||
541 | // Local_View->clearSelection(); | ||
539 | } | 542 | } |
540 | } //end not symlink | 543 | } //end not symlink |
541 | chdir(strItem.latin1()); | 544 | chdir(strItem.latin1()); |
542 | } | 545 | } |
@@ -572,9 +575,12 @@ void AdvancedFm::remoteListClicked(QListViewItem *selectedItem) | |||
572 | } | 575 | } |
573 | } else { | 576 | } else { |
574 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); | 577 | strItem=QDir::cleanDirPath( currentRemoteDir.canonicalPath()+"/"+strItem); |
575 | if( QFile::exists(strItem ) ) { | 578 | if( QFile::exists(strItem ) ) { |
576 | // qDebug("upload "+strItem); | 579 | qDebug("clicked item "+strItem); |
580 | DocLnk doc( strItem, FALSE ); | ||
581 | doc.execute(); | ||
582 | // Remote_View->clearSelection(); | ||
577 | } | 583 | } |
578 | } //end not symlink | 584 | } //end not symlink |
579 | chdir(strItem.latin1()); | 585 | chdir(strItem.latin1()); |
580 | } | 586 | } |
@@ -660,9 +666,9 @@ void AdvancedFm::showLocalMenu(QListViewItem * item) | |||
660 | m.insertSeparator(); | 666 | m.insertSeparator(); |
661 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) | 667 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) |
662 | m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); | 668 | m.insertItem( tr( "Change Directory" ), this, SLOT( doLocalCd() )); |
663 | else | 669 | else |
664 | m.insertItem( tr( "Open" ), this, SLOT( runThis() )); | 670 | m.insertItem( tr( "Open / Execute" ), this, SLOT( runThis() )); |
665 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); | 671 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); |
666 | m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); | 672 | m.insertItem( tr( "Make Directory" ), this, SLOT( localMakDir() )); |
667 | m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 673 | m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
668 | m.insertSeparator(); | 674 | m.insertSeparator(); |
@@ -696,9 +702,9 @@ void AdvancedFm::showRemoteMenu(QListViewItem * item) | |||
696 | m.insertSeparator(); | 702 | m.insertSeparator(); |
697 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) | 703 | if( /*item->text(0).right(1) == "/" ||*/ item->text(0).find("/",0,TRUE) !=-1) |
698 | m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); | 704 | m.insertItem( tr( "Change Directory" ), this, SLOT( doRemoteCd() )); |
699 | else | 705 | else |
700 | m.insertItem( tr( "Open" ), this, SLOT( runThis() )); | 706 | m.insertItem( tr( "Open / Execute" ), this, SLOT( runThis() )); |
701 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); | 707 | m.insertItem( tr( "Open as Text" ), this, SLOT( runText() )); |
702 | m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); | 708 | m.insertItem( tr( "Make Directory" ), this, SLOT( remoteMakDir() )); |
703 | m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 709 | m.insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
704 | m.insertSeparator(); | 710 | m.insertSeparator(); |
@@ -1036,8 +1042,15 @@ void AdvancedFm::filePerms() { | |||
1036 | filePerm->exec(); | 1042 | filePerm->exec(); |
1037 | if( filePerm) | 1043 | if( filePerm) |
1038 | delete filePerm; | 1044 | delete filePerm; |
1039 | } | 1045 | } |
1046 | if (TabWidget->currentPageIndex() == 0) { | ||
1047 | populateLocalView(); | ||
1048 | } else { | ||
1049 | populateRemoteView(); | ||
1050 | } | ||
1051 | |||
1052 | |||
1040 | } | 1053 | } |
1041 | 1054 | ||
1042 | void AdvancedFm::doProperties() { | 1055 | void AdvancedFm::doProperties() { |
1043 | QStringList curFileList = getPath(); | 1056 | QStringList curFileList = getPath(); |
@@ -1401,12 +1414,12 @@ void AdvancedFm::runCommand() { | |||
1401 | void AdvancedFm::runCommandStd() { | 1414 | void AdvancedFm::runCommandStd() { |
1402 | QString curFile; | 1415 | QString curFile; |
1403 | if (TabWidget->currentPageIndex() == 0) { | 1416 | if (TabWidget->currentPageIndex() == 0) { |
1404 | if( Local_View->currentItem()) | 1417 | if( Local_View->currentItem()) |
1405 | curFile = currentDir.canonicalPath() + Local_View->currentItem()->text(0); | 1418 | curFile = currentDir.canonicalPath() +"/"+ Local_View->currentItem()->text(0); |
1406 | } else { | 1419 | } else { |
1407 | if(Remote_View->currentItem()) | 1420 | if(Remote_View->currentItem()) |
1408 | curFile = currentRemoteDir.canonicalPath() + Remote_View->currentItem()->text(0); | 1421 | curFile = currentRemoteDir.canonicalPath() +"/"+ Remote_View->currentItem()->text(0); |
1409 | } | 1422 | } |
1410 | 1423 | ||
1411 | InputDialog *fileDlg; | 1424 | InputDialog *fileDlg; |
1412 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 1425 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
@@ -1555,9 +1568,11 @@ void AdvancedFm::mkSym() { | |||
1555 | if (TabWidget->currentPageIndex() == 0) { | 1568 | if (TabWidget->currentPageIndex() == 0) { |
1556 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 1569 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
1557 | 1570 | ||
1558 | QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); | 1571 | QString destName = currentRemoteDir.canonicalPath()+"/"+(*it); |
1572 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); | ||
1559 | QString curFile = currentDir.canonicalPath()+"/"+(*it); | 1573 | QString curFile = currentDir.canonicalPath()+"/"+(*it); |
1574 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); | ||
1560 | cmd = "ln -s "+curFile+" "+destName; | 1575 | cmd = "ln -s "+curFile+" "+destName; |
1561 | qDebug(cmd); | 1576 | qDebug(cmd); |
1562 | system(cmd.latin1() ); | 1577 | system(cmd.latin1() ); |
1563 | } | 1578 | } |
@@ -1566,9 +1581,11 @@ void AdvancedFm::mkSym() { | |||
1566 | } else { | 1581 | } else { |
1567 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 1582 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
1568 | 1583 | ||
1569 | QString destName = currentDir.canonicalPath()+"/"+(*it); | 1584 | QString destName = currentDir.canonicalPath()+"/"+(*it); |
1585 | if(destName.right(1) == "/") destName = destName.left( destName.length() -1); | ||
1570 | QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); | 1586 | QString curFile = currentRemoteDir.canonicalPath()+"/"+(*it); |
1587 | if( curFile.right(1) == "/") curFile = curFile.left( curFile.length() -1); | ||
1571 | 1588 | ||
1572 | cmd = "ln -s "+curFile+" "+destName; | 1589 | cmd = "ln -s "+curFile+" "+destName; |
1573 | qDebug(cmd); | 1590 | qDebug(cmd); |
1574 | system(cmd.latin1() ); | 1591 | system(cmd.latin1() ); |