Changeset 6216 for trunk/qt4-gui/src/dialogs
- Timestamp:
- 05/26/08 03:06:39 (6 months ago)
- Location:
- trunk/qt4-gui/src/dialogs
- Files:
-
- 2 modified
-
gpgkeymanager.cpp (modified) (3 diffs)
-
gpgkeymanager.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/dialogs/gpgkeymanager.cpp
r6211 r6216 98 98 99 99 // create the keylist 100 lst_keyList = new KeyList( );100 lst_keyList = new KeyList(this); 101 101 lst_keyList->setAllColumnsShowFocus(true); 102 102 QStringList headers; … … 182 182 return; 183 183 184 ICQUser* u = gUserManager.FetchUser(tmp->szId.toLatin1(), tmp->nPPID, LOCK_R); 185 if ( u ) 186 { 187 editUser( u ); 184 editUser(tmp->szId, tmp->nPPID); 185 } 186 187 void GPGKeyManager::editUser(QString id, unsigned long ppid) 188 { 189 KeyListItem* item = NULL; 190 bool found = false; 191 192 for (int i = 0; i < lst_keyList->topLevelItemCount(); ++i) 193 { 194 item = dynamic_cast<KeyListItem*>(lst_keyList->topLevelItem(i)); 195 196 if (item->getszId() == id && item->getnPPID() == ppid) 197 { 198 found = true; 199 break; 200 } 201 } 202 203 if (!found) 204 { 205 ICQUser* u = gUserManager.FetchUser(id.toLatin1(), ppid, LOCK_R); 206 if (u == NULL) 207 return; 208 item = new KeyListItem(lst_keyList, u); 188 209 gUserManager.DropUser(u); 189 210 } 190 } 191 192 void GPGKeyManager::editUser(ICQUser* u) 193 { 194 for (int i = 0; i < lst_keyList->topLevelItemCount(); ++i) 195 { 196 KeyListItem* item = dynamic_cast<KeyListItem*>(lst_keyList->topLevelItem(i)); 197 198 if (item->getszId() == u->IdString() && item->getnPPID() == u->PPID()) 199 { 200 item->edit(); 201 return; 202 } 203 } 204 205 (new KeyListItem(lst_keyList, u))->edit(); 211 212 item->edit(); 206 213 }; 207 214 … … 278 285 QString szId = text.mid(4); 279 286 280 ICQUser* u = gUserManager.FetchUser(szId.toLatin1(), nPPID, LOCK_R); 281 282 if (u != NULL) 283 { 284 bool found = false; 285 for (int i = 0; i < topLevelItemCount(); ++i) 286 { 287 KeyListItem* item = dynamic_cast<KeyListItem*>(topLevelItem(i)); 288 if (item->getszId() == szId && item->getnPPID() == nPPID) 289 { 290 item->edit(); 291 found = true; 292 break; 293 } 294 } 295 if (!found) 296 (new KeyListItem(this, u))->edit(); 297 gUserManager.DropUser(u); 298 } 287 GPGKeyManager* km = dynamic_cast<GPGKeyManager*>(nativeParentWidget()); 288 if (km != NULL) 289 km->editUser(szId, nPPID); 299 290 } 300 291 -
trunk/qt4-gui/src/dialogs/gpgkeymanager.h
r5837 r6216 45 45 QLabel* lbl_passphrase; 46 46 QLabel* lbl_dragndrop; 47 void editUser( ICQUser* u);47 void editUser(QString id, unsigned long ppid); 48 48 void initKeyList(); 49 49 … … 55 55 void slot_remove(); 56 56 void slot_doubleClicked(QTreeWidgetItem* item); 57 58 friend class KeyList; 57 59 }; 58 60
