[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-pim
Subject: [Kde-pim] [PATCH] fixing i18n timezones in koprefsdialog.cpp
From: "Best, Jan-Pascal van" <j.p.vanbest () tbm ! tudelft ! nl>
Date: 2003-04-03 6:30:57
[Download RAW message or body]
Noburo Sinohara wrote:
> > > It seems that this is really a bug in the KOrganizer
> initialisation code.
> > > Sinohara san, could you please check the timezone
> settings of KOrganizer? Look
> > > in KOrganizer/Settings/Configure KOrganizer/Time&Date and
> check that the time
> > > zone is set correctly?
> > >
> >
> > Yes, But the 'Timezone' Combobox displays '???/Tokyo'.
> > (the language is japanese.)
> >
> > I checked translated message file 'timezones.po', but it
> also correctly translated.
> > I re-maked timezone.mo and relaced it, but anything did not chahged.
> >
> > Next, I changed the language setting to 'US English', and
> restarted korganizer.
> > In KOrganizer/Settings/Configure KOrganizer/Time&Date,
> > 'Timezone' combobox displayed 'No selection'!!.
> >
> > Then I selected 'Asia/Tokyo', and tried to download
> Exchange schedule.
> > The result was good!!.
> >
> > I checked korganizer source code,
> > and found some flaws.
> >
> > in void KOPrefsDialog::setupTimeTab(),
> > QStrList list;
> >
> > --- snip --
> >
> > 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.inSort(i18n(tempstring));
> > tzonenames << tempstring;
> > }
> > pclose(f);
> >
> > As you see, the variable 'list' is QStrList.
> > But in Qt3 API Document says.
> >
> > "The QStrList class provides a doubly-linked list of char*.
> > If you want a string list of QStrings use QStringList."
> >
> > this is fatal mistake, cause multibyte strings are not char* !!
> > so,this code will break all translated messages.
> >
>
> I wrote a patch. this works fine.
--- kdepim-3.1.1.org/korganizer/koprefsdialog.cpp Mon Mar 3 04:11:08 2003
+++ kdepim-3.1.1/korganizer/koprefsdialog.cpp Thu Apr 3 10:45:04 2003
@@ -209,7 +209,7 @@
char tempstring[101] = "Unknown";
QString sCurrentlySet(i18n("Unknown"));
int nCurrentlySet = 0;
- QStrList list;
+ QStringList list;
// read the currently set time zone
#if defined(USE_SOLARIS) // MARCO
@@ -251,7 +251,7 @@
while(fgets(buf, MAXPATHLEN - 1, f) != NULL)
{
buf[strlen(buf) - 1] = '\0';
- list.inSort(buf);
+ list.append(buf);
}
pclose(f);
}
@@ -261,13 +261,14 @@
if (!f) return;
while(fgets(tempstring, 100, f) != NULL) {
tempstring[strlen(tempstring)-1] = '\0';
- list.inSort(i18n(tempstring));
+ list.append(i18n(tempstring));
tzonenames << tempstring;
}
pclose(f);
#endif // !USE_SOLARIS
+ list.sort();
- mTimeZoneCombo->insertStrList(&list);
+ mTimeZoneCombo->insertStringList(list);
// find the currently set time zone and select it
for (int i = 0; i < mTimeZoneCombo->count(); i++)
It looks OK to me and compiles fine. Cornelius, OK to apply,
also to the 3.1 branch?
Jan-Pascal
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic