Fix FTBFS with Clang.

Use TQStringList instead of TQString[5].

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/2/head
Slávek Banko 3 years ago
parent c16126ae22
commit 707963c264
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -103,37 +103,38 @@ void OtrlConfInterface::generateNewPrivKey( TQString accountId, TQString protoco
popup->close(); popup->close();
} }
TQValueList<TQString[5]> OtrlConfInterface::readAllFingerprints(){ TQValueList<TQStringList> OtrlConfInterface::readAllFingerprints(){
ConnContext *context; ConnContext *context;
Fingerprint *fingerprint; Fingerprint *fingerprint;
TQString entry[5]; TQStringList entry;
char hash[45]; char hash[45];
TQValueList<TQString[5]> list; TQValueList<TQStringList> list;
for( context = userstate->context_root; context != NULL; context = context->next ){ for( context = userstate->context_root; context != NULL; context = context->next ){
fingerprint = context->fingerprint_root.next; fingerprint = context->fingerprint_root.next;
while( fingerprint ){ while( fingerprint ){
entry[0] = context->username; entry.clear();
entry << context->username;
if( ( context->msgstate == OTRL_MSGSTATE_ENCRYPTED ) && ( context->active_fingerprint != fingerprint ) ){ if( ( context->msgstate == OTRL_MSGSTATE_ENCRYPTED ) && ( context->active_fingerprint != fingerprint ) ){
entry[1] = i18n("Unused"); entry << i18n("Unused");
} else { } else {
if (context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED) { if (context && context->msgstate == OTRL_MSGSTATE_ENCRYPTED) {
if (context->active_fingerprint->trust && context->active_fingerprint->trust[0] != 0) { if (context->active_fingerprint->trust && context->active_fingerprint->trust[0] != 0) {
entry[1] = i18n("Private"); entry << i18n("Private");
} else { } else {
entry[1] = i18n("Unverified"); entry << i18n("Unverified");
} }
} else if (context && context->msgstate == OTRL_MSGSTATE_FINISHED) { } else if (context && context->msgstate == OTRL_MSGSTATE_FINISHED) {
entry[1] = i18n("Finished"); entry << i18n("Finished");
} else { } 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 ); otrl_privkey_hash_to_human( hash, fingerprint->fingerprint );
entry[3] = hash; entry << hash;
entry[4] = context->protocol; entry << context->protocol;
list << entry; list << entry;
fingerprint = fingerprint->next; fingerprint = fingerprint->next;
} }

@ -49,7 +49,7 @@ public:
TQString getPrivFingerprint( TQString accountId, TQString protocol ); TQString getPrivFingerprint( TQString accountId, TQString protocol );
void generateNewPrivKey( TQString accountId, TQString protocol ); void generateNewPrivKey( TQString accountId, TQString protocol );
TQValueList<TQString[5]> readAllFingerprints(); TQValueList<TQStringList> readAllFingerprints();
bool hasPrivFingerprint( TQString accountId, TQString protocol); bool hasPrivFingerprint( TQString accountId, TQString protocol);
void forgetFingerprint( TQString strFingerprint ); void forgetFingerprint( TQString strFingerprint );
void verifyFingerprint( TQString strFingerprint, bool trust ); void verifyFingerprint( TQString strFingerprint, bool trust );

@ -139,13 +139,14 @@ void OTRPreferences::showPrivFingerprint( int accountnr )
void OTRPreferences::fillFingerprints(){ void OTRPreferences::fillFingerprints(){
TQTable *fingerprintsTable = preferencesDialog->tbFingerprints; TQTable *fingerprintsTable = preferencesDialog->tbFingerprints;
preferencesDialog->tbFingerprints->setNumRows(0); preferencesDialog->tbFingerprints->setNumRows(0);
TQValueList<TQString[5]> list = otrlConfInterface->readAllFingerprints(); TQValueList<TQStringList> list = otrlConfInterface->readAllFingerprints();
TQValueList<TQString[5]>::iterator it; TQValueList<TQStringList>::iterator it;
int j = 0; int j = 0;
for( it = list.begin(); it != list.end(); ++it ){ for( it = list.begin(); it != list.end(); ++it ){
preferencesDialog->tbFingerprints->setNumRows( preferencesDialog->tbFingerprints->numRows() +1 ); preferencesDialog->tbFingerprints->setNumRows( preferencesDialog->tbFingerprints->numRows() +1 );
(*it)[0] = OtrlChatInterface::self()->formatContact((*it)[0]); fingerprintsTable->setItem(j, 0, new TQAlignTableItem(fingerprintsTable, TQTableItem::Never,
for( int i = 0; i < 5; i++ ){ OtrlChatInterface::self()->formatContact((*it)[0]), TQt::AlignLeft));
for( int i = 1; i < 5; i++ ){
//preferencesDialog->tbFingerprints->setText(j, i, (*it)[i] ); //preferencesDialog->tbFingerprints->setText(j, i, (*it)[i] );
fingerprintsTable->setItem(j,i, new TQAlignTableItem(fingerprintsTable, TQTableItem::Never,(*it)[i],TQt::AlignLeft)); fingerprintsTable->setItem(j,i, new TQAlignTableItem(fingerprintsTable, TQTableItem::Never,(*it)[i],TQt::AlignLeft));
} }

Loading…
Cancel
Save