diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /certmanager/certificateinfowidgetimpl.cpp | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'certmanager/certificateinfowidgetimpl.cpp')
-rw-r--r-- | certmanager/certificateinfowidgetimpl.cpp | 152 |
1 files changed, 76 insertions, 76 deletions
diff --git a/certmanager/certificateinfowidgetimpl.cpp b/certmanager/certificateinfowidgetimpl.cpp index c6e81010..4367cd66 100644 --- a/certmanager/certificateinfowidgetimpl.cpp +++ b/certmanager/certificateinfowidgetimpl.cpp @@ -55,21 +55,21 @@ #include <kglobalsettings.h> // Qt -#include <qlistview.h> -#include <qtextedit.h> -#include <qheader.h> -#include <qpushbutton.h> -#include <qcursor.h> -#include <qapplication.h> -#include <qdatetime.h> -#include <qstylesheet.h> -#include <qtextcodec.h> +#include <tqlistview.h> +#include <tqtextedit.h> +#include <tqheader.h> +#include <tqpushbutton.h> +#include <tqcursor.h> +#include <tqapplication.h> +#include <tqdatetime.h> +#include <tqstylesheet.h> +#include <tqtextcodec.h> // other #include <assert.h> CertificateInfoWidgetImpl::CertificateInfoWidgetImpl( const GpgME::Key & key, bool external, - QWidget * parent, const char * name ) + TQWidget * parent, const char * name ) : CertificateInfoWidget( parent, name ), mExternal( external ), mFoundIssuer( true ), @@ -77,24 +77,24 @@ CertificateInfoWidgetImpl::CertificateInfoWidgetImpl( const GpgME::Key & key, bo { importButton->setEnabled( false ); - listView->setColumnWidthMode( 1, QListView::Maximum ); - QFontMetrics fm = fontMetrics(); + listView->setColumnWidthMode( 1, TQListView::Maximum ); + TQFontMetrics fm = fontMetrics(); listView->setColumnWidth( 1, fm.width( i18n("Information") ) * 5 ); listView->header()->setClickEnabled( false ); listView->setSorting( -1 ); - connect( listView, SIGNAL( selectionChanged( QListViewItem* ) ), - this, SLOT( slotShowInfo( QListViewItem* ) ) ); - pathView->setColumnWidthMode( 0, QListView::Maximum ); + connect( listView, TQT_SIGNAL( selectionChanged( TQListViewItem* ) ), + this, TQT_SLOT( slotShowInfo( TQListViewItem* ) ) ); + pathView->setColumnWidthMode( 0, TQListView::Maximum ); pathView->header()->hide(); - connect( pathView, SIGNAL( doubleClicked( QListViewItem* ) ), - this, SLOT( slotShowCertPathDetails( QListViewItem* ) ) ); - connect( pathView, SIGNAL( returnPressed( QListViewItem* ) ), - this, SLOT( slotShowCertPathDetails( QListViewItem* ) ) ); - connect( importButton, SIGNAL( clicked() ), - this, SLOT( slotImportCertificate() ) ); + connect( pathView, TQT_SIGNAL( doubleClicked( TQListViewItem* ) ), + this, TQT_SLOT( slotShowCertPathDetails( TQListViewItem* ) ) ); + connect( pathView, TQT_SIGNAL( returnPressed( TQListViewItem* ) ), + this, TQT_SLOT( slotShowCertPathDetails( TQListViewItem* ) ) ); + connect( importButton, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotImportCertificate() ) ); dumpView->setFont( KGlobalSettings::fixedFont() ); @@ -102,8 +102,8 @@ CertificateInfoWidgetImpl::CertificateInfoWidgetImpl( const GpgME::Key & key, bo setKey( key ); } -static QString time_t2string( time_t t ) { - QDateTime dt; +static TQString time_t2string( time_t t ) { + TQDateTime dt; dt.setTime_t( t ); return dt.toString(); } @@ -124,26 +124,26 @@ void CertificateInfoWidgetImpl::setKey( const GpgME::Key & key ) { startKeyExistanceCheck(); // starts a local keylisting to enable the // importButton if needed - QListViewItem * item = 0; - item = new QListViewItem( listView, item, i18n("Valid"), QString("From %1 to %2") + TQListViewItem * item = 0; + item = new TQListViewItem( listView, item, i18n("Valid"), TQString("From %1 to %2") .arg( time_t2string( key.subkey(0).creationTime() ), time_t2string( key.subkey(0).expirationTime() ) ) ); - item = new QListViewItem( listView, item, i18n("Can be used for signing"), + item = new TQListViewItem( listView, item, i18n("Can be used for signing"), key.canSign() ? i18n("Yes") : i18n("No") ); - item = new QListViewItem( listView, item, i18n("Can be used for encryption"), + item = new TQListViewItem( listView, item, i18n("Can be used for encryption"), key.canEncrypt() ? i18n("Yes") : i18n("No") ); - item = new QListViewItem( listView, item, i18n("Can be used for certification"), + item = new TQListViewItem( listView, item, i18n("Can be used for certification"), key.canCertify() ? i18n("Yes") : i18n("No") ); - item = new QListViewItem( listView, item, i18n("Can be used for authentication"), + item = new TQListViewItem( listView, item, i18n("Can be used for authentication"), key.canAuthenticate() ? i18n("Yes") : i18n("No" ) ); - item = new QListViewItem( listView, item, i18n("Fingerprint"), key.primaryFingerprint() ); - item = new QListViewItem( listView, item, i18n("Issuer"), Kleo::DN( key.issuerName() ).prettyDN() ); - item = new QListViewItem( listView, item, i18n("Serial Number"), key.issuerSerial() ); + item = new TQListViewItem( listView, item, i18n("Fingerprint"), key.primaryFingerprint() ); + item = new TQListViewItem( listView, item, i18n("Issuer"), Kleo::DN( key.issuerName() ).prettyDN() ); + item = new TQListViewItem( listView, item, i18n("Serial Number"), key.issuerSerial() ); const Kleo::DN dn = key.userID(0).id(); // FIXME: use the attributeLabelMap from certificatewizardimpl.cpp: - static QMap<QString,QString> dnComponentNames; + static TQMap<TQString,TQString> dnComponentNames; if ( dnComponentNames.isEmpty() ) { dnComponentNames["C"] = i18n("Country"); dnComponentNames["OU"] = i18n("Organizational Unit"); @@ -154,26 +154,26 @@ void CertificateInfoWidgetImpl::setKey( const GpgME::Key & key ) { } for ( Kleo::DN::const_iterator dnit = dn.begin() ; dnit != dn.end() ; ++dnit ) { - QString displayName = (*dnit).name(); + TQString displayName = (*dnit).name(); if( dnComponentNames.contains(displayName) ) displayName = dnComponentNames[displayName]; - item = new QListViewItem( listView, item, displayName, (*dnit).value() ); + item = new TQListViewItem( listView, item, displayName, (*dnit).value() ); } const std::vector<GpgME::UserID> uids = key.userIDs(); if ( !uids.empty() ) { - item = new QListViewItem( listView, item, i18n("Subject"), + item = new TQListViewItem( listView, item, i18n("Subject"), Kleo::DN( uids.front().id() ).prettyDN() ); for ( std::vector<GpgME::UserID>::const_iterator it = uids.begin() + 1 ; it != uids.end() ; ++it ) { if ( !(*it).id() ) continue; - const QString email = QString::fromUtf8( (*it).id() ).stripWhiteSpace(); + const TQString email = TQString::fromUtf8( (*it).id() ).stripWhiteSpace(); if ( email.isEmpty() ) continue; if ( email.startsWith( "<" ) ) - item = new QListViewItem( listView, item, i18n("Email"), + item = new TQListViewItem( listView, item, i18n("Email"), email.mid( 1, email.length()-2 ) ); else - item = new QListViewItem( listView, item, i18n("A.k.a."), email ); + item = new TQListViewItem( listView, item, i18n("A.k.a."), email ); } } @@ -182,13 +182,13 @@ void CertificateInfoWidgetImpl::setKey( const GpgME::Key & key ) { startCertificateDump(); } -static void showChainListError( QWidget * parent, const GpgME::Error & err, const char * subject ) { +static void showChainListError( TQWidget * parent, const GpgME::Error & err, const char * subject ) { assert( err ); - const QString msg = i18n("<qt><p>An error occurred while fetching " + const TQString msg = i18n("<qt><p>An error occurred while fetching " "the certificate <b>%1</b> from the backend:</p>" "<p><b>%2</b></p></qt>") - .arg( subject ? QString::fromUtf8( subject ) : QString::null, - QString::fromLocal8Bit( err.asString() ) ); + .arg( subject ? TQString::fromUtf8( subject ) : TQString::null, + TQString::fromLocal8Bit( err.asString() ) ); KMessageBox::error( parent, msg, i18n("Certificate Listing Failed" ) ); } @@ -232,10 +232,10 @@ void CertificateInfoWidgetImpl::startCertificateChainListing() { Kleo::CryptoBackendFactory::instance()->smime()->keyListJob( false ); assert( job ); - connect( job, SIGNAL(result(const GpgME::KeyListResult&)), - SLOT(slotCertificateChainListingResult(const GpgME::KeyListResult&)) ); - connect( job, SIGNAL(nextKey(const GpgME::Key&)), - SLOT(slotNextKey(const GpgME::Key&)) ); + connect( job, TQT_SIGNAL(result(const GpgME::KeyListResult&)), + TQT_SLOT(slotCertificateChainListingResult(const GpgME::KeyListResult&)) ); + connect( job, TQT_SIGNAL(nextKey(const GpgME::Key&)), + TQT_SLOT(slotNextKey(const GpgME::Key&)) ); kdDebug() << "Going to fetch" << endl << " issuer : \"" << mChain.front().issuerName() << "\"" << endl @@ -258,46 +258,46 @@ void CertificateInfoWidgetImpl::startCertificateDump() { (*proc) << "--dump-keys"; (*proc) << mChain.front().primaryFingerprint(); - QObject::connect( proc, SIGNAL( receivedStdout(KProcess *, char *, int) ), - this, SLOT( slotCollectStdout(KProcess *, char *, int) ) ); - QObject::connect( proc, SIGNAL( receivedStderr(KProcess *, char *, int) ), - this, SLOT( slotCollectStderr(KProcess *, char *, int) ) ); - QObject::connect( proc, SIGNAL( processExited(KProcess*) ), - this, SLOT( slotDumpProcessExited(KProcess*) ) ); + TQObject::connect( proc, TQT_SIGNAL( receivedStdout(KProcess *, char *, int) ), + this, TQT_SLOT( slotCollectStdout(KProcess *, char *, int) ) ); + TQObject::connect( proc, TQT_SIGNAL( receivedStderr(KProcess *, char *, int) ), + this, TQT_SLOT( slotCollectStderr(KProcess *, char *, int) ) ); + TQObject::connect( proc, TQT_SIGNAL( processExited(KProcess*) ), + this, TQT_SLOT( slotDumpProcessExited(KProcess*) ) ); if ( !proc->start( KProcess::NotifyOnExit, (KProcess::Communication)(KProcess::Stdout | KProcess::Stderr) ) ) { - QString wmsg = i18n("Failed to execute gpgsm:\n%1").arg( i18n( "program not found" ) ); - dumpView->setText( QStyleSheet::escape( wmsg ) ); + TQString wmsg = i18n("Failed to execute gpgsm:\n%1").arg( i18n( "program not found" ) ); + dumpView->setText( TQStyleSheet::escape( wmsg ) ); delete proc; } } void CertificateInfoWidgetImpl::slotCollectStdout(KProcess *, char *buffer, int buflen) { - mDumpOutput += QCString(buffer, buflen+1); // like KProcIO does + mDumpOutput += TQCString(buffer, buflen+1); // like KProcIO does } void CertificateInfoWidgetImpl::slotCollectStderr(KProcess *, char *buffer, int buflen) { - mDumpError += QCString(buffer, buflen+1); // like KProcIO does + mDumpError += TQCString(buffer, buflen+1); // like KProcIO does } void CertificateInfoWidgetImpl::slotDumpProcessExited(KProcess* proc) { int rc = ( proc->normalExit() ) ? proc->exitStatus() : -1 ; if ( rc == 0 ) { - dumpView->setText( QStyleSheet::escape( QString::fromUtf8( mDumpOutput ) ) ); + dumpView->setText( TQStyleSheet::escape( TQString::fromUtf8( mDumpOutput ) ) ); } else { if ( !mDumpError.isEmpty() ) { - dumpView->setText( QStyleSheet::escape( QString::fromUtf8( mDumpError ) ) ); + dumpView->setText( TQStyleSheet::escape( TQString::fromUtf8( mDumpError ) ) ); } else { - QString wmsg = i18n("Failed to execute gpgsm:\n%1"); + TQString wmsg = i18n("Failed to execute gpgsm:\n%1"); if ( rc == -1 ) wmsg = wmsg.arg( i18n( "program cannot be executed" ) ); else wmsg = wmsg.arg( strerror(rc) ); - dumpView->setText( QStyleSheet::escape( wmsg ) ); + dumpView->setText( TQStyleSheet::escape( wmsg ) ); } } @@ -320,14 +320,14 @@ void CertificateInfoWidgetImpl::updateChainView() { pathView->clear(); if ( mChain.empty() ) return; - QListViewItem * item = 0; + TQListViewItem * item = 0; - QValueList<GpgME::Key>::const_iterator it = mChain.begin(); + TQValueList<GpgME::Key>::const_iterator it = mChain.begin(); // root item: if ( (*it).chainID() && qstrcmp( (*it).chainID(), (*it).primaryFingerprint() ) == 0 ) - item = new QListViewItem( pathView, Kleo::DN( (*it++).userID(0).id() ).prettyDN() ); + item = new TQListViewItem( pathView, Kleo::DN( (*it++).userID(0).id() ).prettyDN() ); else { - item = new QListViewItem( pathView, i18n("Issuer certificate not found ( %1)") + item = new TQListViewItem( pathView, i18n("Issuer certificate not found ( %1)") .arg( Kleo::DN( (*it).issuerName() ).prettyDN() ) ); item->setOpen( true ); // Qt bug: doesn't open after setEnabled( false ) :/ item->setEnabled( false ); @@ -336,7 +336,7 @@ void CertificateInfoWidgetImpl::updateChainView() { // subsequent items: while ( it != mChain.end() ) { - item = new QListViewItem( item, Kleo::DN( (*it++).userID(0).id() ).prettyDN() ); + item = new TQListViewItem( item, Kleo::DN( (*it++).userID(0).id() ).prettyDN() ); item->setOpen( true ); } } @@ -348,11 +348,11 @@ void CertificateInfoWidgetImpl::slotCertificateChainListingResult( const GpgME:: startCertificateChainListing(); } -void CertificateInfoWidgetImpl::slotShowInfo( QListViewItem * item ) { +void CertificateInfoWidgetImpl::slotShowInfo( TQListViewItem * item ) { textView->setText( item->text(1) ); } -void CertificateInfoWidgetImpl::slotShowCertPathDetails( QListViewItem * item ) { +void CertificateInfoWidgetImpl::slotShowCertPathDetails( TQListViewItem * item ) { if ( !item ) return; @@ -362,7 +362,7 @@ void CertificateInfoWidgetImpl::slotShowCertPathDetails( QListViewItem * item ) // widget spec for Kleo::KeyListView. unsigned int totalCount = 0; int itemIndex = -1; - for ( const QListViewItem * i = pathView->firstChild() ; i ; i = i->firstChild() ) { + for ( const TQListViewItem * i = pathView->firstChild() ; i ; i = i->firstChild() ) { if ( i == item ) itemIndex = totalCount; ++totalCount; @@ -383,8 +383,8 @@ void CertificateInfoWidgetImpl::slotShowCertPathDetails( QListViewItem * item ) new CertificateInfoWidgetImpl( mChain[itemIndex], mExternal, dialog ); dialog->setMainWidget( top ); // proxy the signal to our receiver: - connect( top, SIGNAL(requestCertificateDownload(const QString&, const QString&)), - SIGNAL(requestCertificateDownload(const QString&, const QString&)) ); + connect( top, TQT_SIGNAL(requestCertificateDownload(const TQString&, const TQString&)), + TQT_SIGNAL(requestCertificateDownload(const TQString&, const TQString&)) ); dialog->show(); } @@ -405,7 +405,7 @@ void CertificateInfoWidgetImpl::startKeyExistanceCheck() { if ( mChain.empty() || mChain.back().isNull() ) // need a key to look for return; - const QString fingerprint = mChain.back().primaryFingerprint(); + const TQString fingerprint = mChain.back().primaryFingerprint(); if ( fingerprint.isEmpty() ) // empty pattern means list all keys. We don't want that return; @@ -415,10 +415,10 @@ void CertificateInfoWidgetImpl::startKeyExistanceCheck() { Kleo::CryptoBackendFactory::instance()->smime()->keyListJob( false ); assert( job ); - connect( job, SIGNAL(nextKey(const GpgME::Key&)), - SLOT(slotKeyExistanceCheckNextCandidate(const GpgME::Key&)) ); - connect( job, SIGNAL(result(const GpgME::KeyListResult&)), - SLOT(slotKeyExistanceCheckFinished()) ); + connect( job, TQT_SIGNAL(nextKey(const GpgME::Key&)), + TQT_SLOT(slotKeyExistanceCheckNextCandidate(const GpgME::Key&)) ); + connect( job, TQT_SIGNAL(result(const GpgME::KeyListResult&)), + TQT_SLOT(slotKeyExistanceCheckFinished()) ); // nor to check for errors: job->start( fingerprint ); } |