diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:48:06 +0000 |
commit | 47c8a359c5276062c4bc17f0e82410f29081b502 (patch) | |
tree | 2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/plugins/cryptography/cryptographyplugin.cpp | |
parent | 6f82532777a35e0e60bbd2b290b2e93e646f349b (diff) | |
download | tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/plugins/cryptography/cryptographyplugin.cpp')
-rw-r--r-- | kopete/plugins/cryptography/cryptographyplugin.cpp | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/kopete/plugins/cryptography/cryptographyplugin.cpp b/kopete/plugins/cryptography/cryptographyplugin.cpp index 701ad8bd..4e2e9686 100644 --- a/kopete/plugins/cryptography/cryptographyplugin.cpp +++ b/kopete/plugins/cryptography/cryptographyplugin.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include <qstylesheet.h> -#include <qtimer.h> -#include <qregexp.h> +#include <tqstylesheet.h> +#include <tqtimer.h> +#include <tqregexp.h> #include <kdebug.h> #include <kaction.h> @@ -45,13 +45,13 @@ //In Jabber, the JEP says it's not. so we don't use richtext in our message, but some client did. //We limit the html to some basis tag to limit security problem (bad links) // - Olivier -const QRegExp CryptographyPlugin::isHTML( QString::fromLatin1( "^[^<>]*(</?(html|body|br|p|font|center|b|i|u|span|div|pre)(>|[\\s/][^><]*>)[^><]*)+$" ) , false ); +const TQRegExp CryptographyPlugin::isHTML( TQString::fromLatin1( "^[^<>]*(</?(html|body|br|p|font|center|b|i|u|span|div|pre)(>|[\\s/][^><]*>)[^><]*)+$" ) , false ); typedef KGenericFactory<CryptographyPlugin> CryptographyPluginFactory; static const KAboutData aboutdata("kopete_cryptography", I18N_NOOP("Cryptography") , "1.0" ); K_EXPORT_COMPONENT_FACTORY( kopete_cryptography, CryptographyPluginFactory( &aboutdata ) ) -CryptographyPlugin::CryptographyPlugin( QObject *parent, const char *name, const QStringList & /* args */ ) +CryptographyPlugin::CryptographyPlugin( TQObject *parent, const char *name, const TQStringList & /* args */ ) : Kopete::Plugin( CryptographyPluginFactory::instance(), parent, name ), m_cachedPass() { @@ -59,27 +59,27 @@ CryptographyPlugin::CryptographyPlugin( QObject *parent, const char *name, const pluginStatic_=this; m_inboundHandler = new Kopete::SimpleMessageHandlerFactory( Kopete::Message::Inbound, - Kopete::MessageHandlerFactory::InStageToSent, this, SLOT( slotIncomingMessage( Kopete::Message& ) ) ); + Kopete::MessageHandlerFactory::InStageToSent, this, TQT_SLOT( slotIncomingMessage( Kopete::Message& ) ) ); connect( Kopete::ChatSessionManager::self(), - SIGNAL( aboutToSend( Kopete::Message & ) ), - SLOT( slotOutgoingMessage( Kopete::Message & ) ) ); + TQT_SIGNAL( aboutToSend( Kopete::Message & ) ), + TQT_SLOT( slotOutgoingMessage( Kopete::Message & ) ) ); - m_cachedPass_timer = new QTimer(this, "m_cachedPass_timer" ); - QObject::connect(m_cachedPass_timer, SIGNAL(timeout()), this, SLOT(slotForgetCachedPass() )); + m_cachedPass_timer = new TQTimer(this, "m_cachedPass_timer" ); + TQObject::connect(m_cachedPass_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotForgetCachedPass() )); - KAction *action=new KAction( i18n("&Select Cryptography Public Key..."), "encrypted", 0, this, SLOT (slotSelectContactKey()), actionCollection() , "contactSelectKey"); - connect ( Kopete::ContactList::self() , SIGNAL( metaContactSelected(bool)) , action , SLOT(setEnabled(bool))); + KAction *action=new KAction( i18n("&Select Cryptography Public Key..."), "encrypted", 0, this, TQT_SLOT (slotSelectContactKey()), actionCollection() , "contactSelectKey"); + connect ( Kopete::ContactList::self() , TQT_SIGNAL( metaContactSelected(bool)) , action , TQT_SLOT(setEnabled(bool))); action->setEnabled(Kopete::ContactList::self()->selectedMetaContacts().count()==1 ); setXMLFile("cryptographyui.rc"); loadSettings(); - connect(this, SIGNAL(settingsChanged()), this, SLOT( loadSettings() ) ); + connect(this, TQT_SIGNAL(settingsChanged()), this, TQT_SLOT( loadSettings() ) ); - connect( Kopete::ChatSessionManager::self(), SIGNAL( chatSessionCreated( Kopete::ChatSession * )) , SLOT( slotNewKMM( Kopete::ChatSession * ) ) ); + connect( Kopete::ChatSessionManager::self(), TQT_SIGNAL( chatSessionCreated( Kopete::ChatSession * )) , TQT_SLOT( slotNewKMM( Kopete::ChatSession * ) ) ); //Add GUI action to all already existing kmm (if the plugin is launched when kopete already rining) - QValueList<Kopete::ChatSession*> sessions = Kopete::ChatSessionManager::self()->sessions(); - for (QValueListIterator<Kopete::ChatSession*> it= sessions.begin(); it!=sessions.end() ; ++it) + TQValueList<Kopete::ChatSession*> sessions = Kopete::ChatSessionManager::self()->sessions(); + for (TQValueListIterator<Kopete::ChatSession*> it= sessions.begin(); it!=sessions.end() ; ++it) { slotNewKMM(*it); } @@ -117,12 +117,12 @@ CryptographyPlugin* CryptographyPlugin::plugin() CryptographyPlugin* CryptographyPlugin::pluginStatic_ = 0L; -QCString CryptographyPlugin::cachedPass() +TQCString CryptographyPlugin::cachedPass() { return pluginStatic_->m_cachedPass; } -void CryptographyPlugin::setCachedPass(const QCString& p) +void CryptographyPlugin::setCachedPass(const TQCString& p) { if(pluginStatic_->mCacheMode==Never) return; @@ -144,7 +144,7 @@ bool CryptographyPlugin::passphraseHandling() m_actionCollection = new KActionCollection(this); KAction *actionTranslate = new KAction( i18n ("Translate"), 0, - this, SLOT( slotTranslateChat() ), m_actionCollection, "actionTranslate" ); + this, TQT_SLOT( slotTranslateChat() ), m_actionCollection, "actionTranslate" ); m_actionCollection->insert( actionTranslate ); m_currentChatSession=KMM; @@ -153,14 +153,14 @@ bool CryptographyPlugin::passphraseHandling() void CryptographyPlugin::slotIncomingMessage( Kopete::Message& msg ) { - QString body = msg.plainBody(); - if( !body.startsWith( QString::fromLatin1("-----BEGIN PGP MESSAGE----") ) - || !body.contains( QString::fromLatin1("-----END PGP MESSAGE----") ) ) + TQString body = msg.plainBody(); + if( !body.startsWith( TQString::fromLatin1("-----BEGIN PGP MESSAGE----") ) + || !body.contains( TQString::fromLatin1("-----END PGP MESSAGE----") ) ) return; if( msg.direction() != Kopete::Message::Inbound ) { - QString plainBody; + TQString plainBody; if ( m_cachedMessages.contains( body ) ) { plainBody = m_cachedMessages[ body ]; @@ -176,19 +176,19 @@ void CryptographyPlugin::slotIncomingMessage( Kopete::Message& msg ) //Check if this is a RTF message before escaping it if( !isHTML.exactMatch( plainBody ) ) { - plainBody = QStyleSheet::escape( plainBody ); + plainBody = TQStyleSheet::escape( plainBody ); //this is the same algoritm as in Kopete::Message::escapedBody(); - plainBody.replace( QString::fromLatin1( "\n" ), QString::fromLatin1( "<br/>" ) ) - .replace( QString::fromLatin1( "\t" ), QString::fromLatin1( " " ) ) - .replace( QRegExp( QString::fromLatin1( "\\s\\s" ) ), QString::fromLatin1( " " ) ); + plainBody.replace( TQString::fromLatin1( "\n" ), TQString::fromLatin1( "<br/>" ) ) + .replace( TQString::fromLatin1( "\t" ), TQString::fromLatin1( " " ) ) + .replace( TQRegExp( TQString::fromLatin1( "\\s\\s" ) ), TQString::fromLatin1( " " ) ); } - msg.setBody( QString::fromLatin1("<table width=\"100%\" border=0 cellspacing=0 cellpadding=0><tr><td class=\"highlight\"><font size=\"-1\"><b>") + msg.setBody( TQString::fromLatin1("<table width=\"100%\" border=0 cellspacing=0 cellpadding=0><tr><td class=\"highlight\"><font size=\"-1\"><b>") + i18n("Outgoing Encrypted Message: ") - + QString::fromLatin1("</b></font></td></tr><tr><td class=\"highlight\">") + + TQString::fromLatin1("</b></font></td></tr><tr><td class=\"highlight\">") + plainBody - + QString::fromLatin1(" </td></tr></table>") + + TQString::fromLatin1(" </td></tr></table>") , Kopete::Message::RichText ); } @@ -215,11 +215,11 @@ void CryptographyPlugin::slotIncomingMessage( Kopete::Message& msg ) body = Kopete::Message::escape( body ); } - msg.setBody( QString::fromLatin1("<table width=\"100%\" border=0 cellspacing=0 cellpadding=0><tr><td class=\"highlight\"><font size=\"-1\"><b>") + msg.setBody( TQString::fromLatin1("<table width=\"100%\" border=0 cellspacing=0 cellpadding=0><tr><td class=\"highlight\"><font size=\"-1\"><b>") + i18n("Incoming Encrypted Message: ") - + QString::fromLatin1("</b></font></td></tr><tr><td class=\"highlight\">") + + TQString::fromLatin1("</b></font></td></tr><tr><td class=\"highlight\">") + body - + QString::fromLatin1(" </td></tr></table>") + + TQString::fromLatin1(" </td></tr></table>") , Kopete::Message::RichText ); } @@ -230,11 +230,11 @@ void CryptographyPlugin::slotOutgoingMessage( Kopete::Message& msg ) if(msg.direction() != Kopete::Message::Outbound) return; - QStringList keys; - QPtrList<Kopete::Contact> contactlist = msg.to(); + TQStringList keys; + TQPtrList<Kopete::Contact> contactlist = msg.to(); for( Kopete::Contact *c = contactlist.first(); c; c = contactlist.next() ) { - QString tmpKey; + TQString tmpKey; if( c->metaContact() ) { if(c->metaContact()->pluginData( this, "encrypt_messages" ) == "off" ) @@ -251,7 +251,7 @@ void CryptographyPlugin::slotOutgoingMessage( Kopete::Message& msg ) if(mAlsoMyKey) //encrypt also with the self key keys.append( mPrivateKeyID ); - QString key = keys.join( " " ); + TQString key = keys.join( " " ); if(key.isEmpty()) { @@ -259,12 +259,12 @@ void CryptographyPlugin::slotOutgoingMessage( Kopete::Message& msg ) return; } - QString original=msg.plainBody(); + TQString original=msg.plainBody(); /* Code From KGPG */ ////////////////// encode from editor - QString encryptOptions=""; + TQString encryptOptions=""; //if (utrust==true) encryptOptions+=" --always-trust "; @@ -279,7 +279,7 @@ void CryptographyPlugin::slotOutgoingMessage( Kopete::Message& msg ) // if (selec==NULL) {KMessageBox::sorry(Kopete::UI::Global::mainWidget(),i18n("You have not chosen an encryption key..."));return;} - QString resultat=KgpgInterface::KgpgEncryptText(original,key,encryptOptions); + TQString resultat=KgpgInterface::KgpgEncryptText(original,key,encryptOptions); if (!resultat.isEmpty()) { msg.setBody(resultat,Kopete::Message::PlainText); @@ -295,7 +295,7 @@ void CryptographyPlugin::slotSelectContactKey() Kopete::MetaContact *m=Kopete::ContactList::self()->selectedMetaContacts().first(); if(!m) return; - QString key = m->pluginData( this, "gpgKey" ); + TQString key = m->pluginData( this, "gpgKey" ); CryptographySelectUserKey *opts = new CryptographySelectUserKey( key, m ); opts->exec(); if( opts->result() ) @@ -308,14 +308,14 @@ void CryptographyPlugin::slotSelectContactKey() void CryptographyPlugin::slotForgetCachedPass() { - m_cachedPass=QCString(); + m_cachedPass=TQCString(); m_cachedPass_timer->stop(); } void CryptographyPlugin::slotNewKMM(Kopete::ChatSession *KMM) { - connect(this , SIGNAL( destroyed(QObject*)) , - new CryptographyGUIClient(KMM) , SLOT(deleteLater())); + connect(this , TQT_SIGNAL( destroyed(TQObject*)) , + new CryptographyGUIClient(KMM) , TQT_SLOT(deleteLater())); } |