Diffstat (limited to 'noncore/apps/advancedfm/advancedfmMenu.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 5a46579..2e6b0da 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -42,13 +42,13 @@ void AdvancedFm::doDirChange() { | |||
42 | if( pathItem == "../") { | 42 | if( pathItem == "../") { |
43 | ListClicked( CurrentView()->currentItem()); | 43 | ListClicked( CurrentView()->currentItem()); |
44 | } else { | 44 | } else { |
45 | if( pathItem.find(" -> ",0,TRUE) != -1) | 45 | if( pathItem.find(" -> ",0,TRUE) != -1) |
46 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; | 46 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; |
47 | // owarn << pathItem << oendl; | 47 | // owarn << pathItem << oendl; |
48 | gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); | 48 | changeTo( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | void AdvancedFm::showMenuHidden() { | 52 | void AdvancedFm::showMenuHidden() { |
53 | if (b) { | 53 | if (b) { |
54 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 54 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
@@ -738,12 +738,13 @@ void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { | |||
738 | QString lineStr = buffer; | 738 | QString lineStr = buffer; |
739 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | 739 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); |
740 | } | 740 | } |
741 | 741 | ||
742 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | 742 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { |
743 | if ( o->inherits( "QLineEdit" ) ) { | 743 | if ( o->inherits( "QLineEdit" ) ) { |
744 | qDebug("QLineEdit event"); | ||
744 | if ( e->type() == QEvent::KeyPress ) { | 745 | if ( e->type() == QEvent::KeyPress ) { |
745 | QKeyEvent *ke = (QKeyEvent*)e; | 746 | QKeyEvent *ke = (QKeyEvent*)e; |
746 | if ( ke->key() == Key_Return || | 747 | if ( ke->key() == Key_Return || |
747 | ke->key() == Key_Enter ) { | 748 | ke->key() == Key_Enter ) { |
748 | okRename(); | 749 | okRename(); |
749 | return true; | 750 | return true; |
@@ -755,25 +756,25 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | |||
755 | } | 756 | } |
756 | else if ( e->type() == QEvent::FocusOut ) { | 757 | else if ( e->type() == QEvent::FocusOut ) { |
757 | cancelRename(); | 758 | cancelRename(); |
758 | return true; | 759 | return true; |
759 | } | 760 | } |
760 | } | 761 | } |
761 | if ( o->inherits( "QListView" ) ) { | 762 | /* if ( o->inherits( "QListView" ) ) { |
762 | if ( e->type() == QEvent::FocusIn ) { | 763 | if ( e->type() == QEvent::FocusIn ) { |
763 | // if( o == Local_View) { //keep track of which view | 764 | // if( o == Local_View) { //keep track of which view |
764 | // qDebug("local view"); | 765 | // qDebug("local view"); |
765 | // whichTab = 1; | 766 | // whichTab = 1; |
766 | // } else { | 767 | // } else { |
767 | // whichTab = 2; | 768 | // whichTab = 2; |
768 | // qDebug("remote view"); | 769 | // qDebug("remote view"); |
769 | // } | 770 | // } |
770 | } | 771 | } |
771 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection | 772 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection |
772 | } | 773 | } |
773 | 774 | */ | |
774 | return QWidget::eventFilter( o, e ); | 775 | return QWidget::eventFilter( o, e ); |
775 | } | 776 | } |
776 | 777 | ||
777 | 778 | ||
778 | void AdvancedFm::cancelRename() { | 779 | void AdvancedFm::cancelRename() { |
779 | // odebug << "cancel rename" << oendl; | 780 | // odebug << "cancel rename" << oendl; |
@@ -817,12 +818,13 @@ void AdvancedFm::renameIt() { | |||
817 | QListView *thisView = CurrentView(); | 818 | QListView *thisView = CurrentView(); |
818 | oldName = thisView->currentItem()->text(0); | 819 | oldName = thisView->currentItem()->text(0); |
819 | doRename( thisView ); | 820 | doRename( thisView ); |
820 | } | 821 | } |
821 | 822 | ||
822 | void AdvancedFm::okRename() { | 823 | void AdvancedFm::okRename() { |
824 | qDebug("okrename"); | ||
823 | if( !renameBox) return; | 825 | if( !renameBox) return; |
824 | 826 | ||
825 | QString newName = renameBox->text(); | 827 | QString newName = renameBox->text(); |
826 | cancelRename(); | 828 | cancelRename(); |
827 | QListView * view = CurrentView(); | 829 | QListView * view = CurrentView(); |
828 | QString path = CurrentDir()->canonicalPath() + "/"; | 830 | QString path = CurrentDir()->canonicalPath() + "/"; |