[Kst] branches/work/kst/kst1kde4/kst/src/extdate

Andrew Walker arwalker at sumusltd.com
Fri Jan 22 21:35:13 CET 2010


SVN commit 1078767 by arwalker:

build kstextdate for kde4

 M  +14 -14    kstextcalendarsystem.cpp  
 M  +49 -48    kstextcalendarsystemgregorian.cpp  
 D             kstextdatepicker.cpp  
 D             kstextdatepicker.h  
 D             kstextdatetbl.cpp  
 D             kstextdatetbl.h  
 M  +5 -5      kstextdatetime.cpp  
 M  +8 -8      kstextdatetime.h  
 D             kstextdatetimeedit.cpp  
 D             kstextdatetimeedit.h  
 D             kstextdatewidget.cpp  
 D             kstextdatewidget.h  


--- branches/work/kst/kst1kde4/kst/src/extdate/kstextcalendarsystem.cpp #1078766:1078767
@@ -128,24 +128,24 @@
   if ( shortName )
     switch ( weekDay )
       {
-      case 1:  return locale()->translate("Monday", "Mon");
-      case 2:  return locale()->translate("Tuesday", "Tue");
-      case 3:  return locale()->translate("Wednesday", "Wed");
-      case 4:  return locale()->translate("Thursday", "Thu");
-      case 5:  return locale()->translate("Friday", "Fri");
-      case 6:  return locale()->translate("Saturday", "Sat");
-      case 7:  return locale()->translate("Sunday", "Sun");
+      case 1:  return ki18n("Mon").toString(locale());
+      case 2:  return ki18n("Tue").toString(locale());
+      case 3:  return ki18n("Wed").toString(locale());
+      case 4:  return ki18n("Thu").toString(locale());
+      case 5:  return ki18n("Fri").toString(locale());
+      case 6:  return ki18n("Sat").toString(locale());
+      case 7:  return ki18n("Sun").toString(locale());
       }
   else
     switch ( weekDay )
       {
-      case 1:  return locale()->translate("Monday");
-      case 2:  return locale()->translate("Tuesday");
-      case 3:  return locale()->translate("Wednesday");
-      case 4:  return locale()->translate("Thursday");
-      case 5:  return locale()->translate("Friday");
-      case 6:  return locale()->translate("Saturday");
-      case 7:  return locale()->translate("Sunday");
+      case 1:  return ki18n("Monday").toString(locale());
+      case 2:  return ki18n("Tuesday").toString(locale());
+      case 3:  return ki18n("Wednesday").toString(locale());
+      case 4:  return ki18n("Thursday").toString(locale());
+      case 5:  return ki18n("Friday").toString(locale());
+      case 6:  return ki18n("Saturday").toString(locale());
+      case 7:  return ki18n("Sunday").toString(locale());
       }
 
   return QString::null;
--- branches/work/kst/kst1kde4/kst/src/extdate/kstextcalendarsystemgregorian.cpp #1078766:1078767
@@ -92,57 +92,57 @@
     switch ( month )
       {
       case 1:
-        return locale()->translate("January", "Jan");
+        return ki18n("Jan").toString(locale());
       case 2:
-        return locale()->translate("February", "Feb");
+        return ki18n("Feb").toString(locale());
       case 3:
-        return locale()->translate("March", "Mar");
+        return ki18n("Mar").toString(locale());
       case 4:
-        return locale()->translate("April", "Apr");
+        return ki18n("Apr").toString(locale());
       case 5:
-        return locale()->translate("May short", "May");
+        return ki18n("May").toString(locale());
       case 6:
-        return locale()->translate("June", "Jun");
+        return ki18n("Jun").toString(locale());
       case 7:
-        return locale()->translate("July", "Jul");
+        return ki18n("Jul").toString(locale());
       case 8:
-        return locale()->translate("August", "Aug");
+        return ki18n("Aug").toString(locale());
       case 9:
-        return locale()->translate("September", "Sep");
+        return ki18n("Sep").toString(locale());
       case 10:
-        return locale()->translate("October", "Oct");
+        return ki18n("Oct").toString(locale());
       case 11:
-        return locale()->translate("November", "Nov");
+        return ki18n("Nov").toString(locale());
       case 12:
-        return locale()->translate("December", "Dec");
+        return ki18n("Dec").toString(locale());
       }
   else
     switch ( month )
       {
       case 1:
-        return locale()->translate("January");
+        return ki18n("January").toString(locale());
       case 2:
-        return locale()->translate("February");
+        return ki18n("February").toString(locale());
       case 3:
-        return locale()->translate("March");
+        return ki18n("March").toString(locale());
       case 4:
-        return locale()->translate("April");
+        return ki18n("April").toString(locale());
       case 5:
-        return locale()->translate("May long", "May");
+        return ki18n("May").toString(locale());
       case 6:
-        return locale()->translate("June");
+        return ki18n("June").toString(locale());
       case 7:
-        return locale()->translate("July");
+        return ki18n("July").toString(locale());
       case 8:
-        return locale()->translate("August");
+        return ki18n("August").toString(locale());
       case 9:
-        return locale()->translate("September");
+        return ki18n("September").toString(locale());
       case 10:
-        return locale()->translate("October");
+        return ki18n("October").toString(locale());
       case 11:
-        return locale()->translate("November");
+        return ki18n("November").toString(locale());
       case 12:
-        return locale()->translate("December");
+        return ki18n("December").toString(locale());
       }
 
   return QString::null;
@@ -157,57 +157,58 @@
     switch ( month )
       {
       case 1:
-        return locale()->translate("of January", "of Jan");
+        return ki18n("of Jan").toString(locale());
       case 2:
-        return locale()->translate("of February", "of Feb");
+        return ki18n("of Feb").toString(locale());
       case 3:
-        return locale()->translate("of March", "of Mar");
+        return ki18n("of Mar").toString(locale());
       case 4:
-        return locale()->translate("of April", "of Apr");
+        return ki18n("of Apr").toString(locale());
       case 5:
-        return locale()->translate("of May short", "of May");
+        return ki18n("of May").toString(locale());
       case 6:
-        return locale()->translate("of June", "of Jun");
+        return ki18n("of Jun").toString(locale());
       case 7:
-        return locale()->translate("of July", "of Jul");
+        return ki18n("of Jul").toString(locale());
       case 8:
-        return locale()->translate("of August", "of Aug");
+        return ki18n("of Aug").toString(locale());
       case 9:
-        return locale()->translate("of September", "of Sep");
+        return ki18n("of Sep").toString(locale());
       case 10:
-        return locale()->translate("of October", "of Oct");
+        return ki18n("of Oct").toString(locale());
       case 11:
-       return locale()->translate("of November", "of Nov");
+        return ki18n("of Nov").toString(locale());
       case 12:
-        return locale()->translate("of December", "of Dec");
+        return ki18n("of Dec").toString(locale());
       }
   else
     switch ( month )
       {
       case 1:
-        return locale()->translate("of January");
+        return ki18n("of January").toString(locale());
       case 2:
-        return locale()->translate("of February");
+        return ki18n("of February").toString(locale());
       case 3:
-        return locale()->translate("of March");
+        return ki18n("of March").toString(locale());
       case 4:
-        return locale()->translate("of April");
+        return ki18n("of April").toString(locale());
       case 5:
-        return locale()->translate("of May long", "of May");
+        return ki18n("of May").toString(locale());
       case 6:
-        return locale()->translate("of June");
+        return ki18n("of June").toString(locale());
       case 7:
-        return locale()->translate("of July");
+        return ki18n("of July").toString(locale());
       case 8:
-        return locale()->translate("of August");
+        return ki18n("of August").toString(locale());
       case 9:
-        return locale()->translate("of September");
+        return ki18n("of September").toString(locale());
       case 10:
-        return locale()->translate("of October");
+        return ki18n("of October").toString(locale());
       case 11:
-        return locale()->translate("of November");
+        return ki18n("of November").toString(locale());
       case 12:
-        return locale()->translate("of December");
+        return ki18n("of December").toString(locale());
+
       }
 
   return QString::null;
--- branches/work/kst/kst1kde4/kst/src/extdate/kstextdatetime.cpp #1078766:1078767
@@ -403,7 +403,7 @@
 			//Three possible date formats:
 			//dd mth yyyy; mth dd yyyy; wkd mth dd yyyy
 			//"mth" is the word for the month (long or short form)
-			QStringList ss = QStringList::split( " ", s );
+			QStringList ss = s.split( " " );
 			bool ok = false;
 			int month = -1;
 			uint imonth = 0;
@@ -1003,7 +1003,7 @@
 {
     ExtDateTime dt;
     dt.setDate( ExtDate::currentDate(ts) );
-    QTime t = t.currentTime(ts);
+    QTime t = QTime::currentTime();
     if ( t.hour()==0 && t.minute()==0 )         // midnight or right after?
         dt.setDate( ExtDate::currentDate(ts) ); // fetch date again
     dt.setTime( t );
@@ -1060,7 +1060,7 @@
 		QTime time;
 		QString sd = s;
 		int hour, minute, second;
-		int pivot = s.find( QRegExp(QString::fromLatin1("[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")) );
+		int pivot = s.indexOf( QRegExp(QString::fromLatin1("[0-9][0-9]:[0-9][0-9]:[0-9][0-9]")) );
 		if ( pivot != -1 ) {
 			hour = s.mid( pivot, 2 ).toInt();
 			minute = s.mid( pivot+3, 2 ).toInt();
@@ -1084,12 +1084,12 @@
 #ifndef QT_NO_DATASTREAM
 QDataStream &operator<<( QDataStream & ostream, const ExtDate & date)
 {
-	return ostream << (Q_UINT32)(date.jd());
+	return ostream << (quint32)(date.jd());
 }
 
 QDataStream &operator>>( QDataStream & ostream, ExtDate & date)
 {
-	Q_UINT32 julday;
+	quint32 julday;
 	ostream >> julday;
 	date.setJD( julday );
 	return ostream;
--- branches/work/kst/kst1kde4/kst/src/extdate/kstextdatetime.h #1078766:1078767
@@ -120,10 +120,10 @@
 	friend class ExtDateTime;
 
 	#ifndef QT_NO_DATASTREAM
-	friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & );
-	friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & );
-	friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime & );
-	friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & );
+	friend Q_DECL_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & );
+	friend Q_DECL_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & );
+	friend Q_DECL_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime & );
+	friend Q_DECL_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & );
 #endif
 };
 
@@ -178,8 +178,8 @@
     ExtDate  d;
     QTime  t;
 #ifndef QT_NO_DATASTREAM
-    friend Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime &);
-    friend Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & );
+    friend Q_DECL_EXPORT QDataStream &operator<<( QDataStream &, const ExtDateTime &);
+    friend Q_DECL_EXPORT QDataStream &operator>>( QDataStream &, ExtDateTime & );
 #endif
 };
 
@@ -188,8 +188,8 @@
  *****************************************************************************/
 
 #ifndef QT_NO_DATASTREAM
-Q_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & );
-Q_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & );
+Q_DECL_EXPORT QDataStream &operator<<( QDataStream &, const ExtDate & );
+Q_DECL_EXPORT QDataStream &operator>>( QDataStream &, ExtDate & );
 #endif // QT_NO_DATASTREAM
 }
 


More information about the Kst mailing list