author | zecke <zecke> | 2004-03-25 20:13:01 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-25 20:13:01 (UTC) |
commit | 1db459f8a2e3846397bef77bd0f47b70a0e01612 (patch) (unidiff) | |
tree | 4fc77e5b0f6f9cb77adee3e816e9c057c1c6264c | |
parent | 875064bec847768670d33cddf8553ce89ef4a5d5 (diff) | |
download | opie-1db459f8a2e3846397bef77bd0f47b70a0e01612.zip opie-1db459f8a2e3846397bef77bd0f47b70a0e01612.tar.gz opie-1db459f8a2e3846397bef77bd0f47b70a0e01612.tar.bz2 |
Do not rely on Qt magic.
Get the item, take it from the list, delete it
-rw-r--r-- | noncore/apps/advancedfm/advancedfmMenu.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 2461e26..81a4318 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -799,40 +799,41 @@ void AdvancedFm::doRename(QListView * view) { | |||
799 | view->addChild( renameBox, r.x(), r.y() ); | 799 | view->addChild( renameBox, r.x(), r.y() ); |
800 | 800 | ||
801 | renameBox->resize( r.size() ); | 801 | renameBox->resize( r.size() ); |
802 | 802 | ||
803 | view->viewport()->setFocusProxy( renameBox ); | 803 | view->viewport()->setFocusProxy( renameBox ); |
804 | 804 | ||
805 | renameBox->setFocus(); | 805 | renameBox->setFocus(); |
806 | renameBox->show(); | 806 | renameBox->show(); |
807 | } | 807 | } |
808 | 808 | ||
809 | 809 | ||
810 | void AdvancedFm::renameIt() { | 810 | void AdvancedFm::renameIt() { |
811 | if( !CurrentView()->currentItem()) return; | 811 | if( !CurrentView()->currentItem()) return; |
812 | 812 | ||
813 | QListView *thisView = CurrentView(); | 813 | QListView *thisView = CurrentView(); |
814 | oldName = thisView->currentItem()->text(0); | 814 | oldName = thisView->currentItem()->text(0); |
815 | doRename( thisView ); | 815 | doRename( thisView ); |
816 | } | 816 | } |
817 | 817 | ||
818 | void AdvancedFm::okRename() { | 818 | void AdvancedFm::okRename() { |
819 | if( !renameBox) return; | 819 | if( !renameBox) return; |
820 | 820 | ||
821 | QString newName = renameBox->text(); | 821 | QString newName = renameBox->text(); |
822 | cancelRename(); | 822 | cancelRename(); |
823 | QListView * view = CurrentView(); | 823 | QListView * view = CurrentView(); |
824 | QString path = CurrentDir()->canonicalPath() + "/"; | 824 | QString path = CurrentDir()->canonicalPath() + "/"; |
825 | oldName = path + oldName; | 825 | oldName = path + oldName; |
826 | newName = path + newName; | 826 | newName = path + newName; |
827 | if( rename( oldName.latin1(), newName.latin1())== -1) | 827 | if( rename( oldName.latin1(), newName.latin1())== -1) |
828 | QMessageBox::message(tr("Note"),tr("Could not rename")); | 828 | QMessageBox::message(tr("Note"),tr("Could not rename")); |
829 | else | 829 | else |
830 | oldName = ""; | 830 | oldName = ""; |
831 | view->takeItem( view->currentItem() ); | 831 | QListViewItem *item = view->currentItem(); |
832 | delete view->currentItem(); | 832 | view->takeItem( item ); |
833 | delete item; | ||
833 | rePopulate(); | 834 | rePopulate(); |
834 | } | 835 | } |
835 | 836 | ||
836 | void AdvancedFm::openSearch() { | 837 | void AdvancedFm::openSearch() { |
837 | QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); | 838 | QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); |
838 | } | 839 | } |