rpms/kdepim/F-9 kdepim-3.5.10-kabcdistlistupdater.patch, NONE, 1.1 kdepim.spec, 1.172, 1.173

Kevin Kofler kkofler at fedoraproject.org
Mon Sep 29 19:33:30 UTC 2008


Author: kkofler

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

Modified Files:
	kdepim.spec 
Added Files:
	kdepim-3.5.10-kabcdistlistupdater.patch 
Log Message:
* Mon Sep 29 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> - 6:3.5.10-2
- add converter for old kabc distribution lists (#464622)

kdepim-3.5.10-kabcdistlistupdater.patch:

--- NEW FILE kdepim-3.5.10-kabcdistlistupdater.patch ---
Index: kabc/kabcdistlistupdater/kabcdistlistupdater.cpp
===================================================================
--- kabc/kabcdistlistupdater/kabcdistlistupdater.cpp	(revision 0)
+++ kabc/kabcdistlistupdater/kabcdistlistupdater.cpp	(revision 856958)
@@ -0,0 +1,95 @@
+/*
+    This file is part of libkabc.
+    Copyright (c) 2008 Tobias Koenig <tokoe at kde.org>
+
+    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 <kaboutdata.h>
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <ksimpleconfig.h>
+#include <kdebug.h>
+#include <kglobal.h>
+#include <klocale.h>
+#include <kstandarddirs.h>
+
+#include <kabc/stdaddressbook.h>
+#include <libkdepim/distributionlist.h>
+
+static const KCmdLineOptions options[] =
+{
+  { "disable-autostart", "Disable automatic startup on login", 0 },
+  KCmdLineLastOption
+};
+
+void convertDistributionLists()
+{
+  KSimpleConfig cfg( locateLocal( "data", "kabc/distlists" ) );
+  const QMap<QString, QString> entryMap = cfg.entryMap( "DistributionLists" );
+
+  if ( entryMap.isEmpty() ) // nothing to convert
+    return;
+
+  QMapConstIterator<QString, QString> it;
+  for ( it = entryMap.begin(); it != entryMap.end(); ++it ) {
+    const QString listName = it.key();
+    const QStringList entries = QStringList::split( ',', it.data(), true );
+
+    KPIM::DistributionList distList;
+    distList.setUid( KApplication::randomString( 10 ) );
+    distList.setName( listName );
+
+    if ( entries.count() > 1 ) {
+      for ( uint 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::self()->save();
+}
+
+int main( int argc, char **argv )
+{
+  KApplication::disableAutoDcopRegistration();
+
+  KAboutData aboutData( "kabcdistlistupdater", "Converter tool for distribution lists", "0.1" );
+  aboutData.addAuthor( "Tobias Koenig", 0, "tokoe at kde.org" );
+
+  KCmdLineArgs::init( argc, argv, &aboutData );
+  KCmdLineArgs::addCmdLineOptions( options );
+
+  KApplication app( false, false );
+
+  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
+
+  if ( args->isSet( "disable-autostart" ) ) {
+    kdDebug() << "Disable autostart." << endl;
+
+    KConfig *config = app.config();
+    config->setGroup( "Startup" );
+    config->writeEntry( "EnableAutostart", false );
+  }
+
+  convertDistributionLists();
+}
+
Index: kabc/kabcdistlistupdater/Makefile.am
===================================================================
--- kabc/kabcdistlistupdater/Makefile.am	(revision 0)
+++ kabc/kabcdistlistupdater/Makefile.am	(revision 856958)
@@ -0,0 +1,12 @@
+INCLUDES = -I$(includedir)/kabc -I$(top_srcdir) $(all_includes)
+
+METASOURCES = AUTO
+
+bin_PROGRAMS = kabcdistlistupdater
+
+kabcdistlistupdater_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+kabcdistlistupdater_LDADD = $(LIB_KABC) $(top_builddir)/libkdepim/libkdepim.la
+kabcdistlistupdater_SOURCES = kabcdistlistupdater.cpp
+
+autostart_DATA = kabcdistlistupdater.desktop
+autostartdir = $(datadir)/autostart
Index: kabc/kabcdistlistupdater/kabcdistlistupdater.desktop
===================================================================
--- kabc/kabcdistlistupdater/kabcdistlistupdater.desktop	(revision 0)
+++ kabc/kabcdistlistupdater/kabcdistlistupdater.desktop	(revision 856958)
@@ -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: kabc/Makefile.am
===================================================================
--- kabc/Makefile.am	(revision 856957)
+++ kabc/Makefile.am	(revision 856958)
@@ -1 +1,5 @@
-SUBDIRS = kabc2mutt
+if compile_newdistrlists
+KABCDISTLISTUPDATER=kabcdistlistupdater
+endif
+
+SUBDIRS = kabc2mutt $(KABCDISTLISTUPDATER)


Index: kdepim.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kdepim/F-9/kdepim.spec,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -r1.172 -r1.173
--- kdepim.spec	4 Sep 2008 09:14:38 -0000	1.172
+++ kdepim.spec	29 Sep 2008 19:33:00 -0000	1.173
@@ -17,12 +17,12 @@
 Summary: PIM (Personal Information Manager) applications
 Epoch:   6
 Version: 3.5.10
+Release: 2%{?dist}
 
 License: GPLv2
 Group:   Applications/Productivity
 URL:	 http://www.kde.org/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Release: 1%{?dist}
 Source0: ftp://ftp.kde.org/pub/kde/stable/%{version}/src/%{name}-%{version}.tar.bz2
 
 Source10: cr48-app-kandy.png
@@ -40,6 +40,11 @@
 # LANG=en_US.UTF-8 svn diff svn://anonsvn.kde.org/home/kde/tags/KDE/3.5.9/kdepim/kitchensync@774532 \
 # svn://anonsvn.kde.org/home/kde/branches/work/kitchensync-OpenSync0.30API@774532 >kdepim-3.5.9-opensync03.patch
 Patch3: kdepim-3.5.9-opensync03.patch
+# add converter for old kabc distribution lists
+# http://websvn.kde.org/?view=rev&revision=856958
+# http://bugs.kde.org/show_bug.cgi?id=170259
+# https://bugzilla.redhat.com/show_bug.cgi?id=464622
+Patch100: kdepim-3.5.10-kabcdistlistupdater.patch
 
 Provides: kdepim3 = %{version}-%{release}
 
@@ -141,6 +146,7 @@
 %patch2 -p1 -b .xdg_open
 %patch6 -p0 -b .gnokii
 %patch7 -p1 -b .metakit_sparc64
+%patch100 -p0 -b .kabcdistlistupdater
 
 %if 0%{?fedora} > 8
 pushd kitchensync
@@ -271,7 +277,10 @@
 
 
 %changelog
-* Mon Sep 01 2008 Than Ngo <than at redhat.com> 3.5.10-1
+* Mon Sep 29 2008 Kevin Kofler <Kevin at tigcc.ticalc.org> - 6:3.5.10-2
+- add converter for old kabc distribution lists (#464622)
+
+* Mon Sep 01 2008 Than Ngo <than at redhat.com> - 6:3.5.10-1
 - 3.5.10
 
 * Thu Jun 05 2008 Rex Dieter <rdieter at fedoraproject.org> - 6:3.5.9-10.1




More information about the fedora-extras-commits mailing list