summaryrefslogtreecommitdiffstats
path: root/kopete/kopete/tdeconf_update
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-27 01:04:58 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-27 01:04:58 -0600
commitb10a61b1fd2fe561ba61a384d4a344bae2a4aa29 (patch)
tree99dc6b2584265b2df91f7dbc1dcbf7a54efd205e /kopete/kopete/tdeconf_update
parent64c3be47ff36e40035ead93f913aeeb1e4f85e4b (diff)
downloadtdenetwork-b10a61b1fd2fe561ba61a384d4a344bae2a4aa29.tar.gz
tdenetwork-b10a61b1fd2fe561ba61a384d4a344bae2a4aa29.zip
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'kopete/kopete/tdeconf_update')
-rw-r--r--kopete/kopete/tdeconf_update/CMakeLists.txt64
-rw-r--r--kopete/kopete/tdeconf_update/Makefile.am32
-rwxr-xr-xkopete/kopete/tdeconf_update/kopete-account-0.10.pl26
-rw-r--r--kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp247
-rw-r--r--kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh10
-rw-r--r--kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd9
-rw-r--r--kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh2
-rw-r--r--kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd4
-rw-r--r--kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh2
-rw-r--r--kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd4
-rw-r--r--kopete/kopete/tdeconf_update/kopete-nameTracking.cpp135
-rw-r--r--kopete/kopete/tdeconf_update/kopete-nameTracking.upd3
-rwxr-xr-xkopete/kopete/tdeconf_update/kopete-pluginloader.pl28
-rw-r--r--kopete/kopete/tdeconf_update/kopete-pluginloader.upd4
-rw-r--r--kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp89
-rw-r--r--kopete/kopete/tdeconf_update/kopete-pluginloader2.sh10
-rw-r--r--kopete/kopete/tdeconf_update/kopete-pluginloader2.upd4
17 files changed, 673 insertions, 0 deletions
diff --git a/kopete/kopete/tdeconf_update/CMakeLists.txt b/kopete/kopete/tdeconf_update/CMakeLists.txt
new file mode 100644
index 00000000..342178f1
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/CMakeLists.txt
@@ -0,0 +1,64 @@
+#################################################
+#
+# (C) 2010-2011 Serghei Amelian
+# serghei (DOT) amelian (AT) gmail.com
+#
+# Improvements and feedback are welcome
+#
+# This file is released under GPL >= 2
+#
+#################################################
+
+add_definitions( -DKDE_NO_COMPAT )
+
+include_directories(
+ ${TDE_INCLUDE_DIR}
+ ${TQT_INCLUDE_DIRS}
+)
+
+link_directories(
+ ${TQT_LIBRARY_DIRS}
+)
+
+
+##### other data ################################
+
+install( FILES
+ kopete-pluginloader.upd kopete-account-tdeconf_update.upd
+ kopete-pluginloader2.upd kopete-jabberproxytype-tdeconf_update.upd
+ kopete-jabberpriorityaddition-tdeconf_update.upd
+ kopete-nameTracking.upd
+ DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
+
+install( PROGRAMS
+ kopete-pluginloader.pl kopete-jabberpriorityaddition-tdeconf_update.sh
+ kopete-pluginloader2.sh kopete-jabberproxytype-tdeconf_update.sh
+ kopete-account-0.10.pl kopete-account-tdeconf_update.sh
+ DESTINATION ${KCONF_UPDATE_INSTALL_DIR} )
+
+
+##### kopete_account_tdeconf_update (executable) ##
+
+tde_add_executable( "kopete-account-tdeconf_update"
+ SOURCES kopete-account-tdeconf_update.cpp
+ LINK ${TQT_LIBRARIES}
+ DESTINATION ${LIB_INSTALL_DIR}/tdeconf_update_bin
+)
+
+
+##### kopete_pluginloader2_tdeconf_update (executable)
+
+tde_add_executable( "kopete-pluginloader2-tdeconf_update"
+ SOURCES kopete-pluginloader2.cpp
+ LINK ${TQT_LIBRARIES}
+ DESTINATION ${LIB_INSTALL_DIR}/tdeconf_update_bin
+)
+
+
+##### kopete_nameTracking_tdeconf_update (executable)
+
+tde_add_executable( "kopete-nameTracking-tdeconf_update"
+ SOURCES kopete-nameTracking.cpp
+ LINK tdecore-shared
+ DESTINATION ${LIB_INSTALL_DIR}/tdeconf_update_bin
+)
diff --git a/kopete/kopete/tdeconf_update/Makefile.am b/kopete/kopete/tdeconf_update/Makefile.am
new file mode 100644
index 00000000..8c4b949e
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/Makefile.am
@@ -0,0 +1,32 @@
+AM_CPPFLAGS = -DKDE_NO_COMPAT -DQT_NO_COMPAT $(all_includes)
+
+update_DATA = kopete-pluginloader.upd kopete-account-tdeconf_update.upd \
+ kopete-pluginloader2.upd kopete-jabberproxytype-tdeconf_update.upd \
+ kopete-jabberpriorityaddition-tdeconf_update.upd kopete-nameTracking.upd
+update_SCRIPTS = kopete-pluginloader.pl kopete-account-tdeconf_update.sh \
+ kopete-pluginloader2.sh kopete-jabberproxytype-tdeconf_update.sh \
+ kopete-jabberpriorityaddition-tdeconf_update.sh kopete-account-0.10.pl
+updatedir = $(kde_datadir)/tdeconf_update
+
+# The Qt app cannot go into kde_datadir, that is not portable.
+# install to kde_bindir/tdeconf_update_bin instead.
+# KDE 3.2 will allow tdeconf_update scripts to run directly from there,
+# but for us that's too late. Use the .sh script as a workaround.
+tdeconf_PROGRAMS = kopete-account-tdeconf_update kopete-pluginloader2-tdeconf_update \
+ kopete-nameTracking-tdeconf_update
+tdeconfdir = $(libdir)/tdeconf_update_bin
+
+kopete_account_tdeconf_update_SOURCES = kopete-account-tdeconf_update.cpp
+kopete_account_tdeconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor
+kopete_account_tdeconf_update_LDADD = $(LIB_QT)
+
+kopete_pluginloader2_tdeconf_update_SOURCES = kopete-pluginloader2.cpp
+kopete_pluginloader2_tdeconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor
+kopete_pluginloader2_tdeconf_update_LDADD = $(LIB_QT)
+
+kopete_nameTracking_tdeconf_update_SOURCES = kopete-nameTracking.cpp
+kopete_nameTracking_tdeconf_update_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor
+kopete_nameTracking_tdeconf_update_LDADD = $(LIB_QT) $(LIB_TDECORE)
+
+# vim: set noet:
+
diff --git a/kopete/kopete/tdeconf_update/kopete-account-0.10.pl b/kopete/kopete/tdeconf_update/kopete-account-0.10.pl
new file mode 100755
index 00000000..3925a52f
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-account-0.10.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+# Olivier Goffart <ogoffart @ tiscalinet.be>
+# License: GPL
+
+use strict;
+
+# This script rename old plugin datas key.
+# It remove the PlguinData_PLUGINID_ prefix from keys.
+
+# read the whole config file
+my $currentGroup = "";
+my %configFile;
+while ( <> ) {
+ chomp; # eat the trailing '\n'
+ next if ( /^$/ ); # skip empty lines
+ next if ( /^\#/ ); # skip comments
+ if ( /^\[/ ) { # group begin
+ $currentGroup = $_;
+ next;
+ } elsif ( $currentGroup =~ /^\[Account_/ and /^PluginData\_.+_(.+)=(.+)$/ )
+ {
+ print "$currentGroup\n$1=$2\n";
+ my ($key,$value) = split /=/;
+ print "# DELETE $currentGroup$key\n";
+ }
+}
diff --git a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp
new file mode 100644
index 00000000..42ba47f1
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.cpp
@@ -0,0 +1,247 @@
+/*
+ tdeconf_update app for migrating kopete 0.6.x accounts to 0.7. Code is
+ not up to my normal standards, but it does the job, and since it's
+ supposed to run exactly once on each system that's good enough for me :)
+
+ Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
+
+ Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include <tqmap.h>
+#include <tqtextstream.h>
+#include <tqregexp.h>
+
+static TQTextStream qcin ( stdin, IO_ReadOnly );
+static TQTextStream qcout( stdout, IO_WriteOnly );
+static TQTextStream qcerr( stderr, IO_WriteOnly );
+
+// Group cache. Yes, I know global vars are ugly :)
+bool needFlush = false;
+TQString accountId;
+TQString password;
+TQString autoConnect;
+TQString protocol;
+TQMap<TQString, TQString> pluginData;
+
+// Global vars to hold separate IRC vars until we have read all of them
+TQString ircNick;
+TQString ircServer;
+TQString ircPort;
+
+/*
+ * Function for (en/de)crypting strings for config file, taken from KMail
+ * Author: Stefan Taferner <taferner@alpin.or.at>
+ */
+TQString cryptStr(const TQString &aStr)
+{
+ TQString result;
+ for (unsigned int i = 0; i < aStr.length(); i++)
+ result += (aStr[i].unicode() < 0x20) ? aStr[i] :
+ TQChar(0x1001F - aStr[i].unicode());
+ return result;
+}
+
+void parseGroup( const TQString &group, const TQString &rawLine )
+{
+ // Groups that are converted can almost certainly be removed entirely
+
+ if ( group == "MSN" || group == "ICQ" || group == "Oscar" || group == "Gadu" || group == "Jabber" || group == "IRC" )
+ {
+ accountId = "EMPTY";
+ autoConnect = "true";
+
+ if ( group == "Oscar" )
+ protocol = "AIMProtocol";
+ else
+ protocol = group + "Protocol";
+
+ password = TQString();
+ pluginData.clear();
+
+ needFlush = true;
+
+ qcout << "# DELETEGROUP [" << group << "]" << endl;
+ }
+ else
+ {
+ // Groups we don't convert. Output the raw line instead.
+ qcout << rawLine << endl;
+ }
+}
+
+void parseKey( const TQString &group, const TQString &key, const TQString &value, const TQString &rawLine )
+{
+ //qcerr << "*** group='" << group << "'" << endl;
+ if ( group == "MSN" )
+ {
+ if ( key == "UserID" )
+ accountId = value;
+ else if ( key == "Password" )
+ password = value;
+ else if ( key == "AutoConnect" )
+ autoConnect = value;
+ else if ( key == "Nick" )
+ pluginData[ "displayName" ] = value;
+
+ // All other keys are ignored for MSN, as these apply to stuff that's
+ // now in libkopete (and the main app) instead.
+ }
+ else if ( group == "ICQ" )
+ {
+ if ( key == "UIN" )
+ accountId = value;
+ else if ( key == "Password" )
+ password = value;
+ else if ( key == "AutoConnect" )
+ autoConnect = value;
+ else if ( key == "Nick" )
+ pluginData[ "NickName" ] = value;
+ else if ( key == "Server" )
+ pluginData[ key ] = value;
+ else if ( key == "Port" )
+ pluginData[ key ] = value;
+ }
+ else if ( group == "Oscar" )
+ {
+ if ( key == "ScreenName" )
+ accountId = value;
+ else if ( key == "Password" )
+ password = value;
+ else if ( key == "Server" )
+ pluginData[ key ] = value;
+ else if ( key == "Port" )
+ pluginData[ key ] = value;
+ }
+ else if ( group == "Jabber" )
+ {
+ if ( key == "UserID" )
+ accountId = value;
+ else if ( key == "Password" )
+ password = value;
+ if ( key == "Server" ||
+ key == "Port" || key == "UseSSL" || key == "Resource" )
+ pluginData[ key ] = value;
+ }
+ else if ( group == "Gadu" )
+ {
+ if ( key == "UIN" )
+ accountId = value;
+ else if ( key == "Password" )
+ password = value;
+ else if ( key == "Nick" )
+ pluginData[ "displayName" ] = value;
+ }
+ else if ( group == "IRC" )
+ {
+ if ( key == "Nickname" )
+ ircNick = value;
+ if ( key == "Server" )
+ ircServer = value;
+ if ( key == "Port" )
+ ircPort = value;
+ if ( accountId == "EMPTY" &&
+ !ircNick.isEmpty( ) && !ircServer.isEmpty() &&
+ !ircPort.isEmpty() )
+ {
+ accountId = TQString::fromLatin1( "%1@%2:%3" ).arg( ircNick, ircServer, ircPort );
+ }
+ }
+ /*
+ fixme: insert all other plugins here - martijn
+ */
+ else if ( key == "Modules" )
+ {
+ TQString newValue = value;
+ newValue.replace ( ".plugin", ".desktop" );
+ qcout << "Plugins=" << newValue;
+ }
+ else
+ {
+ // groups we don't convert. output the raw line instead.
+ qcout << rawLine << endl;
+ }
+}
+
+void flushData( const TQString &group )
+{
+
+ qcout << "[Account_" << protocol << "_" << accountId << "]" << endl;
+ qcout << "Protocol=" << protocol << endl;
+
+ if( group == "Jabber" )
+ qcout << "AccountId=" << accountId << "@" << pluginData["Server"] << endl;
+ else
+ qcout << "AccountId=" << accountId << endl;
+
+ qcout << "Password=" << cryptStr( password ) << endl;
+ qcout << "AutoConnect=" << autoConnect << endl;
+
+ TQMap<TQString, TQString>::ConstIterator it;
+ for ( it = pluginData.begin(); it != pluginData.end(); ++it )
+ qcout << "PluginData_" << protocol << "_" << it.key() << "=" << it.data() << endl;
+
+}
+
+int main()
+{
+ qcin.setEncoding( TQTextStream::UnicodeUTF8 );
+ qcout.setEncoding( TQTextStream::UnicodeUTF8 );
+
+ TQString curGroup;
+
+ TQRegExp groupRegExp( "^\\[(.*)\\]" );
+ TQRegExp keyRegExp( "^([a-zA-Z0-9:, _-]*)\\s*=\\s*(.*)\\s*" );
+ TQRegExp commentRegExp( "^(#.*)?$" );
+
+ while ( !qcin.atEnd() )
+ {
+ TQString line = qcin.readLine();
+
+ if ( commentRegExp.exactMatch( line ) )
+ {
+ // We found a comment, leave unchanged
+ qcout << line << endl;
+ }
+ else if ( groupRegExp.exactMatch( line ) )
+ {
+ // We found the start of a group, parse it
+ if ( needFlush )
+ {
+ // ... but we were already working on a group, so finish what
+ // we were doing - flush existing group first
+ flushData ( curGroup );
+ needFlush = false;
+ }
+
+ curGroup = groupRegExp.capturedTexts()[ 1 ];
+ parseGroup( curGroup, line );
+ }
+ else if ( keyRegExp.exactMatch( line ) )
+ {
+ // We found the a key line
+ parseKey( curGroup, keyRegExp.capturedTexts()[ 1 ], keyRegExp.capturedTexts()[ 2 ], line );
+ }
+ else
+ {
+ qcerr << "** Unknown input line: " << line << endl;
+ }
+ }
+
+ if ( needFlush )
+ flushData ( curGroup );
+
+ return 0;
+}
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh
new file mode 100644
index 00000000..c9a1bcfc
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+IFS=:
+SUFF=tdeconf_update_bin/kopete-account-tdeconf_update
+for path in `tde-config --path lib`; do
+ if test -x "$path/$SUFF"; then
+ exec "$path/$SUFF"
+ fi
+done
+
diff --git a/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd
new file mode 100644
index 00000000..d48aeed1
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-account-tdeconf_update.upd
@@ -0,0 +1,9 @@
+Id=kopete0.7/r1
+File=kopeterc
+Script=kopete-account-tdeconf_update.sh,sh
+
+#remove the PluginData_ProtocolID_ prefix from config keys
+Id=kopete0.10/r1
+File=kopeterc
+Script=kopete-account-0.10.pl,perl
+
diff --git a/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh
new file mode 100644
index 00000000..2ba47416
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+sed -e 's/^\(PluginData_JabberProtocol_Resource=.*\)$/\1\nPluginData_JabberProtocol_Priority=5/'
diff --git a/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd
new file mode 100644
index 00000000..7fd7d586
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-jabberpriorityaddition-tdeconf_update.upd
@@ -0,0 +1,4 @@
+Id=kopete0.9/r1
+File=kopeterc
+Script=kopete-jabberpriorityaddition-tdeconf_update.sh,sh
+
diff --git a/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh
new file mode 100644
index 00000000..3cbf8a55
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+sed "s/PluginData_JabberProtocol_ProxyType=SOCKS4/PluginData_JabberProtocol_ProxyType=SOCKS/" | sed "s/PluginData_JabberProtocol_ProxyType=SOCKS5/PluginData_JabberProtocol_ProxyType=SOCKS/"
diff --git a/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd
new file mode 100644
index 00000000..efc15155
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-jabberproxytype-tdeconf_update.upd
@@ -0,0 +1,4 @@
+Id=kopete0.9/r1
+File=kopeterc
+Script=kopete-jabberproxytype-tdeconf_update.sh,sh
+
diff --git a/kopete/kopete/tdeconf_update/kopete-nameTracking.cpp b/kopete/kopete/tdeconf_update/kopete-nameTracking.cpp
new file mode 100644
index 00000000..ee1f3f93
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-nameTracking.cpp
@@ -0,0 +1,135 @@
+/*
+ tdeconf_update app for updating the contactlist format ( <= 0.9.0) for MetaContacts to
+ track the name of a subcontact.
+
+ Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include <tqdir.h>
+#include <tqtextstream.h>
+#include <tqdom.h>
+
+#include <kstandarddirs.h>
+
+static TQTextStream qcerr( stderr, IO_WriteOnly );
+
+int main()
+{
+ TDEInstance* inst = new TDEInstance( "Update script" );
+ TQString filename = locateLocal( "data", TQString::fromLatin1( "kopete/contactlist.xml" ) );
+
+ // Load contact list & save backup.
+ TQFile contactListFile( filename );
+ contactListFile.open( IO_ReadOnly );
+ TQDomDocument contactList;
+ contactList.setContent( &contactListFile );
+ contactListFile.close();
+ TQDir().rename( filename, filename + TQString::fromLatin1( ".bak" ) );
+
+ // parse the XML file
+ TQDomElement list = contactList.documentElement();
+ TQDomElement mcElement = list.firstChild().toElement();
+
+ while( !mcElement.isNull() )
+ {
+
+ // update all the MetaContacts
+ if( mcElement.tagName() == TQString::fromLatin1("meta-contact") )
+ {
+ TQDomElement displayName;
+ TQDomElement subcontact;
+
+ TQDomElement elem = mcElement.firstChild().toElement();
+ while( !elem.isNull() )
+ {
+ if( elem.tagName() == TQString::fromLatin1( "display-name" ) )
+ displayName = elem;
+ if( elem.tagName() == TQString::fromLatin1( "plugin-data" ) )
+ {
+ // check if it's a contact by checking for "protocol" substring in the tag,
+ // and the presence of a contactId child element.
+ TQString pluginId = elem.attribute( TQString::fromLatin1( "plugin-id" ) );
+ bool isProtocol = ( pluginId.contains( "protocol", false ) > 0 ); // case-insensitive search
+ bool hasContactId = false;
+ TQDomNode field = elem.firstChild();
+ while( !field.isNull() )
+ {
+ TQDomElement fieldElem = field.toElement();
+
+ if( !fieldElem.isNull() &&
+ fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) &&
+ fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) )
+ {
+ hasContactId = true;
+ break;
+ }
+ field = field.nextSibling();
+ }
+
+ if( isProtocol && hasContactId )
+ subcontact = elem;
+ }
+
+ elem = elem.nextSibling().toElement();
+ } // end while
+
+ // check if we're even tracking the subcontact's name
+ // if displayName.isNull(), it simply won't find the attribute; no harm done
+ bool tracking =
+ ( displayName.attribute( TQString::fromLatin1( "trackChildNameChanges" ),
+ TQString::fromLatin1( "0" ) ) == TQString::fromLatin1( "1" ) );
+ if( !displayName.isNull() && !subcontact.isNull() && tracking )
+ {
+ // collect info
+ TQString nsCID;
+ TQString nsPID;
+ TQString nsAID;
+
+ nsPID = subcontact.attribute( TQString::fromLatin1( "plugin-id" ) );
+ TQDomNode field = subcontact.firstChild();
+ while( !field.isNull() )
+ {
+ TQDomElement fieldElem = field.toElement();
+
+ if( !fieldElem.isNull() && fieldElem.tagName() == TQString::fromLatin1( "plugin-data-field" ) )
+ {
+ if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "contactId" ) )
+ nsCID = fieldElem.text();
+ if( fieldElem.attribute( TQString::fromLatin1( "key" ) ) == TQString::fromLatin1( "accountId" ) )
+ nsAID = fieldElem.text();
+ }
+ field = field.nextSibling();
+ }
+
+ // create the tracking info
+ displayName.setAttribute( TQString::fromLatin1( "nameSourceContactId" ), nsCID );
+ displayName.setAttribute( TQString::fromLatin1( "nameSourcePluginId" ), nsPID );
+ displayName.setAttribute( TQString::fromLatin1( "nameSourceAccountId" ), nsAID );
+ }
+ }
+
+ mcElement = mcElement.nextSibling().toElement();
+ }
+
+ // Save converted contactlist
+ contactListFile.open( IO_WriteOnly );
+ TQTextStream stream( &contactListFile );
+ stream.setEncoding( TQTextStream::UnicodeUTF8 );
+ stream << contactList.toString( 4 );
+ contactListFile.flush();
+ contactListFile.close();
+
+ return 0;
+}
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/kopete/tdeconf_update/kopete-nameTracking.upd b/kopete/kopete/tdeconf_update/kopete-nameTracking.upd
new file mode 100644
index 00000000..62dd9538
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-nameTracking.upd
@@ -0,0 +1,3 @@
+Id=kopete0.9/r1
+File=kopeterc
+Script=kopete-nameTracking-tdeconf_update
diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader.pl b/kopete/kopete/tdeconf_update/kopete-pluginloader.pl
new file mode 100755
index 00000000..19709d3a
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-pluginloader.pl
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+my $logging = "false";
+my $moduleLine;
+
+while( my $line = <> )
+{
+ if( $line =~ /LogAll/ )
+ {
+ $logging = "true";
+ }
+ if( $line =~ /^Modules=/ )
+ {
+ $moduleLine = $line;
+ }
+}
+
+$moduleLine =~ s/^Modules/Plugins/;
+$moduleLine =~ s/\.plugin/\.desktop/g;
+$moduleLine =~ s/oscar/aim/;
+if ( $logging == "true" )
+{
+ chomp $moduleLine;
+ $moduleLine = $moduleLine . ",history.desktop\n";
+}
+print $moduleLine;
+
+print "# DELETE Modules\n";
+
diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader.upd b/kopete/kopete/tdeconf_update/kopete-pluginloader.upd
new file mode 100644
index 00000000..cc739414
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-pluginloader.upd
@@ -0,0 +1,4 @@
+Id=kopete0.7/r1
+File=kopeterc
+Script=kopete-pluginloader.pl,perl
+
diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp b/kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp
new file mode 100644
index 00000000..cf96144b
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-pluginloader2.cpp
@@ -0,0 +1,89 @@
+/*
+ tdeconf_update app for migrating the list of loaded plugins in
+ kopete 0.7.x to the new KPluginSelector format.
+
+ Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
+
+ Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * This library is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU Lesser General Public *
+ * License as published by the Free Software Foundation; either *
+ * version 2 of the License, or (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include <tqtextstream.h>
+#include <tqregexp.h>
+
+static TQTextStream qcin ( stdin, IO_ReadOnly );
+static TQTextStream qcout( stdout, IO_WriteOnly );
+static TQTextStream qcerr( stderr, IO_WriteOnly );
+
+void parseKey( const TQString &group, const TQString &key, const TQString &value, const TQString &rawLine )
+{
+ //qcerr << "*** group='" << group << "'" << endl;
+ if ( group.isEmpty() && key == "Plugins" )
+ {
+ TQStringList plugins = TQStringList::split( ',', value );
+ if ( !plugins.isEmpty() )
+ {
+ qcout << "[Plugins]" << endl;
+ for ( TQStringList::Iterator it = plugins.begin(); it != plugins.end(); ++it )
+ qcout << "kopete_" << ( *it ).remove( ".desktop" ) << "Enabled=true" << endl;
+ }
+ qcout << "# DELETE []Plugins" << endl;
+ }
+ else
+ {
+ // groups we don't convert. output the raw line instead.
+ qcout << rawLine << endl;
+ }
+}
+
+int main()
+{
+ qcin.setEncoding( TQTextStream::UnicodeUTF8 );
+ qcout.setEncoding( TQTextStream::UnicodeUTF8 );
+
+ TQString curGroup;
+
+ TQRegExp groupRegExp( "^\\[(.*)\\]" );
+ TQRegExp keyRegExp( "^([a-zA-Z0-9:, _-]*)\\s*=\\s*(.*)\\s*" );
+ TQRegExp commentRegExp( "^(#.*)?$" );
+
+ while ( !qcin.atEnd() )
+ {
+ TQString line = qcin.readLine();
+
+ if ( commentRegExp.exactMatch( line ) )
+ {
+ // We found a comment, leave unchanged
+ qcout << line << endl;
+ }
+ else if ( groupRegExp.exactMatch( line ) )
+ {
+ // We found the start of a group, leave unchanged
+ qcout << line << endl;
+
+ curGroup = groupRegExp.capturedTexts()[ 1 ];
+ }
+ else if ( keyRegExp.exactMatch( line ) )
+ {
+ // We found the a key line
+ parseKey( curGroup, keyRegExp.capturedTexts()[ 1 ], keyRegExp.capturedTexts()[ 2 ], line );
+ }
+ else
+ {
+ qcerr << "** Unknown input line: " << line << endl;
+ }
+ }
+
+ return 0;
+}
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader2.sh b/kopete/kopete/tdeconf_update/kopete-pluginloader2.sh
new file mode 100644
index 00000000..f858a72e
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-pluginloader2.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+IFS=:
+SUFF=tdeconf_update_bin/kopete-pluginloader2-tdeconf_update
+for path in `tde-config --path lib`; do
+ if test -x "$path/$SUFF"; then
+ exec "$path/$SUFF"
+ fi
+done
+
diff --git a/kopete/kopete/tdeconf_update/kopete-pluginloader2.upd b/kopete/kopete/tdeconf_update/kopete-pluginloader2.upd
new file mode 100644
index 00000000..3461c7a7
--- /dev/null
+++ b/kopete/kopete/tdeconf_update/kopete-pluginloader2.upd
@@ -0,0 +1,4 @@
+Id=kopete0.8/r1
+File=kopeterc
+Script=kopete-pluginloader2.sh,sh
+