summaryrefslogtreecommitdiffabout
path: root/pwmanager
Unidiff
Diffstat (limited to 'pwmanager') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/editcategory.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/pwmanager/pwmanager/editcategory.cpp b/pwmanager/pwmanager/editcategory.cpp
index 4e55de8..4e2378c 100644
--- a/pwmanager/pwmanager/editcategory.cpp
+++ b/pwmanager/pwmanager/editcategory.cpp
@@ -100,89 +100,90 @@ editCategoryWnd::editCategoryWnd( PwMDoc* d, QWidget* parent, const char* name)
100 //PwMCategoryItem* getCategoryEntry(unsigned int index) 100 //PwMCategoryItem* getCategoryEntry(unsigned int index)
101 // { return &(dti.dta[index]); } 101 // { return &(dti.dta[index]); }
102 102
103 103
104 104
105} 105}
106 106
107/* 107/*
108 * Destroys the object and frees any allocated resources 108 * Destroys the object and frees any allocated resources
109 */ 109 */
110editCategoryWnd::~editCategoryWnd() 110editCategoryWnd::~editCategoryWnd()
111{ 111{
112 // no need to delete child widgets, Qt does it all for us 112 // no need to delete child widgets, Qt does it all for us
113} 113}
114 114
115void editCategoryWnd::slotOk() 115void editCategoryWnd::slotOk()
116{ 116{
117 // qDebug( "addEntryWnd::slotOk(): Not implemented yet" ); 117 // qDebug( "addEntryWnd::slotOk(): Not implemented yet" );
118 slotApply(); 118 slotApply();
119 accept(); 119 accept();
120} 120}
121 121
122void editCategoryWnd::slotApply() 122void editCategoryWnd::slotApply()
123{ 123{
124 QString cat = categoryComboBox->currentText(); 124 QString cat = categoryComboBox->currentText();
125 125
126 unsigned int idx; 126 unsigned int idx;
127 bool found = doc->findCategory(cat, &idx); 127 bool found = doc->findCategory(cat, &idx);
128 128
129 if (found == true) 129 if (found == true)
130 { 130 {
131 PwMCategoryItem* catitem = doc->getCategoryEntry(idx); 131 PwMCategoryItem* catitem = doc->getCategoryEntry(idx);
132 132
133 catitem->desc_text = descLineEdit->text().latin1(); 133 catitem->desc_text = descLineEdit->text().latin1();
134 catitem->name_text = usernameLineEdit->text().latin1(); 134 catitem->name_text = usernameLineEdit->text().latin1();
135 catitem->pw_text = pwLineEdit->text().latin1(); 135 catitem->pw_text = pwLineEdit->text().latin1();
136 enableButton( KDialogBase::Apply, false ); 136 enableButton( KDialogBase::Apply, false );
137 return; 137 return;
138 } 138 }
139 139
140 BUG(); 140 BUG();
141 141
142} 142}
143 143
144void editCategoryWnd::cancel_slot() 144void editCategoryWnd::cancel_slot()
145{ 145{
146 QString cat = categoryComboBox->currentText(); 146 QString cat = categoryComboBox->currentText();
147 categorySelected ( cat ); 147 categorySelected ( cat );
148 reject();
148} 149}
149 150
150void editCategoryWnd::setCurrCategory(const QString &cat) 151void editCategoryWnd::setCurrCategory(const QString &cat)
151{ 152{
152 int i, count = categoryComboBox->count(); 153 int i, count = categoryComboBox->count();
153 154
154 for (i = 0; i < count; ++i) { 155 for (i = 0; i < count; ++i) {
155 if (categoryComboBox->text(i) == cat) { 156 if (categoryComboBox->text(i) == cat) {
156 categoryComboBox->setCurrentItem(i); 157 categoryComboBox->setCurrentItem(i);
157 categorySelected ( cat ); 158 categorySelected ( cat );
158 return; 159 return;
159 } 160 }
160 } 161 }
161 BUG(); 162 BUG();
162} 163}
163 164
164void editCategoryWnd::categorySelected ( const QString & string ) 165void editCategoryWnd::categorySelected ( const QString & string )
165{ 166{
166 unsigned int idx; 167 unsigned int idx;
167 bool found = doc->findCategory(string, &idx); 168 bool found = doc->findCategory(string, &idx);
168 169
169 if (found == true) 170 if (found == true)
170 { 171 {
171 PwMCategoryItem* catitem = doc->getCategoryEntry(idx); 172 PwMCategoryItem* catitem = doc->getCategoryEntry(idx);
172 173
173 descLineEdit->setText(catitem->desc_text.c_str()); 174 descLineEdit->setText(catitem->desc_text.c_str());
174 usernameLineEdit->setText(catitem->name_text.c_str()); 175 usernameLineEdit->setText(catitem->name_text.c_str());
175 pwLineEdit->setText(catitem->pw_text.c_str()); 176 pwLineEdit->setText(catitem->pw_text.c_str());
176 enableButton( KDialogBase::Apply, false ); 177 enableButton( KDialogBase::Apply, false );
177 return; 178 return;
178 } 179 }
179 180
180 BUG(); 181 BUG();
181 182
182} 183}
183 184
184void editCategoryWnd::widgetModified(const QString &) 185void editCategoryWnd::widgetModified(const QString &)
185{ 186{
186 enableButton( KDialogBase::Apply, true ); 187 enableButton( KDialogBase::Apply, true );
187} 188}
188 189