170512

From ThorstensHome
Jump to: navigation, search

Bug 170512 for KDE.

How to manipulate the event that is shown within kmail:

linux-dtnt:~ # svn diff kdepimlibs/
Index: kdepimlibs/kcal/icalformat.cpp
===================================================================
--- kdepimlibs/kcal/icalformat.cpp      (revision 858091)
+++ kdepimlibs/kcal/icalformat.cpp      (working copy)
@@ -404,6 +404,8 @@
                                                    const QString &messageText )
 {
   setTimeSpec( cal->timeSpec() );
+  kDebug() << "tstaerk was here";
+  //setViewTimeZoneId( "Europe/Berlin" );
   clearException();

   if ( messageText.isEmpty() ) {
@@ -580,6 +582,7 @@

   icalcomponent_free( message );
   icalcomponent_free( calendarComponent );
+  incidence->setDtStart(KDateTime::currentLocalDateTime());
   return new ScheduleMessage( incidence, method, status );
 }

worsening the problem

Index: kcal/icalformat.cpp
===================================================================
--- kcal/icalformat.cpp (revision 858091)
+++ kcal/icalformat.cpp (working copy)
@@ -404,6 +404,8 @@
                                                    const QString &messageText )
 {
   setTimeSpec( cal->timeSpec() );
+  kDebug() << "tstaerk was here";
+  //setViewTimeZoneId( "Europe/Berlin" );
   clearException();

   if ( messageText.isEmpty() ) {
@@ -580,6 +582,13 @@

   icalcomponent_free( message );
   icalcomponent_free( calendarComponent );
+  KTimeZone utctimezone=KTimeZone("UTC");
+  KTimeZone tz=KTimeZone("Europe/Berlin");
+  kDebug() << "*********************************************************************************************";
+  kDebug() << tz.name();
+  KDateTime::Spec sp=KDateTime::Spec(tz);
+  incidence->shiftTimes(sp,utctimezone);
+  incidence->setDtStart(KDateTime::currentLocalDateTime());
   return new ScheduleMessage( incidence, method, status );
 }

Index: kdepimlibs/kcal/incidenceformatter.cpp
===================================================================
--- kdepimlibs/kcal/incidenceformatter.cpp      (revision 859196)  
+++ kdepimlibs/kcal/incidenceformatter.cpp      (working copy)     
@@ -292,7 +292,7 @@                                                
   if ( event->allDay() ) {                                        
     if ( event->isMultiDay() ) {                                  
       tmpStr += "<td align=\"right\"><b>" + i18n( "Time" ) + "</b></td>";
-      tmpStr += "<td>" + i18nc("<beginTime> - <endTime>","%1 - %2",      
+      tmpStr += "<td>" + i18nc("<beginTime> - <endTime>","%1 -tstaerk2 %2",
                       event->dtStartDateStr( true, event->dtStart().timeSpec() ),                                                                              
                       event->dtEndDateStr( true, event->dtEnd().timeSpec() ) ) + "</td>";                                                                      
     } else {                                                                   
@@ -305,18 +305,18 @@                                                           
     if ( event->isMultiDay() ) {                                               
       tmpStr += "<td align=\"right\"><b>" + i18n( "Time" ) + "</b></td>";      
       tmpStr += "<td>" +                                                       
-                i18nc( "<beginTime> - <endTime>","%1 - %2",                    
+                i18nc( "<beginTime> - <endTime>","%1 -tstaerk3 %2",            
                        event->dtStartStr( true, event->dtStart().timeSpec() ), 
                        event->dtEndStr( true, event->dtEnd().timeSpec() ) ) + "</td>";                                                                         
     } else {                                                                   
       tmpStr += "<td align=\"right\"><b>" + i18n( "Time" ) + "</b></td>";      
       if ( event->hasEndDate() && event->dtStart() != event->dtEnd() ) {       
         tmpStr += "<td>" +                                                     
-                  i18nc( "<beginTime> - <endTime>","%1 - %2",                  
+                  i18nc( "<beginTime> - <endTime>","%1 -tstaerk4 %2",          
                          event->dtStartTimeStr( true, event->dtStart().timeSpec() ),                                                                           
                          event->dtEndTimeStr( true, event->dtEnd().timeSpec() ) ) + "</td>";                                                                   
       } else {                                                                 
-        tmpStr += "<td>" + event->dtStartTimeStr( true, event->dtStart().timeSpec() ) + "</td>";                                                               
+        tmpStr += "<td>tstaerk5" + event->dtStartTimeStr( true, event->dtStart().timeSpec() ) + "</td>";                                                       
       }                                                                        
       tmpStr += "</tr><tr>";                                                   
       tmpStr += "<td align=\"right\"><b>" + i18n( "Date" ) + "</b></td>";      
@@ -511,7 +511,7 @@                                                             
   public:                                                                      
     EventViewerVisitor() { mResult = ""; }                                     
     bool act( IncidenceBase *incidence ) { return incidence->accept( *this ); }
-    QString result() const { return mResult; }                                 
+    QString result() const { kDebug() << "result is " << mResult; return mResult; }                                                                            
   protected:                                                                   
     bool visit( Event *event )                                                 
     {                                                                          
@@ -652,11 +652,11 @@                                                           
   html += "<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\">\n";        
                                                                                
   // Meeting summary & location rows                                           
-  html += invitationRow( i18n( "What:" ), sSummary );                          
+  html += invitationRow( i18n( "Whattstaerk7:" ), sSummary );                  
   html += invitationRow( i18n( "Where:" ), sLocation );                        
                                                                                
   // Meeting Start Time Row                                                    
-  html += invitationRow( i18n( "Start Time:" ), eventStartTimeStr( event ) );  
+  html += invitationRow( i18n( "Start Timetstaerk6:" ), eventStartTimeStr( event ) );                                                                          

   // Meeting End Time Row
   html += invitationRow( i18n( "End Time:" ), eventEndTimeStr( event ) );
@@ -1337,13 +1337,16 @@
   if ( !headerVisitor.act( incBase, msg ) ) {
     return QString();
   }
-  html += "<h3>" + headerVisitor.result() + "</h3>";
+  html += "<h3>" + headerVisitor.result() + "tstaerk</h3>";

   InvitationBodyVisitor bodyVisitor;
+  kDebug() << "********************************************************************************************************************";
+  //incBase->shiftTimes( incBase->timeSpec(), KDateTime::Spec::LocalZone() );
   if ( !bodyVisitor.act( incBase, msg ) ) {
     return QString();
   }
   html += bodyVisitor.result();
+  kDebug() << bodyVisitor.result();

   if ( msg->method() == iTIPRequest ) { // ### Scheduler::Publish/Refresh/Add as well?
     IncidenceCompareVisitor compareVisitor;
Index: kdepimlibs/kcal/icalformat.cpp
===================================================================
--- kdepimlibs/kcal/icalformat.cpp      (revision 859196)
+++ kdepimlibs/kcal/icalformat.cpp      (working copy)
@@ -580,7 +580,6 @@

   icalcomponent_free( message );
   icalcomponent_free( calendarComponent );
-  incidence->shiftTimes( cal->timeSpec(), KDateTime::Spec::LocalZone() );
   return new ScheduleMessage( incidence, method, status );
 }