author | cniehaus <cniehaus> | 2003-05-02 21:05:17 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2003-05-02 21:05:17 (UTC) |
commit | eb2cf58480b21ab24166a1fda83f24cf61e010d0 (patch) (unidiff) | |
tree | c0cd7c442a11bea0a6ceb5fdba7670351870269b | |
parent | 3eb477c27f32b8fa7900ddd5efceeacf6df87d25 (diff) | |
download | opie-eb2cf58480b21ab24166a1fda83f24cf61e010d0.zip opie-eb2cf58480b21ab24166a1fda83f24cf61e010d0.tar.gz opie-eb2cf58480b21ab24166a1fda83f24cf61e010d0.tar.bz2 |
tr()-fix -- don't use 2 !. One is enough
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 66353bb..d4351b0 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -730,98 +730,98 @@ void AdvancedFm::dirMenuSelected(int item) | |||
730 | } | 730 | } |
731 | break; | 731 | break; |
732 | 732 | ||
733 | }; | 733 | }; |
734 | } | 734 | } |
735 | 735 | ||
736 | void AdvancedFm::addCustomDir() | 736 | void AdvancedFm::addCustomDir() |
737 | { | 737 | { |
738 | Config cfg("AdvancedFm"); | 738 | Config cfg("AdvancedFm"); |
739 | cfg.setGroup("Menu"); | 739 | cfg.setGroup("Menu"); |
740 | QString dir; | 740 | QString dir; |
741 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); | 741 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); |
742 | 742 | ||
743 | dir = CurrentDir()->canonicalPath(); | 743 | dir = CurrentDir()->canonicalPath(); |
744 | 744 | ||
745 | bool addIt=true; | 745 | bool addIt=true; |
746 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 746 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
747 | { | 747 | { |
748 | if( dir == (*it)) | 748 | if( dir == (*it)) |
749 | { | 749 | { |
750 | addIt=false; | 750 | addIt=false; |
751 | } | 751 | } |
752 | } | 752 | } |
753 | if(addIt) | 753 | if(addIt) |
754 | { | 754 | { |
755 | menuButton->insertItem(dir); | 755 | menuButton->insertItem(dir); |
756 | // customDirMenu->insertItem(dir); | 756 | // customDirMenu->insertItem(dir); |
757 | list << dir; | 757 | list << dir; |
758 | } | 758 | } |
759 | 759 | ||
760 | cfg.writeEntry("CustomDir", list, ','); | 760 | cfg.writeEntry("CustomDir", list, ','); |
761 | cfg.write(); | 761 | cfg.write(); |
762 | } | 762 | } |
763 | 763 | ||
764 | void AdvancedFm::removeCustomDir() | 764 | void AdvancedFm::removeCustomDir() |
765 | { | 765 | { |
766 | // qDebug("remove custom dir"); | 766 | // qDebug("remove custom dir"); |
767 | Config cfg("AdvancedFm"); | 767 | Config cfg("AdvancedFm"); |
768 | cfg.setGroup("Menu"); | 768 | cfg.setGroup("Menu"); |
769 | QString dir; | 769 | QString dir; |
770 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); | 770 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); |
771 | QStringList list2; | 771 | QStringList list2; |
772 | dir = CurrentDir()->canonicalPath(); | 772 | dir = CurrentDir()->canonicalPath(); |
773 | int ramble=2; | 773 | int ramble=2; |
774 | // int ramble=-24; | 774 | // int ramble=-24; |
775 | //first remove list | 775 | //first remove list |
776 | if(list.grep(dir,true).isEmpty()) | 776 | if(list.grep(dir,true).isEmpty()) |
777 | { | 777 | { |
778 | QMessageBox::message("AdvancedFm", | 778 | QMessageBox::message(tr( "AdvancedFm" ), |
779 | tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!!")); | 779 | tr("Cannot remove current directory\nfrom bookmarks.\nIt is not bookmarked!")); |
780 | } | 780 | } |
781 | else | 781 | else |
782 | { | 782 | { |
783 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) | 783 | for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) |
784 | { | 784 | { |
785 | if((*it) != dir)//current item is not our current dir, so add it to temp list | 785 | if((*it) != dir)//current item is not our current dir, so add it to temp list |
786 | { | 786 | { |
787 | list2 <<(*it); | 787 | list2 <<(*it); |
788 | } | 788 | } |
789 | else | 789 | else |
790 | { | 790 | { |
791 | // customDirMenu->removeItem( ramble); | 791 | // customDirMenu->removeItem( ramble); |
792 | menuButton->remove( ramble); | 792 | menuButton->remove( ramble); |
793 | 793 | ||
794 | } | 794 | } |
795 | ramble++; | 795 | ramble++; |
796 | // ramble--; | 796 | // ramble--; |
797 | } | 797 | } |
798 | 798 | ||
799 | cfg.writeEntry("CustomDir", list2, ','); | 799 | cfg.writeEntry("CustomDir", list2, ','); |
800 | cfg.write(); | 800 | cfg.write(); |
801 | } | 801 | } |
802 | // customDirsToMenu(); | 802 | // customDirsToMenu(); |
803 | 803 | ||
804 | } | 804 | } |
805 | 805 | ||
806 | void AdvancedFm::gotoCustomDir(const QString &dir) | 806 | void AdvancedFm::gotoCustomDir(const QString &dir) |
807 | { | 807 | { |
808 | // qDebug("gotoCustomDir(const QString &dir) " +dir ); | 808 | // qDebug("gotoCustomDir(const QString &dir) " +dir ); |
809 | QString curDir = dir; | 809 | QString curDir = dir; |
810 | QDir *thisDir = CurrentDir(); | 810 | QDir *thisDir = CurrentDir(); |
811 | // if( curDir.isEmpty()) { | 811 | // if( curDir.isEmpty()) { |
812 | // } | 812 | // } |
813 | if( curDir == s_addBookmark) | 813 | if( curDir == s_addBookmark) |
814 | { | 814 | { |
815 | addCustomDir(); | 815 | addCustomDir(); |
816 | } | 816 | } |
817 | if( curDir == s_removeBookmark) | 817 | if( curDir == s_removeBookmark) |
818 | { | 818 | { |
819 | removeCustomDir( ); | 819 | removeCustomDir( ); |
820 | } | 820 | } |
821 | else | 821 | else |
822 | { | 822 | { |
823 | if(QDir( curDir).exists() ) | 823 | if(QDir( curDir).exists() ) |
824 | { | 824 | { |
825 | thisDir->setPath( curDir ); | 825 | thisDir->setPath( curDir ); |
826 | chdir( curDir.latin1() ); | 826 | chdir( curDir.latin1() ); |
827 | thisDir->cd( curDir, TRUE); | 827 | thisDir->cd( curDir, TRUE); |