diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-04-13 00:46:47 +0000 |
commit | 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 (patch) | |
tree | 5f52a9eada2e9f3654fc327d7c14dfef570a6ecb /certmanager/certmanager.cpp | |
parent | 2ee4bf4fd5eff93b2fbef0ff8e8063edffc5da5c (diff) | |
download | tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.tar.gz tdepim-67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7.zip |
Initial conversion of kdepim to TQt
This will probably require some tweaking before it will build under Qt4,
however Qt3 builds are OK. Any alterations this commit makes to kdepim
behaviour under Qt3 are unintentional and should be fixed.
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'certmanager/certmanager.cpp')
-rw-r--r-- | certmanager/certmanager.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/certmanager/certmanager.cpp b/certmanager/certmanager.cpp index aebfa3668..59fc73766 100644 --- a/certmanager/certmanager.cpp +++ b/certmanager/certmanager.cpp @@ -20,11 +20,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -89,7 +89,7 @@ #include <kio/netaccess.h> #include <kstdaccel.h> -// Qt +// TQt #include <tqfontmetrics.h> #include <tqpopupmenu.h> @@ -136,7 +136,7 @@ namespace { case 0: return i18n("Subject"); case 1: return i18n("Issuer"); case 2: return i18n("Serial"); - default: return TQString::null; + default: return TQString(); } } @@ -144,8 +144,8 @@ namespace { switch ( col ) { case 0: return Kleo::DN( key.userID(0).id() ).prettyDN(); case 1: return Kleo::DN( key.issuerName() ).prettyDN(); - case 2: return key.issuerSerial() ? TQString::fromUtf8( key.issuerSerial() ) : TQString::null ; - default: return TQString::null; + case 2: return key.issuerSerial() ? TQString::fromUtf8( key.issuerSerial() ) : TQString() ; + default: return TQString(); } } @@ -161,8 +161,8 @@ namespace { } // anon namespace CertManager::CertManager( bool remote, const TQString& query, const TQString & import, - TQWidget* parent, const char* name, WFlags f ) - : KMainWindow( parent, name, f|WDestructiveClose ), + TQWidget* tqparent, const char* name, WFlags f ) + : KMainWindow( tqparent, name, f|WDestructiveClose ), mCrlView( 0 ), mDirmngrProc( 0 ), mHierarchyAnalyser( 0 ), @@ -354,7 +354,7 @@ void CertManager::createActions() { (void)new LabelAction( i18n("Search:"), actionCollection(), "label_action" ); - mLineEditAction = new LineEditAction( TQString::null, actionCollection(), this, + mLineEditAction = new LineEditAction( TQString(), actionCollection(), this, TQT_SLOT(slotSearch()), "query_lineedit_action"); @@ -363,8 +363,8 @@ void CertManager::createActions() { mComboAction = new ComboAction( lst, actionCollection(), this, TQT_SLOT( slotToggleRemote(int) ), "location_combo_action", mNextFindRemote? 1 : 0 ); - mFindAction = new KAction( i18n("Find"), "find", 0, this, TQT_SLOT(slotSearch()), - actionCollection(), "find" ); + mFindAction = new KAction( i18n("Find"), "tqfind", 0, this, TQT_SLOT(slotSearch()), + actionCollection(), "tqfind" ); KStdAction::keyBindings( this, TQT_SLOT(slotEditKeybindings()), actionCollection() ); KStdAction::preferences( this, TQT_SLOT(slotShowConfigurationDialog()), actionCollection() ); @@ -496,10 +496,10 @@ static std::set<std::string> extractKeyFingerprints( const TQPtrList<Kleo::KeyLi } static TQStringList stringlistFromSet( const std::set<std::string> & set ) { - // ARGH. This is madness. Shitty Qt containers don't support TQStringList( patterns.begin(), patterns.end() ) :/ + // ARGH. This is madness. Shitty TQt containers don't support TQStringList( patterns.begin(), patterns.end() ) :/ TQStringList sl; for ( std::set<std::string>::const_iterator it = set.begin() ; it != set.end() ; ++it ) - // let's make extra sure, maybe someone tries to make Qt not support std::string->TQString conversion + // let's make extra sure, maybe someone tries to make TQt not support std::string->TQString conversion sl.push_back( TQString::tqfromLatin1( it->c_str() ) ); return sl; } @@ -527,14 +527,14 @@ void CertManager::slotRefreshKeysResult( const GpgME::Error & err ) { i18n("Refreshing Keys Failed") ); } -static void showKeyListError( TQWidget * parent, const GpgME::Error & err ) { +static void showKeyListError( TQWidget * tqparent, const GpgME::Error & err ) { assert( err ); const TQString msg = i18n( "<qt><p>An error occurred while fetching " "the certificates from the backend:</p>" "<p><b>%1</b></p></qt>" ) .arg( TQString::fromLocal8Bit( err.asString() ) ); - KMessageBox::error( parent, msg, i18n( "Certificate Listing Failed" ) ); + KMessageBox::error( tqparent, msg, i18n( "Certificate Listing Failed" ) ); } void CertManager::slotSearch() { @@ -592,7 +592,7 @@ static void selectKeys( Kleo::KeyListView * lv, const std::set<std::string> & fp for ( TQListViewItemIterator it( lv ) ; it.current() ; ++it ) if ( Kleo::KeyListViewItem * item = Kleo::lvi_cast<Kleo::KeyListViewItem>( it.current() ) ) { const char * fpr = item->key().primaryFingerprint(); - item->setSelected( fpr && fprs.find( fpr ) != fprs.end() ); + item->setSelected( fpr && fprs.tqfind( fpr ) != fprs.end() ); } } @@ -668,7 +668,7 @@ void CertManager::slotImportCertFromFile() { const TQString filter = "application/x-x509-ca-cert application/x-pkcs12 application/pkcs7-mime"; //const TQString filter = TQString("*.pem *.der *.p7c *.p12|") + i18n("Certificates (*.pem *.der *.p7c *.p12)"); - slotImportCertFromFile( KFileDialog::getOpenURL( TQString::null, filter, this, + slotImportCertFromFile( KFileDialog::getOpenURL( TQString(), filter, this, i18n( "Select Certificate File" ) ) ); } @@ -700,7 +700,7 @@ void CertManager::slotImportResult( KIO::Job* job ) updateImportActions( true ); } -static void showCertificateDownloadError( TQWidget * parent, const GpgME::Error & err, const TQString& certDisplayName ) { +static void showCertificateDownloadError( TQWidget * tqparent, const GpgME::Error & err, const TQString& certDisplayName ) { assert( err ); const TQString msg = i18n( "<qt><p>An error occurred while trying " "to download the certificate %1:</p>" @@ -708,7 +708,7 @@ static void showCertificateDownloadError( TQWidget * parent, const GpgME::Error .arg( certDisplayName ) .arg( TQString::fromLocal8Bit( err.asString() ) ); - KMessageBox::error( parent, msg, i18n( "Certificate Download Failed" ) ); + KMessageBox::error( tqparent, msg, i18n( "Certificate Download Failed" ) ); } void CertManager::slotDownloadCertificate() { @@ -745,7 +745,7 @@ void CertManager::slotStartCertificateDownload( const TQString& fingerprint, con TQString CertManager::displayNameForJob( const Kleo::Job *job ) { - JobsDisplayNameMap::iterator it = mJobsDisplayNameMap.find( job ); + JobsDisplayNameMap::iterator it = mJobsDisplayNameMap.tqfind( job ); TQString displayName; if ( it != mJobsDisplayNameMap.end() ) { displayName = *it; @@ -768,14 +768,14 @@ void CertManager::slotCertificateDownloadResult( const GpgME::Error & err, const disconnectJobFromStatusBarProgress( err ); } -static void showCertificateImportError( TQWidget * parent, const GpgME::Error & err, const TQString& certDisplayName ) { +static void showCertificateImportError( TQWidget * tqparent, const GpgME::Error & err, const TQString& certDisplayName ) { assert( err ); const TQString msg = i18n( "<qt><p>An error occurred while trying " "to import the certificate %1:</p>" "<p><b>%2</b></p></qt>" ) .arg( certDisplayName ) .arg( TQString::fromLocal8Bit( err.asString() ) ); - KMessageBox::error( parent, msg, i18n( "Certificate Import Failed" ) ); + KMessageBox::error( tqparent, msg, i18n( "Certificate Import Failed" ) ); } void CertManager::startCertificateImport( const TQByteArray & keyData, const TQString& certDisplayName ) { @@ -853,7 +853,7 @@ void CertManager::slotCertificateImportResult( const GpgME::ImportResult & res ) KMessageBox::information( this, i18n( "<qt><p>Detailed results of importing %1:</p>" "<table>%2</table></qt>" ) - .arg( displayName ).arg( lines.join( TQString::null ) ), + .arg( displayName ).arg( lines.join( TQString() ) ), i18n( "Certificate Import Result" ) ); disconnectJobFromStatusBarProgress( res.error() ); @@ -891,7 +891,7 @@ void CertManager::slotDirmngrExited() { void CertManager::importCRLFromFile() { // loadcrl can only work with DER encoded files (verified with dirmngr 1.0.3) TQString filter = TQString("*.crl *.arl *-crl.der *-arl.der|") + i18n("Certificate Revocation List, DER encoded (*.crl *.arl *-crl.der *-arl.der)"); - KURL url = KFileDialog::getOpenURL( TQString::null, + KURL url = KFileDialog::getOpenURL( TQString(), filter, this, i18n( "Select CRL File" ) ); @@ -929,7 +929,7 @@ bool CertManager::connectAndStartDirmngr( const char * slot, const char * proces assert( slot ); assert( processname ); assert( mDirmngrProc ); - mErrorbuffer = TQString::null; + mErrorbuffer = TQString(); connect( mDirmngrProc, TQT_SIGNAL(processExited(KProcess*)), slot ); connect( mDirmngrProc, TQT_SIGNAL(receivedStderr(KProcess*,char*,int) ), this, TQT_SLOT(slotStderr(KProcess*,char*,int)) ); @@ -944,7 +944,7 @@ bool CertManager::connectAndStartDirmngr( const char * slot, const char * proces void CertManager::startImportCRL( const TQString& filename, bool isTempFile ) { assert( !mDirmngrProc ); - mImportCRLTempFile = isTempFile ? filename : TQString::null; + mImportCRLTempFile = isTempFile ? filename : TQString(); mDirmngrProc = new KProcess(); *mDirmngrProc << "gpgsm" << "--call-dirmngr" << "loadcrl" << filename; if ( !connectAndStartDirmngr( TQT_SLOT(slotDirmngrExited()), "gpgsm" ) ) { @@ -998,13 +998,13 @@ void CertManager::slotClearCRLsResult() { delete mDirmngrProc; mDirmngrProc = 0; } -static void showDeleteError( TQWidget * parent, const GpgME::Error & err ) { +static void showDeleteError( TQWidget * tqparent, const GpgME::Error & err ) { assert( err ); const TQString msg = i18n("<qt><p>An error occurred while trying to delete " "the certificates:</p>" "<p><b>%1</b></p></qt>") .arg( TQString::fromLocal8Bit( err.asString() ) ); - KMessageBox::error( parent, msg, i18n("Certificate Deletion Failed") ); + KMessageBox::error( tqparent, msg, i18n("Certificate Deletion Failed") ); } static bool ByFingerprint( const GpgME::Key & left, const GpgME::Key & right ) { @@ -1201,13 +1201,13 @@ void CertManager::slotExportCertificate() { startCertificateExport( fingerprints ); } -static void showCertificateExportError( TQWidget * parent, const GpgME::Error & err ) { +static void showCertificateExportError( TQWidget * tqparent, const GpgME::Error & err ) { assert( err ); const TQString msg = i18n("<qt><p>An error occurred while trying to export " "the certificate:</p>" "<p><b>%1</b></p></qt>") .arg( TQString::fromLocal8Bit( err.asString() ) ); - KMessageBox::error( parent, msg, i18n("Certificate Export Failed") ); + KMessageBox::error( tqparent, msg, i18n("Certificate Export Failed") ); } void CertManager::startCertificateExport( const TQStringList & fingerprints ) { @@ -1258,7 +1258,7 @@ void CertManager::slotCertificateExportResult( const GpgME::Error & err, const T kdDebug() << "CertManager::slotCertificateExportResult(): got " << data.size() << " bytes" << endl; const TQString filter = TQString("*.pem|") + i18n("ASCII Armored Certificate Bundles (*.pem)"); - const KURL url = KFileDialog::getOpenURL( TQString::null, + const KURL url = KFileDialog::getOpenURL( TQString(), filter, this, i18n( "Save Certificate" ) ); @@ -1296,13 +1296,13 @@ void CertManager::slotExportSecretKey() { startSecretKeyExport( dlg.fingerprint() ); } -static void showSecretKeyExportError( TQWidget * parent, const GpgME::Error & err ) { +static void showSecretKeyExportError( TQWidget * tqparent, const GpgME::Error & err ) { assert( err ); const TQString msg = i18n("<qt><p>An error occurred while trying to export " "the secret key:</p>" "<p><b>%1</b></p></qt>") .arg( TQString::fromLocal8Bit( err.asString() ) ); - KMessageBox::error( parent, msg, i18n("Secret-Key Export Failed") ); + KMessageBox::error( tqparent, msg, i18n("Secret-Key Export Failed") ); } void CertManager::startSecretKeyExport( const TQString & fingerprint ) { @@ -1377,7 +1377,7 @@ void CertManager::slotSecretKeyExportResult( const GpgME::Error & err, const TQB kdDebug() << "CertManager::slotSecretKeyExportResult(): got " << data.size() << " bytes" << endl; TQString filter = TQString("*.p12|") + i18n("PKCS#12 Key Bundle (*.p12)"); - KURL url = KFileDialog::getOpenURL( TQString::null, + KURL url = KFileDialog::getOpenURL( TQString(), filter, this, i18n( "Save Certificate" ) ); |