From 19ef6524e14e2c318f0b88b2d348e1bf31c50cbe Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 24 Jan 2013 13:24:30 -0600 Subject: [PATCH] Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4 --- src/otrlchatinterface.cpp | 22 +++++++++++----------- src/otrlconfinterface.cpp | 6 +++--- src/otrplugin.cpp | 22 +++++++++++----------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/otrlchatinterface.cpp b/src/otrlchatinterface.cpp index 0ba2ce1..c181b29 100644 --- a/src/otrlchatinterface.cpp +++ b/src/otrlchatinterface.cpp @@ -181,7 +181,7 @@ static void new_fingerprint(void *opdata, OtrlUserState us, const char *accountn static void write_fingerprints(void *opdata){ kdDebug() << "Writing fingerprints" << endl; - otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); + otrl_privkey_write_fingerprints( userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); } static void gone_secure(void *opdata, ConnContext *context){ @@ -257,11 +257,11 @@ OtrlChatInterface::OtrlChatInterface(){ userstate = otrl_userstate_create(); - otrl_privkey_read( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); + otrl_privkey_read( userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); - otrl_privkey_read_fingerprints(userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL); + otrl_privkey_read_fingerprints(userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL); } @@ -504,7 +504,7 @@ void OtrlChatInterface::setTrust( Kopete::ChatSession *session, bool trust ){ otrl_context_set_trust( fingerprint, NULL ); } kdDebug() << "Writing fingerprints" << endl; - otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); + otrl_privkey_write_fingerprints( userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); OTRPlugin::plugin()->emitGoneSecure( session, privState( session ) ); } else { kdDebug() << "could not find fingerprint" << endl; @@ -555,7 +555,7 @@ bool OtrlChatInterface::isVerified( Kopete::ChatSession *session ){ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){ // Updating private keys from <=0.3 kdDebug() << "updating keys" << endl; - TQFile keyfile( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); + TQFile keyfile( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); TQString line; TQString file; @@ -576,13 +576,13 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){ keyfile.writeBlock( file.latin1(), file.length() ); keyfile.close(); otrl_privkey_forget_all( userstate ); - otrl_privkey_read( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); + otrl_privkey_read( userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); file = ""; line = ""; // Updating fingerprints from <=0.3 kdDebug() << "updating fingerprints" << endl; - TQFile fingerprintfile( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); + TQFile fingerprintfile( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); if( fingerprintfile.open( IO_ReadWrite ) ){ kdDebug() << "file open" << endl; @@ -600,7 +600,7 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){ fingerprintfile.writeBlock( file.latin1(), file.length() ); fingerprintfile.close(); otrl_context_forget_all( userstate ); - otrl_privkey_read_fingerprints(userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL); + otrl_privkey_read_fingerprints(userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints", NULL, NULL); } @@ -678,8 +678,8 @@ KeyGenThread::KeyGenThread( TQString accountname, TQString protocol ){ void KeyGenThread::run() { - kdDebug() << "Creating private key... Storing to: " + TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true)) + "privkeys" << endl; - otrl_privkey_generate(OtrlChatInterface::self()->getUserstate(), TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys", accountname, protocol); - OtrlChatInterface::self()->checkFilePermissions( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); + kdDebug() << "Creating private key... Storing to: " + TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true)) + "privkeys" << endl; + otrl_privkey_generate(OtrlChatInterface::self()->getUserstate(), TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys", accountname, protocol); + OtrlChatInterface::self()->checkFilePermissions( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); } diff --git a/src/otrlconfinterface.cpp b/src/otrlconfinterface.cpp index ff60bf2..cb025a4 100644 --- a/src/otrlconfinterface.cpp +++ b/src/otrlconfinterface.cpp @@ -63,7 +63,7 @@ OtrlConfInterface::~ OtrlConfInterface(){ /*********************** Functions for kcm module ************************/ TQString OtrlConfInterface::getPrivFingerprint( TQString accountId, TQString protocol){ -// if (otrl_privkey_read(userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" ) == 0){ +// if (otrl_privkey_read(userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" ) == 0){ char fingerprint[45]; if( otrl_privkey_fingerprint( userstate, fingerprint, accountId.latin1(), protocol.latin1()) != 0 ){ return fingerprint; @@ -149,7 +149,7 @@ void OtrlConfInterface::verifyFingerprint( TQString strFingerprint, bool trust ) otrl_context_set_trust( fingerprint, NULL ); } kdDebug() << "Writing fingerprints" << endl; - otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); + otrl_privkey_write_fingerprints( userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); } else { kdDebug() << "could not find fingerprint" << endl; } @@ -175,7 +175,7 @@ void OtrlConfInterface::forgetFingerprint( TQString strFingerprint ){ fingerprint = findFingerprint( strFingerprint ); otrl_context_forget_fingerprint( fingerprint, 1 ); - otrl_privkey_write_fingerprints( userstate, TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); + otrl_privkey_write_fingerprints( userstate, TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); } Fingerprint *OtrlConfInterface::findFingerprint( TQString strFingerprint ){ diff --git a/src/otrplugin.cpp b/src/otrplugin.cpp index e5571dd..7478c59 100644 --- a/src/otrplugin.cpp +++ b/src/otrplugin.cpp @@ -85,11 +85,11 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & / otrlChatInterface = OtrlChatInterface::self(); //update key files when an account is ready to use - if( TQFile::exists( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey" ) && - !TQFile::exists( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ) ){ + if( TQFile::exists( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey" ) && + !TQFile::exists( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ) ){ kdDebug() << "Detected old format keyfile. Doing updates!" << endl; kdDebug() << "Reading old keyfile..." << endl; - TQFile fpold( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" ); + TQFile fpold( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey" ); TQString line; TQString file; if( fpold.open( IO_ReadWrite ) ){ @@ -98,12 +98,12 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & / } } kdDebug() << "Writing new keyfile" << endl; - TQFile fpnew( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); + TQFile fpnew( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); fpnew.open( IO_ReadWrite ); fpnew.writeBlock( file.latin1(), file.length() ); fpnew.close(); kdDebug() << "Writing backup for old keyfile" << endl; - TQFile fpbup( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey.old" ); + TQFile fpbup( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkey.old" ); fpbup.open( IO_ReadWrite ); fpbup.writeBlock( file.latin1(), file.length() ); fpbup.close(); @@ -111,7 +111,7 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & / fpold.remove(); kdDebug() << "Reading old fingerprintsfile..." << endl; - TQFile fpfingerprintsold( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); + TQFile fpfingerprintsold( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints" ); line = ""; file = ""; if( fpfingerprintsold.open( IO_ReadWrite ) ){ @@ -120,7 +120,7 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & / } } kdDebug() << "Writing backup for old fingerprintsfile" << endl; - TQFile fpfingerprintsbup( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints.old" ); + TQFile fpfingerprintsbup( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "fingerprints.old" ); fpfingerprintsbup.open( IO_ReadWrite ); fpfingerprintsbup.writeBlock( file.latin1(), file.length() ); fpfingerprintsbup.close(); @@ -131,11 +131,11 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & / } // Checking file Permissions - OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ); - OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints" ); + OtrlChatInterface::self()->checkFilePermissions( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ); + OtrlChatInterface::self()->checkFilePermissions( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints" ); // Check also file permissions for eventuallly old beckup files - OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey.old" ); - OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints.old" ); + OtrlChatInterface::self()->checkFilePermissions( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey.old" ); + OtrlChatInterface::self()->checkFilePermissions( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "fingerprints.old" ); //setting the policy slotSettingsChanged();