summaryrefslogtreecommitdiff
authorzcarsten <zcarsten>2003-08-06 20:15:19 (UTC)
committer zcarsten <zcarsten>2003-08-06 20:15:19 (UTC)
commite14f10f07d8477ee49cd487587732e27a3307878 (patch) (unidiff)
treee46ff1986ce5c0cbba2283d80a878df432f874d8
parentba25812361114b7cf059a3a1fb3aed42f8a7ebde (diff)
downloadopie-e14f10f07d8477ee49cd487587732e27a3307878.zip
opie-e14f10f07d8477ee49cd487587732e27a3307878.tar.gz
opie-e14f10f07d8477ee49cd487587732e27a3307878.tar.bz2
addCategory corrected
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/zsafe/zsafe.cpp44
1 files changed, 34 insertions, 10 deletions
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index ef16b46..e86b3d2 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -2599,2 +2599,3 @@ void ZSafe::addCategory()
2599 QString categ; 2599 QString categ;
2600 QString firstCategory;
2600 dialog->CategoryField->clear(); // remove all items 2601 dialog->CategoryField->clear(); // remove all items
@@ -2620,2 +2621,4 @@ void ZSafe::addCategory()
2620 dialog->CategoryField->insertItem (categ, -1); 2621 dialog->CategoryField->insertItem (categ, -1);
2622 if (firstCategory.isEmpty())
2623 firstCategory = categ;
2621 } 2624 }
@@ -2626,3 +2629,6 @@ void ZSafe::addCategory()
2626 2629
2627 setCategoryDialogFields(dialog); 2630 if (firstCategory.isEmpty())
2631 setCategoryDialogFields(dialog);
2632 else
2633 setCategoryDialogFields(dialog, firstCategory);
2628 2634
@@ -2788,14 +2794,29 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog)
2788{ 2794{
2789 dialog->Field1->setText(getFieldLabel (selectedItem, "1", tr("Name"))); 2795 if (!dialog)
2790 dialog->Field2->setText(getFieldLabel (selectedItem, "2", tr("Username"))); 2796 return;
2791 dialog->Field3->setText(getFieldLabel (selectedItem, "3", tr("Password")));
2792 dialog->Field4->setText(getFieldLabel (selectedItem, "4", tr("Comment")));
2793 dialog->Field5->setText(getFieldLabel (selectedItem, "5", tr("Field 4")));
2794 dialog->Field6->setText(getFieldLabel (selectedItem, "6", tr("Field 5")));
2795 2797
2796 QString icon; 2798 QString icon;
2797 Category *cat= categories.find (selectedItem->text(0)); 2799 if (selectedItem)
2798 if (cat)
2799 { 2800 {
2800 icon = cat->getIconName(); 2801 dialog->Field1->setText(getFieldLabel (selectedItem, "1", tr("Name")));
2802 dialog->Field2->setText(getFieldLabel (selectedItem, "2", tr("Username")));
2803 dialog->Field3->setText(getFieldLabel (selectedItem, "3", tr("Password")));
2804 dialog->Field4->setText(getFieldLabel (selectedItem, "4", tr("Comment")));
2805 dialog->Field5->setText(getFieldLabel (selectedItem, "5", tr("Field 4")));
2806 dialog->Field6->setText(getFieldLabel (selectedItem, "6", tr("Field 5")));
2807
2808 Category *cat= categories.find (selectedItem->text(0));
2809 if (cat)
2810 {
2811 icon = cat->getIconName();
2812 }
2813 }
2814 else
2815 {
2816 dialog->Field1->setText(tr("Name"));
2817 dialog->Field2->setText(tr("Username"));
2818 dialog->Field3->setText(tr("Password"));
2819 dialog->Field4->setText(tr("Comment"));
2820 dialog->Field5->setText(tr("Field 4"));
2821 dialog->Field6->setText(tr("Field 5"));
2801 } 2822 }
@@ -2840,2 +2861,5 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category)
2840{ 2861{
2862 if (!dialog)
2863 return;
2864
2841 dialog->Field1->setText(getFieldLabel (category, "1", tr("Name"))); 2865 dialog->Field1->setText(getFieldLabel (category, "1", tr("Name")));