Rename KGlobal, KProcess, and KClipboard to avoid conflicts with KDE4

pull/1/head
Timothy Pearson 12 years ago
parent 5d330b7729
commit 19ef6524e1

@ -181,7 +181,7 @@ static void new_fingerprint(void *opdata, OtrlUserState us, const char *accountn
static void write_fingerprints(void *opdata){ static void write_fingerprints(void *opdata){
kdDebug() << "Writing fingerprints" << endl; 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){ static void gone_secure(void *opdata, ConnContext *context){
@ -257,11 +257,11 @@ OtrlChatInterface::OtrlChatInterface(){
userstate = otrl_userstate_create(); 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 ); otrl_context_set_trust( fingerprint, NULL );
} }
kdDebug() << "Writing fingerprints" << endl; 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 ) ); OTRPlugin::plugin()->emitGoneSecure( session, privState( session ) );
} else { } else {
kdDebug() << "could not find fingerprint" << endl; kdDebug() << "could not find fingerprint" << endl;
@ -555,7 +555,7 @@ bool OtrlChatInterface::isVerified( Kopete::ChatSession *session ){
void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
// Updating private keys from <=0.3 // Updating private keys from <=0.3
kdDebug() << "updating keys" << endl; 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 line;
TQString file; TQString file;
@ -576,13 +576,13 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
keyfile.writeBlock( file.latin1(), file.length() ); keyfile.writeBlock( file.latin1(), file.length() );
keyfile.close(); keyfile.close();
otrl_privkey_forget_all( userstate ); 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 = ""; file = "";
line = ""; line = "";
// Updating fingerprints from <=0.3 // Updating fingerprints from <=0.3
kdDebug() << "updating fingerprints" << endl; 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 ) ){ if( fingerprintfile.open( IO_ReadWrite ) ){
kdDebug() << "file open" << endl; kdDebug() << "file open" << endl;
@ -600,7 +600,7 @@ void OtrlChatInterface::updateKeyfile( Kopete::Account *account ){
fingerprintfile.writeBlock( file.latin1(), file.length() ); fingerprintfile.writeBlock( file.latin1(), file.length() );
fingerprintfile.close(); fingerprintfile.close();
otrl_context_forget_all( userstate ); 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() void KeyGenThread::run()
{ {
kdDebug() << "Creating private key... Storing to: " + TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true)) + "privkeys" << endl; kdDebug() << "Creating private key... Storing to: " + TQString(TDEGlobal::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); otrl_privkey_generate(OtrlChatInterface::self()->getUserstate(), TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys", accountname, protocol);
OtrlChatInterface::self()->checkFilePermissions( TQString(KGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" ); OtrlChatInterface::self()->checkFilePermissions( TQString(TDEGlobal::dirs()->saveLocation("data", "kopete_otr/", true )) + "privkeys" );
} }

@ -63,7 +63,7 @@ OtrlConfInterface::~ OtrlConfInterface(){
/*********************** Functions for kcm module ************************/ /*********************** Functions for kcm module ************************/
TQString OtrlConfInterface::getPrivFingerprint( TQString accountId, TQString protocol){ 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]; char fingerprint[45];
if( otrl_privkey_fingerprint( userstate, fingerprint, accountId.latin1(), protocol.latin1()) != 0 ){ if( otrl_privkey_fingerprint( userstate, fingerprint, accountId.latin1(), protocol.latin1()) != 0 ){
return fingerprint; return fingerprint;
@ -149,7 +149,7 @@ void OtrlConfInterface::verifyFingerprint( TQString strFingerprint, bool trust )
otrl_context_set_trust( fingerprint, NULL ); otrl_context_set_trust( fingerprint, NULL );
} }
kdDebug() << "Writing fingerprints" << endl; 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 { } else {
kdDebug() << "could not find fingerprint" << endl; kdDebug() << "could not find fingerprint" << endl;
} }
@ -175,7 +175,7 @@ void OtrlConfInterface::forgetFingerprint( TQString strFingerprint ){
fingerprint = findFingerprint( strFingerprint ); fingerprint = findFingerprint( strFingerprint );
otrl_context_forget_fingerprint( fingerprint, 1 ); 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 ){ Fingerprint *OtrlConfInterface::findFingerprint( TQString strFingerprint ){

@ -85,11 +85,11 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & /
otrlChatInterface = OtrlChatInterface::self(); otrlChatInterface = OtrlChatInterface::self();
//update key files when an account is ready to use //update key files when an account is ready to use
if( TQFile::exists( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey" ) && if( TQFile::exists( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkey" ) &&
!TQFile::exists( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ) ){ !TQFile::exists( TQString( TDEGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ) ){
kdDebug() << "Detected old format keyfile. Doing updates!" << endl; kdDebug() << "Detected old format keyfile. Doing updates!" << endl;
kdDebug() << "Reading old keyfile..." << 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 line;
TQString file; TQString file;
if( fpold.open( IO_ReadWrite ) ){ if( fpold.open( IO_ReadWrite ) ){
@ -98,12 +98,12 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & /
} }
} }
kdDebug() << "Writing new keyfile" << endl; 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.open( IO_ReadWrite );
fpnew.writeBlock( file.latin1(), file.length() ); fpnew.writeBlock( file.latin1(), file.length() );
fpnew.close(); fpnew.close();
kdDebug() << "Writing backup for old keyfile" << endl; 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.open( IO_ReadWrite );
fpbup.writeBlock( file.latin1(), file.length() ); fpbup.writeBlock( file.latin1(), file.length() );
fpbup.close(); fpbup.close();
@ -111,7 +111,7 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & /
fpold.remove(); fpold.remove();
kdDebug() << "Reading old fingerprintsfile..." << endl; 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 = ""; line = "";
file = ""; file = "";
if( fpfingerprintsold.open( IO_ReadWrite ) ){ 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; 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.open( IO_ReadWrite );
fpfingerprintsbup.writeBlock( file.latin1(), file.length() ); fpfingerprintsbup.writeBlock( file.latin1(), file.length() );
fpfingerprintsbup.close(); fpfingerprintsbup.close();
@ -131,11 +131,11 @@ OTRPlugin::OTRPlugin( TQObject *parent, const char *name, const TQStringList & /
} }
// Checking file Permissions // Checking file Permissions
OtrlChatInterface::self()->checkFilePermissions( TQString( KGlobal::dirs()->saveLocation( "data", "kopete_otr/", true ) ) + "privkeys" ); OtrlChatInterface::self()->checkFilePermissions( TQString( TDEGlobal::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 ) ) + "fingerprints" );
// Check also file permissions for eventuallly old beckup files // 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( TDEGlobal::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 ) ) + "fingerprints.old" );
//setting the policy //setting the policy
slotSettingsChanged(); slotSettingsChanged();

Loading…
Cancel
Save