summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-17 13:25:15 (UTC)
committer zautrix <zautrix>2004-09-17 13:25:15 (UTC)
commit603ad0a623dc72b8ccb9535f9907e0f2aa536328 (patch) (side-by-side diff)
treec6a33f468891b65b184d4b0d10971dc0eb40aa13
parent053b3550aa2b987d7aeaf74cc458754d7e80a67b (diff)
downloadkdepimpi-603ad0a623dc72b8ccb9535f9907e0f2aa536328.zip
kdepimpi-603ad0a623dc72b8ccb9535f9907e0f2aa536328.tar.gz
kdepimpi-603ad0a623dc72b8ccb9535f9907e0f2aa536328.tar.bz2
Fixed time settings bug
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp2
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 4f48850..10b1013 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,176 +1,176 @@
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#include <stdlib.h>
#else
#include <qapplication.h>
#include <qwindowsstyle.h>
#include <qplatinumstyle.h>
#include <qmainwindow.h>
#endif
#include <kstandarddirs.h>
#include <qregexp.h>
#include <kglobal.h>
#include <stdio.h>
#include <qdir.h>
#include "kaddressbookmain.h"
#include "externalapphandler.h"
int main( int argc, char **argv )
{
#ifndef DESKTOP_VERSION
QPEApplication a( argc, argv );
a.setKeepRunning ();
#else
QApplication a( argc, argv );
QApplication::setStyle( new QPlatinumStyle ());
QString hdir = QDir::homeDirPath();
// there is a bug when creating dirs for WIN 98
// it is difficult to fix, because we have no WIN 98 runnung
// such that we try it to create the dirs at startup here
if ( hdir == "C:\\" ) { // win 98 or ME
QDir app_dir;
if ( !app_dir.exists("C:\\kdepim") )
app_dir.mkdir ("C:\\kdepim");
if ( !app_dir.exists("C:\\kdepim\\apps") )
app_dir.mkdir ("C:\\kdepim\\apps");
if ( !app_dir.exists("C:\\kdepim\\config") )
app_dir.mkdir ("C:\\kdepim\\config");
if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") )
app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook");
}
#endif
bool exitHelp = false;
if ( argc > 1 ) {
QString command = argv[1];
if ( command == "-help" ){
printf("KA/E command line commands:\n");
printf(" no command: Start KA/E in usual way\n");
printf(" -help: This output\n");
printf(" KA/E is exiting now. Bye!\n");
exitHelp = true;
}
}
if ( ! exitHelp ) {
KGlobal::setAppName( "kaddressbook" );
#ifndef DESKTOP_VERSION
if ( QApplication::desktop()->width() > 320 )
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
else
KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
#else
QString fileName ;
fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
QApplication::addLibraryPath ( qApp->applicationDirPath () );
#endif
KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
KAddressBookMain m ;
//US MainWindow m;
QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
{
KConfig kon ( locateLocal( "config", "korganizerrc" ) );
kon.setGroup("Locale");
KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
- KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) );
+ KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) );
KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
kon.setGroup("Time & Date");
KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
kon.readNumEntry( "DaylightsavingStart", 90),
kon.readNumEntry( "DaylightsavingEnd",304) );
KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
}
#ifndef DESKTOP_VERSION
a.showMainWidget( &m );
#else
a.setMainWidget( &m );
m.resize (640, 480 );
m.show();
#endif
a.exec();
}
qDebug("KA: Bye! ");
}
/*
#include <stdlib.h>
#include <qstring.h>
#include <kabc/stdaddressbook.h>
#include <kaboutdata.h>
#include <kcmdlineargs.h>
#include <kcrash.h>
#include <kdebug.h>
#include <klocale.h>
#include <kstartupinfo.h>
#include <kuniqueapplication.h>
#include <kwin.h>
#include "kaddressbookmain.h"
#include "kabcore.h"
extern "C" {
void crashHandler( int )
{
KABC::StdAddressBook::handleCrash();
::exit( 0 );
}
}
class KAddressBookApp : public KUniqueApplication {
public:
KAddressBookApp() : mMainWin( 0 ) {}
~KAddressBookApp() {}
int newInstance();
private:
KAddressBookMain *mMainWin;
};
int KAddressBookApp::newInstance()
{
if ( isRestored() ) {
// There can only be one main window
if ( KMainWindow::canBeRestored( 1 ) ) {
mMainWin = new KAddressBookMain;
mMainWin->show();
mMainWin->restore( 1 );
}
} else {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
QCString addrStr = args->getOption( "addr" );
QCString uidStr = args->getOption( "uid" );
QString addr;
QString uid;
if ( !addrStr.isEmpty() )
addr = QString::fromLocal8Bit( addrStr );
if ( !uidStr.isEmpty() )
uid = QString::fromLocal8Bit( uidStr );
if ( args->isSet( "editor-only" ) ) {
if ( !mMainWin )
mMainWin = new KAddressBookMain;
KStartupInfo::appStarted();
mMainWin->hide();
} else {
if ( mMainWin ) {
mMainWin->show();
KWin::setActiveWindow( mMainWin->winId() );
} else {
mMainWin = new KAddressBookMain;
mMainWin->show();
}
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,134 +1,134 @@
// CHANGED 2004-09-31 Lutz Rogowski
#include "genericwrapper.h"
#include <libetpan/libetpan.h>
#include "mailtypes.h"
#include <kconfig.h>
#include <kglobal.h>
#include <kstandarddirs.h>
using namespace Opie::Core;
Genericwrapper::Genericwrapper()
: AbstractMail()
{
bodyCache.clear();
m_storage = 0;
m_folder = 0;
}
Genericwrapper::~Genericwrapper()
{
if (m_folder) {
mailfolder_free(m_folder);
}
if (m_storage) {
mailstorage_free(m_storage);
}
cleanMimeCache();
}
const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date )
{
static bool init = false ;
if ( ! init ) {
KConfig kon ( locateLocal( "config", "korganizerrc" ) );
kon.setGroup("Locale");
KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) );
QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( "");
- KGlobal::locale()->setHore24Format( !kon.readBoolEntry( "PreferredTime",0 ) );
+ KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) );
KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" );
KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
kon.setGroup("Time & Date");
KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ),
kon.readNumEntry( "DaylightsavingStart", 90),
kon.readNumEntry( "DaylightsavingEnd",304) );
KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") );
init = true;
}
QDate da (date->dt_year,date->dt_month, date->dt_day );
QTime ti ( date->dt_hour, date->dt_min, date->dt_sec );
QDateTime dt ( da ,ti );
int addsec = -date->dt_zone*36;
//qDebug("adsec1 %d ",addsec );
dt = dt.addSecs( addsec );
int off = KGlobal::locale()->localTimeOffset( dt );
//qDebug("adsec2 %d ",off*60 );
dt = dt.addSecs( off*60 );
return dt;
#if 0
QString ret;
if ( dt.date() == QDate::currentDate () )
ret = KGlobal::locale()->formatTime( dt.time(),true);
else {
ret = KGlobal::locale()->formatDateTime( dt,true,true);
}
#endif
#if 0
if ( off < 0 )
ret += " -";
else
ret += " +";
ret += QString::number( off / 60 );
ret += "h";
#endif
#if 0
char tmp[23];
// snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i",
// date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
snprintf( tmp, 23, "%04i-%02i-%02i %02i:%02i:%02i %+05i",
date->dt_year,date->dt_month, date->dt_day, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone );
return QString( tmp );
#endif
//return ret;
}
void Genericwrapper::fillSingleBody(RecPartP&target,mailmessage*,mailmime*mime)
{
if (!mime) {
return;
}
mailmime_field*field = 0;
mailmime_single_fields fields;
memset(&fields, 0, sizeof(struct mailmime_single_fields));
if (mime->mm_mime_fields != NULL) {
mailmime_single_fields_init(&fields, mime->mm_mime_fields,
mime->mm_content_type);
}
mailmime_content*type = fields.fld_content;
clistcell*current;
if (!type) {
target->setType("text");
target->setSubtype("plain");
} else {
target->setSubtype(type->ct_subtype);
switch(type->ct_type->tp_data.tp_discrete_type->dt_type) {
case MAILMIME_DISCRETE_TYPE_TEXT:
target->setType("text");
break;
case MAILMIME_DISCRETE_TYPE_IMAGE:
target->setType("image");
break;
case MAILMIME_DISCRETE_TYPE_AUDIO:
target->setType("audio");
break;
case MAILMIME_DISCRETE_TYPE_VIDEO:
target->setType("video");
break;
case MAILMIME_DISCRETE_TYPE_APPLICATION:
target->setType("application");
break;
case MAILMIME_DISCRETE_TYPE_EXTENSION:
default:
if (type->ct_type->tp_data.tp_discrete_type->dt_extension) {
target->setType(type->ct_type->tp_data.tp_discrete_type->dt_extension);
}
break;