[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kontact/plugins
From:       Allen Winter <winter () kde ! org>
Date:       2008-07-08 23:56:36
Message-ID: 1215561396.077360.27342.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 829738 by winterz:

I can't figure a safe way to print the date in the locale without the year.
So, remove the hack that attempted to do this.
Should fix the bug where dates are incorrectly printed in the Japanese locale.


 M  +4 -10     korganizer/apptsummarywidget.cpp  
 M  +1 -8      korganizer/todosummarywidget.cpp  
 M  +1 -6      specialdates/sdsummarywidget.cpp  


--- trunk/KDE/kdepim/kontact/plugins/korganizer/apptsummarywidget.cpp #829737:829738
@@ -93,11 +93,6 @@
   //   the summary is the event summary
   //   the time range is the start-end time (only for non-floating events)
 
-  // No reason to show the date year
-  QString savefmt = KGlobal::locale()->dateFormat();
-  KGlobal::locale()->setDateFormat( KGlobal::locale()->
-                                    dateFormat().replace( 'Y', ' ' ) );
-
   QLabel *label = 0;
   int counter = 0;
 
@@ -187,14 +182,15 @@
                   ( sD.day()   == currentDate.addDays( 1 ).day() ) ) {
         str = i18nc( "@label the appointment is tomorrow", "Tomorrow" );
       } else {
-        str = KGlobal::locale()->formatDate( sD );
+        str = KGlobal::locale()->formatDate( sD, KLocale::FancyLongDate );
       }
 
       // Print the date span for multiday, floating events, for the
       // first day of the event only.
       if ( ev->isMultiDay() && ev->allDay() && dayof == 1 && span > 1 ) {
-        str = KGlobal::locale()->formatDate( ev->dtStart().date() );
-        str += " -\n " + KGlobal::locale()->formatDate( sD.addDays( span-1 ) );
+        str = KGlobal::locale()->formatDate( ev->dtStart().date(), KLocale::FancyLongDate );
+        str += " -\n " +
+               KGlobal::locale()->formatDate( sD.addDays( span-1 ), KLocale::FancyLongDate );
       }
 
       label = new QLabel( str, this );
@@ -283,8 +279,6 @@
 
   Q_FOREACH( label, mLabels )
   label->show();
-
-  KGlobal::locale()->setDateFormat( savefmt );
 }
 
 void ApptSummaryWidget::viewEvent( const QString &uid )
--- trunk/KDE/kdepim/kontact/plugins/korganizer/todosummarywidget.cpp #829737:829738
@@ -171,11 +171,6 @@
   //     open-ended
   //     not-started (no start date and 0% completed)
 
-  // No reason to show the date year
-  QString savefmt = KGlobal::locale()->dateFormat();
-  KGlobal::locale()->setDateFormat( KGlobal::locale()->
-                                    dateFormat().replace( 'Y', ' ' ) );
-
   int counter = 0;
   QLabel *label = 0;
 
@@ -208,7 +203,7 @@
         } else if ( daysTo == 1 ) {
           str = i18n( "Tomorrow" );
         } else {
-          str = KGlobal::locale()->formatDate( todo->dtDue().date() );
+          str = KGlobal::locale()->formatDate( todo->dtDue().date(), KLocale::FancyLongDate );
         }
       }
 
@@ -296,8 +291,6 @@
   Q_FOREACH( label, mLabels ) {
     label->show();
   }
-
-  KGlobal::locale()->setDateFormat( savefmt );
 }
 
 void TodoSummaryWidget::viewTodo( const QString &uid )
--- trunk/KDE/kdepim/kontact/plugins/specialdates/sdsummarywidget.cpp #829737:829738
@@ -232,10 +232,6 @@
   }
   mLabels.clear();
 
-  // No reason to show the date year
-  QString savefmt = KGlobal::locale()->dateFormat();
-  KGlobal::locale()->setDateFormat( KGlobal::locale()->dateFormat().replace( 'Y', ' ' ) );
-
   // Search for Birthdays and Anniversaries in the Addressbook
   KABC::AddressBook::Iterator it;
   for ( it = ab->begin(); it != ab->end(); ++it ) {
@@ -465,7 +461,7 @@
       } else if ( (*addrIt).daysTo == 1 ) {
         datestr = i18n( "Tomorrow" );
       } else {
-        datestr = KGlobal::locale()->formatDate( sD );
+        datestr = KGlobal::locale()->formatDate( sD, KLocale::FancyLongDate );
       }
       // Print the date span for multiday, floating events, for the
       // first day of the event only.
@@ -576,7 +572,6 @@
   }
 
   setUpdatesEnabled( true );
-  KGlobal::locale()->setDateFormat( savefmt );
 }
 
 void SDSummaryWidget::mailContact( const QString &uid )
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic