diff --git a/src/otrlconfinterface.cpp b/src/otrlconfinterface.cpp index dc79ee5..7a025bd 100644 --- a/src/otrlconfinterface.cpp +++ b/src/otrlconfinterface.cpp @@ -103,37 +103,38 @@ void OtrlConfInterface::generateNewPrivKey( TQString accountId, TQString protoco popup->close(); } -TQValueList OtrlConfInterface::readAllFingerprints(){ +TQValueList OtrlConfInterface::readAllFingerprints(){ ConnContext *context; Fingerprint *fingerprint; - TQString entry[5]; + TQStringList entry; char hash[45]; - TQValueList list; + TQValueList list; for( context = userstate->context_root; context != NULL; context = context->next ){ fingerprint = context->fingerprint_root.next; while( fingerprint ){ - entry[0] = context->username; + entry.clear(); + entry << context->username; if( ( context->msgstate == OTRL_MSGSTATE_ENCRYPTED ) && ( context->active_fingerprint != fingerprint ) ){ - entry[1] = i18n("Unused"); + entry << i18n("Unused"); } else { if (context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED) { if (context->active_fingerprint->trust && context->active_fingerprint->trust[0] != 0) { - entry[1] = i18n("Private"); + entry << i18n("Private"); } else { - entry[1] = i18n("Unverified"); + entry << i18n("Unverified"); } } else if (context && context->msgstate == OTRL_MSGSTATE_FINISHED) { - entry[1] = i18n("Finished"); + entry << i18n("Finished"); } else { - entry[1] = i18n("Not Private"); + entry << i18n("Not Private"); } } - entry[2] = ( fingerprint->trust && fingerprint->trust[0] ) ? i18n("Yes") : i18n("No") ; + entry << ((fingerprint->trust && fingerprint->trust[0]) ? i18n("Yes") : i18n("No")); otrl_privkey_hash_to_human( hash, fingerprint->fingerprint ); - entry[3] = hash; - entry[4] = context->protocol; + entry << hash; + entry << context->protocol; list << entry; fingerprint = fingerprint->next; } diff --git a/src/otrlconfinterface.h b/src/otrlconfinterface.h index d0579f7..0e743e2 100644 --- a/src/otrlconfinterface.h +++ b/src/otrlconfinterface.h @@ -49,7 +49,7 @@ public: TQString getPrivFingerprint( TQString accountId, TQString protocol ); void generateNewPrivKey( TQString accountId, TQString protocol ); - TQValueList readAllFingerprints(); + TQValueList readAllFingerprints(); bool hasPrivFingerprint( TQString accountId, TQString protocol); void forgetFingerprint( TQString strFingerprint ); void verifyFingerprint( TQString strFingerprint, bool trust ); diff --git a/src/otrpreferences.cpp b/src/otrpreferences.cpp index 6f6fafe..b88c602 100644 --- a/src/otrpreferences.cpp +++ b/src/otrpreferences.cpp @@ -139,13 +139,14 @@ void OTRPreferences::showPrivFingerprint( int accountnr ) void OTRPreferences::fillFingerprints(){ TQTable *fingerprintsTable = preferencesDialog->tbFingerprints; preferencesDialog->tbFingerprints->setNumRows(0); - TQValueList list = otrlConfInterface->readAllFingerprints(); - TQValueList::iterator it; + TQValueList list = otrlConfInterface->readAllFingerprints(); + TQValueList::iterator it; int j = 0; for( it = list.begin(); it != list.end(); ++it ){ preferencesDialog->tbFingerprints->setNumRows( preferencesDialog->tbFingerprints->numRows() +1 ); - (*it)[0] = OtrlChatInterface::self()->formatContact((*it)[0]); - for( int i = 0; i < 5; i++ ){ + fingerprintsTable->setItem(j, 0, new TQAlignTableItem(fingerprintsTable, TQTableItem::Never, + OtrlChatInterface::self()->formatContact((*it)[0]), TQt::AlignLeft)); + for( int i = 1; i < 5; i++ ){ //preferencesDialog->tbFingerprints->setText(j, i, (*it)[i] ); fingerprintsTable->setItem(j,i, new TQAlignTableItem(fingerprintsTable, TQTableItem::Never,(*it)[i],TQt::AlignLeft)); }