-rw-r--r-- | noncore/apps/zsafe/zsafe.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index e86b3d2..9341425 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -2789,48 +2789,50 @@ void ZSafe::delCategory() | |||
2789 | 2789 | ||
2790 | } | 2790 | } |
2791 | } | 2791 | } |
2792 | 2792 | ||
2793 | void ZSafe::setCategoryDialogFields(CategoryDialog *dialog) | 2793 | void ZSafe::setCategoryDialogFields(CategoryDialog *dialog) |
2794 | { | 2794 | { |
2795 | if (!dialog) | 2795 | if (!dialog) |
2796 | return; | 2796 | return; |
2797 | 2797 | ||
2798 | QString icon; | 2798 | QString icon; |
2799 | if (selectedItem) | 2799 | if (selectedItem) |
2800 | { | 2800 | { |
2801 | dialog->Field1->setText(getFieldLabel (selectedItem, "1", tr("Name"))); | 2801 | dialog->Field1->setText(getFieldLabel (selectedItem, "1", tr("Name"))); |
2802 | dialog->Field2->setText(getFieldLabel (selectedItem, "2", tr("Username"))); | 2802 | dialog->Field2->setText(getFieldLabel (selectedItem, "2", tr("Username"))); |
2803 | dialog->Field3->setText(getFieldLabel (selectedItem, "3", tr("Password"))); | 2803 | dialog->Field3->setText(getFieldLabel (selectedItem, "3", tr("Password"))); |
2804 | dialog->Field4->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); | 2804 | dialog->Field4->setText(getFieldLabel (selectedItem, "4", tr("Comment"))); |
2805 | dialog->Field5->setText(getFieldLabel (selectedItem, "5", tr("Field 4"))); | 2805 | dialog->Field5->setText(getFieldLabel (selectedItem, "5", tr("Field 4"))); |
2806 | dialog->Field6->setText(getFieldLabel (selectedItem, "6", tr("Field 5"))); | 2806 | dialog->Field6->setText(getFieldLabel (selectedItem, "6", tr("Field 5"))); |
2807 | 2807 | ||
2808 | Category *cat= categories.find (selectedItem->text(0)); | 2808 | Category *cat= categories.find (selectedItem->text(0)); |
2809 | if (cat) | 2809 | if (cat) |
2810 | { | 2810 | { |
2811 | icon = cat->getIconName(); | 2811 | icon = cat->getIconName(); |
2812 | } | 2812 | } |
2813 | else | ||
2814 | icon = conf->readEntry(APP_KEY+selectedItem->text(0)); | ||
2813 | } | 2815 | } |
2814 | else | 2816 | else |
2815 | { | 2817 | { |
2816 | dialog->Field1->setText(tr("Name")); | 2818 | dialog->Field1->setText(tr("Name")); |
2817 | dialog->Field2->setText(tr("Username")); | 2819 | dialog->Field2->setText(tr("Username")); |
2818 | dialog->Field3->setText(tr("Password")); | 2820 | dialog->Field3->setText(tr("Password")); |
2819 | dialog->Field4->setText(tr("Comment")); | 2821 | dialog->Field4->setText(tr("Comment")); |
2820 | dialog->Field5->setText(tr("Field 4")); | 2822 | dialog->Field5->setText(tr("Field 4")); |
2821 | dialog->Field6->setText(tr("Field 5")); | 2823 | dialog->Field6->setText(tr("Field 5")); |
2822 | } | 2824 | } |
2823 | 2825 | ||
2824 | #ifdef DESKTOP | 2826 | #ifdef DESKTOP |
2825 | QDir d(iconPath); | 2827 | QDir d(iconPath); |
2826 | #else | 2828 | #else |
2827 | QDir d(QPEApplication::qpeDir() + "/pics/"); | 2829 | QDir d(QPEApplication::qpeDir() + "/pics/"); |
2828 | #endif | 2830 | #endif |
2829 | d.setFilter( QDir::Files); | 2831 | d.setFilter( QDir::Files); |
2830 | 2832 | ||
2831 | const QFileInfoList *list = d.entryInfoList(); | 2833 | const QFileInfoList *list = d.entryInfoList(); |
2832 | int i=0; | 2834 | int i=0; |
2833 | QFileInfoListIterator it( *list ); // create list iterator | 2835 | QFileInfoListIterator it( *list ); // create list iterator |
2834 | QFileInfo *fi; // pointer for traversing | 2836 | QFileInfo *fi; // pointer for traversing |
2835 | if (icon.isEmpty() || icon.isNull()) | 2837 | if (icon.isEmpty() || icon.isNull()) |
2836 | { | 2838 | { |
@@ -2854,48 +2856,50 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog) | |||
2854 | } | 2856 | } |
2855 | ++it; | 2857 | ++it; |
2856 | } | 2858 | } |
2857 | } | 2859 | } |
2858 | } | 2860 | } |
2859 | 2861 | ||
2860 | void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category) | 2862 | void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category) |
2861 | { | 2863 | { |
2862 | if (!dialog) | 2864 | if (!dialog) |
2863 | return; | 2865 | return; |
2864 | 2866 | ||
2865 | dialog->Field1->setText(getFieldLabel (category, "1", tr("Name"))); | 2867 | dialog->Field1->setText(getFieldLabel (category, "1", tr("Name"))); |
2866 | dialog->Field2->setText(getFieldLabel (category, "2", tr("Username"))); | 2868 | dialog->Field2->setText(getFieldLabel (category, "2", tr("Username"))); |
2867 | dialog->Field3->setText(getFieldLabel (category, "3", tr("Password"))); | 2869 | dialog->Field3->setText(getFieldLabel (category, "3", tr("Password"))); |
2868 | dialog->Field4->setText(getFieldLabel (category, "4", tr("Comment"))); | 2870 | dialog->Field4->setText(getFieldLabel (category, "4", tr("Comment"))); |
2869 | dialog->Field5->setText(getFieldLabel (category, "5", tr("Field 4"))); | 2871 | dialog->Field5->setText(getFieldLabel (category, "5", tr("Field 4"))); |
2870 | dialog->Field6->setText(getFieldLabel (category, "6", tr("Field 5"))); | 2872 | dialog->Field6->setText(getFieldLabel (category, "6", tr("Field 5"))); |
2871 | 2873 | ||
2872 | QString icon; | 2874 | QString icon; |
2873 | Category *cat= categories.find (category); | 2875 | Category *cat= categories.find (category); |
2874 | if (cat) | 2876 | if (cat) |
2875 | { | 2877 | { |
2876 | icon = cat->getIconName(); | 2878 | icon = cat->getIconName(); |
2877 | } | 2879 | } |
2880 | else | ||
2881 | icon = conf->readEntry(APP_KEY+category); | ||
2878 | 2882 | ||
2879 | #ifdef DESKTOP | 2883 | #ifdef DESKTOP |
2880 | QDir d(iconPath); | 2884 | QDir d(iconPath); |
2881 | #else | 2885 | #else |
2882 | QDir d(QPEApplication::qpeDir() + "/pics/"); | 2886 | QDir d(QPEApplication::qpeDir() + "/pics/"); |
2883 | #endif | 2887 | #endif |
2884 | d.setFilter( QDir::Files); | 2888 | d.setFilter( QDir::Files); |
2885 | 2889 | ||
2886 | const QFileInfoList *list = d.entryInfoList(); | 2890 | const QFileInfoList *list = d.entryInfoList(); |
2887 | int i=0; | 2891 | int i=0; |
2888 | QFileInfoListIterator it( *list ); // create list iterator | 2892 | QFileInfoListIterator it( *list ); // create list iterator |
2889 | QFileInfo *fi; // pointer for traversing | 2893 | QFileInfo *fi; // pointer for traversing |
2890 | if (icon.isEmpty() || icon.isNull()) | 2894 | if (icon.isEmpty() || icon.isNull()) |
2891 | { | 2895 | { |
2892 | dialog->IconField->setCurrentItem(0); | 2896 | dialog->IconField->setCurrentItem(0); |
2893 | } | 2897 | } |
2894 | else | 2898 | else |
2895 | { | 2899 | { |
2896 | while ( (fi=it.current()) ) | 2900 | while ( (fi=it.current()) ) |
2897 | { // for each file... | 2901 | { // for each file... |
2898 | QString fileName = fi->fileName(); | 2902 | QString fileName = fi->fileName(); |
2899 | if(fileName.right(4) == ".png") | 2903 | if(fileName.right(4) == ".png") |
2900 | { | 2904 | { |
2901 | fileName = fileName.mid(0,fileName.length()-4); | 2905 | fileName = fileName.mid(0,fileName.length()-4); |