|
|
@ -350,54 +350,18 @@ void popupPublic::refreshkeys()
|
|
|
|
|
|
|
|
|
|
|
|
void popupPublic::slotpreselect()
|
|
|
|
void popupPublic::slotpreselect()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQListViewItem *it=NULL;
|
|
|
|
|
|
|
|
if (!keysList->firstChild()) return;
|
|
|
|
|
|
|
|
if (fmode) it=keysList->findItem(KGpgSettings::defaultKey(),2);
|
|
|
|
|
|
|
|
if (!trusted)
|
|
|
|
|
|
|
|
sort();
|
|
|
|
|
|
|
|
if (fmode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
keysList->clearSelection();
|
|
|
|
|
|
|
|
keysList->setSelected(it,true);
|
|
|
|
|
|
|
|
keysList->setCurrentItem(it);
|
|
|
|
|
|
|
|
keysList->ensureItemVisible(it);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
emit keyListFilled();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void popupPublic::slotSetVisible()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
keysList->ensureItemVisible(keysList->currentItem());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void popupPublic::slotprocread(KProcIO *p)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// kdDebug(2100) << k_funcinfo << endl;
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////// extract encryption keys
|
|
|
|
|
|
|
|
TQString tst;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQString defaultKey = KGpgSettings::defaultKey().right(8);
|
|
|
|
TQString defaultKey = KGpgSettings::defaultKey().right(8);
|
|
|
|
|
|
|
|
|
|
|
|
while (p->readln(tst)!=-1) {
|
|
|
|
// process the output to update dialog infos
|
|
|
|
// kdDebug(2100) << k_funcinfo << "Read one public key line: " << tst << endl;
|
|
|
|
|
|
|
|
if ( tst.startsWith("pub") ) {
|
|
|
|
|
|
|
|
currentKey = tst.section(':',4,4);
|
|
|
|
|
|
|
|
TQStringList lst; lst << tst;
|
|
|
|
|
|
|
|
hashMap.insert(currentKey,tst);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
hashMap.find(currentKey).data().append(tst);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQMap<TQString,TQStringList>::Iterator ite;
|
|
|
|
TQMap<TQString,TQStringList>::Iterator ite;
|
|
|
|
for (ite = hashMap.begin(); ite != hashMap.end(); ite++) {
|
|
|
|
for (ite = hashMap.begin(); ite != hashMap.end(); ite++) {
|
|
|
|
TQStringList::Iterator it;
|
|
|
|
TQStringList::Iterator it;
|
|
|
|
TQString fullname,keyname,keymail,val,id;
|
|
|
|
TQString fullname,keyname,keymail,val,id;
|
|
|
|
bool dead;
|
|
|
|
bool dead;
|
|
|
|
|
|
|
|
|
|
|
|
for (it = ite.data().begin(); it != ite.data().end(); it++) {
|
|
|
|
for (it = ite.data().begin(); it != ite.data().end(); it++) {
|
|
|
|
TQString line = (*it);
|
|
|
|
TQString line = (*it);
|
|
|
|
|
|
|
|
kdDebug(2100) << k_funcinfo << line << endl;
|
|
|
|
|
|
|
|
|
|
|
|
if (line.startsWith("pub")) {
|
|
|
|
if (line.startsWith("pub")) {
|
|
|
|
TQStringList keyString=TQStringList::split(":",line,true);
|
|
|
|
TQStringList keyString=TQStringList::split(":",line,true);
|
|
|
@ -408,41 +372,30 @@ void popupPublic::slotprocread(KProcIO *p)
|
|
|
|
if (val.isEmpty()) {
|
|
|
|
if (val.isEmpty()) {
|
|
|
|
val=i18n("Unlimited");
|
|
|
|
val=i18n("Unlimited");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TQString tr;
|
|
|
|
// unused TQString tr;
|
|
|
|
switch( trust[0] ) {
|
|
|
|
switch( trust[0] ) {
|
|
|
|
case 'o':
|
|
|
|
case 'o': // unknown
|
|
|
|
untrustedList<<id;
|
|
|
|
untrustedList<<id; // untrustedList used in sort
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'i':
|
|
|
|
|
|
|
|
dead=true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'd':
|
|
|
|
|
|
|
|
dead=true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'r':
|
|
|
|
|
|
|
|
dead=true;
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'e':
|
|
|
|
case 'i': // invalid
|
|
|
|
|
|
|
|
case 'd': // disabled
|
|
|
|
|
|
|
|
case 'r': // revoked
|
|
|
|
|
|
|
|
case 'e': // expired
|
|
|
|
dead=true;
|
|
|
|
dead=true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'q':
|
|
|
|
case 'q': // undefined
|
|
|
|
untrustedList<<id;
|
|
|
|
case 'n': // none
|
|
|
|
break;
|
|
|
|
case 'm': // marginal
|
|
|
|
case 'n':
|
|
|
|
|
|
|
|
untrustedList<<id;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'm':
|
|
|
|
|
|
|
|
untrustedList<<id;
|
|
|
|
untrustedList<<id;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
case 'f': // full
|
|
|
|
break;
|
|
|
|
case 'u': // ultimate
|
|
|
|
case 'u':
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
untrustedList<<id;
|
|
|
|
untrustedList<<id;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (keyString[11].find('D')!=-1) {
|
|
|
|
if (keyString[11].find('D')!=-1) { // disabled
|
|
|
|
dead=true;
|
|
|
|
dead=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fullname=keyString[9];
|
|
|
|
fullname=keyString[9];
|
|
|
@ -481,6 +434,43 @@ void popupPublic::slotprocread(KProcIO *p)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
TQListViewItem *it=NULL;
|
|
|
|
|
|
|
|
if (!keysList->firstChild()) return;
|
|
|
|
|
|
|
|
if (fmode) it=keysList->findItem(KGpgSettings::defaultKey(),2);
|
|
|
|
|
|
|
|
if (!trusted)
|
|
|
|
|
|
|
|
sort();
|
|
|
|
|
|
|
|
if (fmode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
keysList->clearSelection();
|
|
|
|
|
|
|
|
keysList->setSelected(it,true);
|
|
|
|
|
|
|
|
keysList->setCurrentItem(it);
|
|
|
|
|
|
|
|
keysList->ensureItemVisible(it);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
emit keyListFilled();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void popupPublic::slotSetVisible()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
keysList->ensureItemVisible(keysList->currentItem());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void popupPublic::slotprocread(KProcIO *p)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// collect all data (output starts with pub line followed by related)
|
|
|
|
|
|
|
|
// kdDebug(2100) << k_funcinfo << endl;
|
|
|
|
|
|
|
|
TQString tst;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (p->readln(tst)!=-1) {
|
|
|
|
|
|
|
|
if ( tst.startsWith("pub") ) {
|
|
|
|
|
|
|
|
currentKey = tst.section(':',4,4);
|
|
|
|
|
|
|
|
TQStringList lst; lst << tst;
|
|
|
|
|
|
|
|
hashMap.insert(currentKey,tst);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
hashMap.find(currentKey).data().append(tst);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|