summaryrefslogtreecommitdiff
path: root/misc/kdepim3/patches
diff options
context:
space:
mode:
authormarkd <markd>2006-07-24 12:43:40 +0000
committermarkd <markd>2006-07-24 12:43:40 +0000
commit2756463923f78f99da9cfcc05411b72b978926d3 (patch)
tree270c9581dd2d0c8f5509cb47e3b2a3f38bb4f85a /misc/kdepim3/patches
parent879489cb0e9b521ae075a3104035de486e895fef (diff)
downloadpkgsrc-2756463923f78f99da9cfcc05411b72b978926d3.tar.gz
In korganiser use the KTimezone class rather than trying to deal with
timezones itself as that works on more systems. Bump PKGREVISION
Diffstat (limited to 'misc/kdepim3/patches')
-rw-r--r--misc/kdepim3/patches/patch-ao107
-rw-r--r--misc/kdepim3/patches/patch-ap35
2 files changed, 142 insertions, 0 deletions
diff --git a/misc/kdepim3/patches/patch-ao b/misc/kdepim3/patches/patch-ao
new file mode 100644
index 00000000000..f3cf9bae723
--- /dev/null
+++ b/misc/kdepim3/patches/patch-ao
@@ -0,0 +1,107 @@
+$NetBSD: patch-ao,v 1.1 2006/07/24 12:43:40 markd Exp $
+
+--- korganizer/koprefsdialog.cpp.orig 2005-09-10 20:24:47.000000000 +1200
++++ korganizer/koprefsdialog.cpp
+@@ -75,6 +75,7 @@
+ #include "stdcalendar.h"
+ #include <kdepimmacros.h>
+
++#include <ktimezones.h>
+
+ KOPrefsDialogMain::KOPrefsDialogMain( QWidget *parent, const char *name )
+ : KPrefsModule( KOPrefs::instance(), parent, name )
+@@ -169,67 +170,25 @@ class KOPrefsDialogTime : public KPrefsM
+ connect( mTimeZoneCombo, SIGNAL( activated( int ) ),
+ SLOT( slotWidChanged() ) );
+
+- FILE *f;
+- char tempstring[101] = "Unknown";
+- QString sCurrentlySet(i18n("Unknown"));
++ KTimezones *db;
++ const KTimezone *sCurrentlySet;
+ int nCurrentlySet = 0;
+ QStringList list;
+
++ db = new KTimezones();
+ // read the currently set time zone
+- #if defined(USE_SOLARIS) // MARCO
+- char buf[MAXPATHLEN];
+-
+- snprintf(buf, MAXPATHLEN,
+- "/bin/fgrep 'TZ=' %s | /bin/head -n 1 | /bin/cut -b 4-",
+- INITFILE);
+-
+- if (f = popen(buf, "r"))
+- {
+- if (fgets(buf, MAXPATHLEN - 1, f) != NULL)
+- {
+- buf[strlen(buf) - 1] = '\0';
+- sCurrentlySet = QString(buf);
+- }
+- pclose(f);
+- }
+- #else
+- if((f = fopen("/etc/timezone", "r")) != NULL) {
+- // get the currently set timezone
+- fgets(tempstring, 100, f);
+- tempstring[strlen(tempstring) - 1] = '\0';
+- sCurrentlySet = QString(tempstring);
+- fclose(f);
+- }
+- #endif // !USE_SOLARIS
++ sCurrentlySet = db->local();
+
+ mTimeZoneCombo->insertItem(i18n("[No selection]"));
+
+ // Read all system time zones
+- #if defined(USE_SOLARIS) // MARCO
+- snprintf(buf, MAXPATHLEN,
+- "/bin/find %s \\( -name src -prune \\) -o -type f -print | /bin/cut -b %d-",
+- ZONEINFODIR, strlen(ZONEINFODIR) + 2);
+-
+- if (f = popen(buf, "r"))
+- {
+- while(fgets(buf, MAXPATHLEN - 1, f) != NULL)
+- {
+- buf[strlen(buf) - 1] = '\0';
+- list.append(buf);
+- }
+- pclose(f);
+- }
+-
+- #else
+- f = popen("grep -e ^[^#] /usr/share/zoneinfo/zone.tab | cut -f 3","r");
+- if (!f) return;
+- while(fgets(tempstring, 100, f) != NULL) {
+- tempstring[strlen(tempstring)-1] = '\0';
+- list.append(i18n(tempstring));
+- tzonenames << tempstring;
++ const KTimezones::ZoneMap zones = db->allZones();
++ for (KTimezones::ZoneMap::ConstIterator it = zones.begin(); it != zones.end(); ++it)
++ {
++ const KTimezone *zone = it.data();
++ list.append(zone->name());
++ tzonenames << zone->name();
+ }
+- pclose(f);
+- #endif // !USE_SOLARIS
+ list.sort();
+
+ mTimeZoneCombo->insertStringList(list);
+@@ -237,7 +196,7 @@ class KOPrefsDialogTime : public KPrefsM
+ // find the currently set time zone and select it
+ for ( int i = 0; i < mTimeZoneCombo->count(); ++i )
+ {
+- if (mTimeZoneCombo->text(i) == sCurrentlySet)
++ if (mTimeZoneCombo->text(i) == sCurrentlySet->name())
+ {
+ nCurrentlySet = i;
+ break;
+@@ -246,6 +205,7 @@ class KOPrefsDialogTime : public KPrefsM
+
+ mTimeZoneCombo->setCurrentItem(nCurrentlySet);
+ QWhatsThis::add( mTimeZoneCombo, whatsThis );
++ delete db;
+
+ // holiday region selection
+ QHBox *holidayRegBox = new QHBox( topFrame );
diff --git a/misc/kdepim3/patches/patch-ap b/misc/kdepim3/patches/patch-ap
new file mode 100644
index 00000000000..a57d6610601
--- /dev/null
+++ b/misc/kdepim3/patches/patch-ap
@@ -0,0 +1,35 @@
+$NetBSD: patch-ap,v 1.1 2006/07/24 12:43:40 markd Exp $
+
+--- korganizer/koprefs.cpp.orig 2006-01-20 05:56:37.000000000 +1300
++++ korganizer/koprefs.cpp
+@@ -41,6 +41,7 @@
+ #include <kemailsettings.h>
+ #include <kstaticdeleter.h>
+ #include <kstringhandler.h>
++#include <ktimezones.h>
+
+ #include "koprefs.h"
+ #include <libkpimidentities/identitymanager.h>
+@@ -145,17 +146,12 @@ void KOPrefs::fillMailDefaults()
+ void KOPrefs::setTimeZoneIdDefault()
+ {
+ QString zone;
++ KTimezones *db;
+
+- char zonefilebuf[100];
+- int len = readlink("/etc/localtime",zonefilebuf,100);
+- if (len > 0 && len < 100) {
+- zonefilebuf[len] = '\0';
+- zone = zonefilebuf;
+- zone = zone.mid(zone.find("zoneinfo/") + 9);
+- } else {
+- tzset();
+- zone = tzname[0];
+- }
++ db = new KTimezones();
++
++ zone = (db->local())->name();
++ delete db;
+
+ kdDebug () << "----- time zone: " << zone << endl;
+