rpms/kdepim/F-10 kdepim-4.1.2-kabcdistlistupdater.patch, NONE, 1.1 kdepim.spec, 1.191, 1.192

Kevin Kofler kkofler at fedoraproject.org
Tue Oct 14 22:25:25 UTC 2008


Author: kkofler

Update of /cvs/pkgs/rpms/kdepim/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2206/F-10

Modified Files:
	kdepim.spec 
Added Files:
	kdepim-4.1.2-kabcdistlistupdater.patch 
Log Message:
* Tue Oct 14 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.1.2-3
- add converter for old kabc distribution lists (#464622)

kdepim-4.1.2-kabcdistlistupdater.patch:

--- NEW FILE kdepim-4.1.2-kabcdistlistupdater.patch ---
diff -Nur kdepim-4.1.2/kaddressbook/CMakeLists.txt kdepim-4.1.2-kabcdistlistupdater/kaddressbook/CMakeLists.txt
--- kdepim-4.1.2/kaddressbook/CMakeLists.txt	2008-08-28 10:07:44.000000000 +0200
+++ kdepim-4.1.2-kabcdistlistupdater/kaddressbook/CMakeLists.txt	2008-10-14 23:23:30.000000000 +0200
@@ -15,6 +15,7 @@
 add_subdirectory( pics ) 
 add_subdirectory( csv-templates ) 
 add_subdirectory( thumbnailcreator ) 
+add_subdirectory( kabcdistlistupdater ) 
 
 include_directories( 
 	${CMAKE_CURRENT_SOURCE_DIR}/interfaces 
diff -Nur kdepim-4.1.2/kaddressbook/kabcdistlistupdater/CMakeLists.txt kdepim-4.1.2-kabcdistlistupdater/kaddressbook/kabcdistlistupdater/CMakeLists.txt
--- kdepim-4.1.2/kaddressbook/kabcdistlistupdater/CMakeLists.txt	1970-01-01 01:00:00.000000000 +0100
+++ kdepim-4.1.2-kabcdistlistupdater/kaddressbook/kabcdistlistupdater/CMakeLists.txt	2008-10-14 23:37:32.000000000 +0200
@@ -0,0 +1,5 @@
+set(kabcdistlistupdater_SRCS kabcdistlistupdater.cpp)
+kde4_add_executable(kabcdistlistupdater ${kabcdistlistupdater_SRCS})
+target_link_libraries(kabcdistlistupdater ${KDE4_KDECORE_LIBS} kdepim)
+install(TARGETS kabcdistlistupdater ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(FILES  kabcdistlistupdater.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
diff -Nur kdepim-4.1.2/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.cpp kdepim-4.1.2-kabcdistlistupdater/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.cpp
--- kdepim-4.1.2/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.cpp	1970-01-01 01:00:00.000000000 +0100
+++ kdepim-4.1.2-kabcdistlistupdater/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.cpp	2008-10-15 00:15:08.000000000 +0200
@@ -0,0 +1,95 @@
+/*
+    This file is part of libkabc.
+    Copyright (c) 2008 Tobias Koenig <tokoe at kde.org>
+    Copyright (c) 2008 Kevin Kofler <kevin.kofler at chello.at>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public License
+    along with this library; see the file COPYING.LIB.  If not, write to
+    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301, USA.
+*/
+
+#include <QtCore/QCoreApplication>
+
+#include <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kconfig.h>
+#include <kconfiggroup.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+#include <kabc/stdaddressbook.h>
+#include <libkdepim/distributionlist.h>
+#include <krandom.h>
+
+void convertDistributionLists()
+{
+  KConfig cfg( KStandardDirs::locateLocal( "data", "kabc/distlists" ), KConfig::SimpleConfig );
+  const QMap<QString, QString> entryMap = cfg.entryMap( "DistributionLists" );
+
+  if ( entryMap.isEmpty() ) // nothing to convert
+    return;
+
+  QMap<QString, QString>::ConstIterator it;
+  for ( it = entryMap.begin(); it != entryMap.end(); ++it ) {
+    const QString listName = it.key();
+    const QStringList entries = it.value().split( ',', QString::KeepEmptyParts );
+
+    KPIM::DistributionList distList;
+    distList.setUid( KRandom::randomString( 10 ) );
+    distList.setName( listName );
+
+    if ( entries.count() > 1 ) {
+      for ( int i = 0; i < entries.count(); i += 2 ) {
+        const QString uid = entries[ i ];
+        const QString preferredEMail = entries[ i + 1 ];
+
+        distList.insertEntry( uid, preferredEMail );
+      }
+    }
+
+    KABC::StdAddressBook::self()->insertAddressee( distList );
+  }
+
+  KABC::StdAddressBook::save();
+}
+
+int main( int argc, char **argv )
+{
+  KAboutData aboutData( "kabcdistlistupdater", QByteArray(), ki18n( "Converter tool for distribution lists" ), "0.1" );
+  aboutData.addAuthor( ki18n( "Tobias Koenig" ), ki18n( "Author" ), "tokoe at kde.org" );
+  aboutData.addAuthor( ki18n( "Kevin Kofler" ), ki18n( "Porter" ), "kevin.kofler at chello.at" );
+
+  KCmdLineArgs::init( argc, argv, &aboutData );
+  KCmdLineOptions options;
+  options.add( "disable-autostart", ki18n( "Disable automatic startup on login" ) );
+  KCmdLineArgs::addCmdLineOptions( options );
+
+  QCoreApplication app( KCmdLineArgs::qtArgc(), KCmdLineArgs::qtArgv() );
+
+  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+  if ( args->isSet( "disable-autostart" ) ) {
+    kDebug() << "Disable autostart." << endl;
+
+    KSharedConfigPtr config = KGlobal::config();
+    KConfigGroup group( config, "Startup" );
+    group.writeEntry( "EnableAutostart", false );
+  }
+
+  convertDistributionLists();
+}
+
diff -Nur kdepim-4.1.2/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.desktop kdepim-4.1.2-kabcdistlistupdater/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.desktop
--- kdepim-4.1.2/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.desktop	1970-01-01 01:00:00.000000000 +0100
+++ kdepim-4.1.2-kabcdistlistupdater/kaddressbook/kabcdistlistupdater/kabcdistlistupdater.desktop	2008-10-14 23:16:15.000000000 +0200
@@ -0,0 +1,11 @@
+# KDE Config File
+[Desktop Entry]
+Name=kabcdistlistupdater
+Exec=kabcdistlistupdater --disable-autostart
+Icon=misc
+Type=Application
+Comment=Tool to update the old distribution lists to the new ones.
+Terminal=false
+NoDisplay=true
+X-KDE-autostart-condition=kabcdistlistupdaterrc:Startup:EnableAutostart:true
+OnlyShowIn=KDE;


Index: kdepim.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdepim/F-10/kdepim.spec,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -r1.191 -r1.192
--- kdepim.spec	7 Oct 2008 21:01:35 -0000	1.191
+++ kdepim.spec	14 Oct 2008 22:24:54 -0000	1.192
@@ -7,7 +7,7 @@
 Summary: PIM (Personal Information Manager) applications
 Epoch:   6
 Version: 4.1.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 
 License: GPLv2
 Group:   Applications/Productivity
@@ -94,7 +94,7 @@
 
 mkdir -p %{_target_platform}
 pushd %{_target_platform}
-%{cmake_kde4} --debug-output ..
+%{cmake_kde4} ..
 popd
 
 make %{?_smp_mflags} -C %{_target_platform} VERBOSE=1
@@ -176,6 +176,9 @@
 
 
 %changelog
+* Tue Oct 14 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.1.2-3
+- add converter for old kabc distribution lists (#464622)
+
 * Tue Oct 07 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> 4.1.2-2
 - rebuild for new gnokii
 




More information about the scm-commits mailing list