summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-09-17 13:25:15 (UTC)
committer zautrix <zautrix>2004-09-17 13:25:15 (UTC)
commit603ad0a623dc72b8ccb9535f9907e0f2aa536328 (patch) (unidiff)
treec6a33f468891b65b184d4b0d10971dc0eb40aa13 /kmicromail
parent053b3550aa2b987d7aeaf74cc458754d7e80a67b (diff)
downloadkdepimpi-603ad0a623dc72b8ccb9535f9907e0f2aa536328.zip
kdepimpi-603ad0a623dc72b8ccb9535f9907e0f2aa536328.tar.gz
kdepimpi-603ad0a623dc72b8ccb9535f9907e0f2aa536328.tar.bz2
Fixed time settings bug
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp
index d99c6a3..09a6447 100644
--- a/kmicromail/libmailwrapper/genericwrapper.cpp
+++ b/kmicromail/libmailwrapper/genericwrapper.cpp
@@ -1,86 +1,86 @@
1// CHANGED 2004-09-31 Lutz Rogowski 1// CHANGED 2004-09-31 Lutz Rogowski
2#include "genericwrapper.h" 2#include "genericwrapper.h"
3#include <libetpan/libetpan.h> 3#include <libetpan/libetpan.h>
4#include "mailtypes.h" 4#include "mailtypes.h"
5 5
6#include <kconfig.h> 6#include <kconfig.h>
7#include <kglobal.h> 7#include <kglobal.h>
8#include <kstandarddirs.h> 8#include <kstandarddirs.h>
9 9
10 10
11using namespace Opie::Core; 11using namespace Opie::Core;
12Genericwrapper::Genericwrapper() 12Genericwrapper::Genericwrapper()
13 : AbstractMail() 13 : AbstractMail()
14{ 14{
15 bodyCache.clear(); 15 bodyCache.clear();
16 m_storage = 0; 16 m_storage = 0;
17 m_folder = 0; 17 m_folder = 0;
18} 18}
19 19
20Genericwrapper::~Genericwrapper() 20Genericwrapper::~Genericwrapper()
21{ 21{
22 if (m_folder) { 22 if (m_folder) {
23 mailfolder_free(m_folder); 23 mailfolder_free(m_folder);
24 } 24 }
25 if (m_storage) { 25 if (m_storage) {
26 mailstorage_free(m_storage); 26 mailstorage_free(m_storage);
27 } 27 }
28 cleanMimeCache(); 28 cleanMimeCache();
29} 29}
30const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date ) 30const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date )
31{ 31{
32 static bool init = false ; 32 static bool init = false ;
33 if ( ! init ) { 33 if ( ! init ) {
34 KConfig kon ( locateLocal( "config", "korganizerrc" ) ); 34 KConfig kon ( locateLocal( "config", "korganizerrc" ) );
35 kon.setGroup("Locale"); 35 kon.setGroup("Locale");
36 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); 36 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
37 QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); 37 QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
38 KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) ); 38 KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) );
39 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); 39 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
40 dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); 40 dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
41 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); 41 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
42 kon.setGroup("Time & Date"); 42 kon.setGroup("Time & Date");
43 KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), 43 KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
44 kon.readNumEntry( "DaylightsavingStart", 90), 44 kon.readNumEntry( "DaylightsavingStart", 90),
45 kon.readNumEntry( "DaylightsavingEnd",304) ); 45 kon.readNumEntry( "DaylightsavingEnd",304) );
46 KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); 46 KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
47 47
48 init = true; 48 init = true;
49 49
50 } 50 }
51 QDate da (date->dt_year,date->dt_month, date->dt_day ); 51 QDate da (date->dt_year,date->dt_month, date->dt_day );
52 QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); 52 QTime ti ( date->dt_hour, date->dt_min, date->dt_sec );
53 QDateTime dt ( da ,ti ); 53 QDateTime dt ( da ,ti );
54 int addsec = -date->dt_zone*36; 54 int addsec = -date->dt_zone*36;
55 //qDebug("adsec1 %d ",addsec ); 55 //qDebug("adsec1 %d ",addsec );
56 dt = dt.addSecs( addsec ); 56 dt = dt.addSecs( addsec );
57 int off = KGlobal::locale()->localTimeOffset( dt ); 57 int off = KGlobal::locale()->localTimeOffset( dt );
58 //qDebug("adsec2 %d ",off*60 ); 58 //qDebug("adsec2 %d ",off*60 );
59 59
60 dt = dt.addSecs( off*60 ); 60 dt = dt.addSecs( off*60 );
61 return dt; 61 return dt;
62#if 0 62#if 0
63 QString ret; 63 QString ret;
64 if ( dt.date() == QDate::currentDate () ) 64 if ( dt.date() == QDate::currentDate () )
65 ret = KGlobal::locale()->formatTime( dt.time(),true); 65 ret = KGlobal::locale()->formatTime( dt.time(),true);
66 66
67 else { 67 else {
68 ret = KGlobal::locale()->formatDateTime( dt,true,true); 68 ret = KGlobal::locale()->formatDateTime( dt,true,true);
69 } 69 }
70#endif 70#endif
71#if 0 71#if 0
72 if ( off < 0 ) 72 if ( off < 0 )
73 ret += " -"; 73 ret += " -";
74 else 74 else
75 ret += " +"; 75 ret += " +";
76 ret += QString::number( off / 60 ); 76 ret += QString::number( off / 60 );
77 ret += "h"; 77 ret += "h";
78#endif 78#endif
79#if 0 79#if 0
80 char tmp[23]; 80 char tmp[23];
81 81
82 // snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i", 82 // snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i",
83 // date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 83 // date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
84 snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %+05i", 84 snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %+05i",
85 date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 85 date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
86 86