summaryrefslogtreecommitdiffabout
path: root/microkde/kdecore/klocale.cpp
Unidiff
Diffstat (limited to 'microkde/kdecore/klocale.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdecore/klocale.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/microkde/kdecore/klocale.cpp b/microkde/kdecore/klocale.cpp
index 1d8ae9f..dd310fa 100644
--- a/microkde/kdecore/klocale.cpp
+++ b/microkde/kdecore/klocale.cpp
@@ -1,5 +1,6 @@
1#include <qregexp.h> 1#include <qregexp.h>
2#include <qapplication.h> 2#include <qapplication.h>
3#include <QDesktopWidget>
3 4
4#include "kdebug.h" 5#include "kdebug.h"
5#include "kcalendarsystemgregorian.h" 6#include "kcalendarsystemgregorian.h"
@@ -11,8 +12,8 @@
11//#define COLLECT_TRANSLATION 12//#define COLLECT_TRANSLATION
12 13
13 14
14QDict<QString> *mLocaleDict = 0; 15Q3Dict<QString> *mLocaleDict = 0;
15void setLocaleDict( QDict<QString> * dict ) 16void setLocaleDict( Q3Dict<QString> * dict )
16{ 17{
17 mLocaleDict = dict; 18 mLocaleDict = dict;
18 19
@@ -45,7 +46,7 @@ void addExist(const char *text,QString trans )
45} 46}
46 47
47#include <qfile.h> 48#include <qfile.h>
48#include <qtextstream.h> 49#include <q3textstream.h>
49#include <qtextcodec.h> 50#include <qtextcodec.h>
50#endif 51#endif
51void dumpMissing() 52void dumpMissing()
@@ -53,10 +54,10 @@ void dumpMissing()
53#ifdef COLLECT_TRANSLATION 54#ifdef COLLECT_TRANSLATION
54 QString fileName = "/tmp/usernewtrans.txt"; 55 QString fileName = "/tmp/usernewtrans.txt";
55 QFile file( fileName ); 56 QFile file( fileName );
56 if (!file.open( IO_WriteOnly ) ) { 57 if (!file.open( QIODevice::WriteOnly ) ) {
57 return ; 58 return ;
58 } 59 }
59 QTextStream ts( &file ); 60 Q3TextStream ts( &file );
60 ts.setCodec( QTextCodec::codecForName("utf8") ); 61 ts.setCodec( QTextCodec::codecForName("utf8") );
61 62
62 int i; 63 int i;
@@ -70,10 +71,10 @@ void dumpMissing()
70 { 71 {
71 QString fileName = "/tmp/usertrans.txt"; 72 QString fileName = "/tmp/usertrans.txt";
72 QFile file( fileName ); 73 QFile file( fileName );
73 if (!file.open( IO_WriteOnly ) ) { 74 if (!file.open( QIODevice::WriteOnly ) ) {
74 return ; 75 return ;
75 } 76 }
76 QTextStream ts( &file ); 77 Q3TextStream ts( &file );
77 ts.setCodec( QTextCodec::codecForName("utf8") ); 78 ts.setCodec( QTextCodec::codecForName("utf8") );
78 79
79 int i; 80 int i;
@@ -467,7 +468,7 @@ QString KLocale::formatDateTime(const QDateTime &pDateTime,
467 format = "%1 %2"; 468 format = "%1 %2";
468 else if ( intIntDateFormat == Format1 ) 469 else if ( intIntDateFormat == Format1 )
469 format = "%1 %2"; 470 format = "%1 %2";
470 else if ( intIntDateFormat == ISODate ) 471 else if ( intIntDateFormat == Qt::ISODate )
471 format = "%1T%2"; 472 format = "%1T%2";
472 473
473 QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat )) 474 QString res = format.arg(formatDate( pDateTime.date(), shortFormat, intIntDateFormat ))
@@ -527,7 +528,7 @@ QDate KLocale::readDate(const QString &intstr, const QString &fmt, bool* ok) con
527 strpos++; 528 strpos++;
528 529
529 c = fmt.at(fmtpos++); 530 c = fmt.at(fmtpos++);
530 switch (c) 531 switch (c.unicode())
531 { 532 {
532 case 'a': 533 case 'a':
533 case 'A': 534 case 'A':
@@ -638,7 +639,7 @@ QTime KLocale::readTime(const QString &intstr, bool seconds, bool *ok) const
638 strpos++; 639 strpos++;
639 640
640 c = Format.at(Formatpos++); 641 c = Format.at(Formatpos++);
641 switch (c) 642 switch (c.unicode())
642 { 643 {
643 case 'p': 644 case 'p':
644 { 645 {
@@ -734,7 +735,7 @@ QDateTime KLocale::readDateTime(const QString &intstr,
734 QString tformat = timeFormat(intIntDateFormat); 735 QString tformat = timeFormat(intIntDateFormat);
735 736
736 QDate m_date = readDate(date, dformat, &ok1); 737 QDate m_date = readDate(date, dformat, &ok1);
737 QTime m_time = readTime(time, tformat, &ok2); 738 QTime m_time = readTime(time, !tformat.isEmpty(), &ok2);
738 739
739 QDateTime m_dt; 740 QDateTime m_dt;
740 741