summaryrefslogtreecommitdiff
path: root/libopie2
Side-by-side diff
Diffstat (limited to 'libopie2') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/core/oconversion.cpp39
-rw-r--r--libopie2/opiepim/core/oconversion.h7
-rw-r--r--libopie2/opiepim/core/opimcache.h10
-rw-r--r--libopie2/opiepim/core/opimmaintainer.cpp2
-rw-r--r--libopie2/opiepim/core/opimmaintainer.h5
-rw-r--r--libopie2/opiepim/core/opimresolver.cpp11
-rw-r--r--libopie2/opiepim/core/opimresolver.h12
-rw-r--r--libopie2/opiepim/core/opimstate.cpp5
-rw-r--r--libopie2/opiepim/core/opimstate.h7
-rw-r--r--libopie2/opiepim/core/opimxref.cpp12
-rw-r--r--libopie2/opiepim/core/opimxref.h10
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.cpp14
-rw-r--r--libopie2/opiepim/core/opimxrefmanager.h9
-rw-r--r--libopie2/opiepim/core/opimxrefpartner.cpp12
-rw-r--r--libopie2/opiepim/core/opimxrefpartner.h3
-rw-r--r--libopie2/opiepim/core/orecur.cpp76
-rw-r--r--libopie2/opiepim/core/orecur.h11
-rw-r--r--libopie2/opiepim/core/otemplatebase.h9
-rw-r--r--libopie2/opiepim/core/otimezone.cpp88
-rw-r--r--libopie2/opiepim/core/otimezone.h11
-rw-r--r--libopie2/opieui/otabwidget.h6
-rw-r--r--libopie2/opieui/owait.cpp77
-rw-r--r--libopie2/opieui/owait.h57
23 files changed, 346 insertions, 147 deletions
diff --git a/libopie2/opiepim/core/oconversion.cpp b/libopie2/opiepim/core/oconversion.cpp
index b7eebef..160c2c6 100644
--- a/libopie2/opiepim/core/oconversion.cpp
+++ b/libopie2/opiepim/core/oconversion.cpp
@@ -1,5 +1,4 @@
/*
This file is part of the Opie Project
- Copyright (C) The Main Author <main-author@whereever.org>
=. Copyright (C) The Opie Team <opie-devel@handhelds.org>
.=l.
@@ -28,9 +27,10 @@
*/
+/* OPIE */
#include <opie2/oconversion.h>
#include <qpe/timeconversion.h>
-
-namespace Opie {
+namespace Opie
+{
QString OConversion::dateToString( const QDate &d )
@@ -52,4 +52,5 @@ QString OConversion::dateToString( const QDate &d )
}
+
QDate OConversion::dateFromString( const QString& s )
{
@@ -72,13 +73,16 @@ QDate OConversion::dateFromString( const QString& s )
// do some quick sanity checking -eilers
// but we isValid() again? -zecke
- if ( year < 1900 || year > 3000 ) {
+ if ( year < 1900 || year > 3000 )
+ {
qWarning( "PimContact year is not in range");
return date;
}
- if ( month < 0 || month > 12 ) {
+ if ( month < 0 || month > 12 )
+ {
qWarning( "PimContact month is not in range");
return date;
}
- if ( day < 0 || day > 31 ) {
+ if ( day < 0 || day > 31 )
+ {
qWarning( "PimContact day is not in range");
return date;
@@ -86,5 +90,6 @@ QDate OConversion::dateFromString( const QString& s )
date.setYMD( year, month, day );
- if ( !date.isValid() ) {
+ if ( !date.isValid() )
+ {
qWarning( "PimContact date is not valid");
return date;
@@ -93,6 +98,10 @@ QDate OConversion::dateFromString( const QString& s )
return date;
}
-QString OConversion::dateTimeToString( const QDateTime& dt ) {
- if (!dt.isValid() || dt.isNull() ) return QString::null;
+
+
+QString OConversion::dateTimeToString( const QDateTime& dt )
+{
+ if ( !dt.isValid() || dt.isNull() )
+ return QString::null;
QString year = QString::number( dt.date().year() );
@@ -110,11 +119,13 @@ QString OConversion::dateTimeToString( const QDateTime& dt ) {
sec = sec. rightJustify( 2, '0' );
- QString str = day + month + year + hour + min + sec;
-
- return str;
+ return day + month + year + hour + min + sec;
}
-QDateTime OConversion::dateTimeFromString( const QString& str) {
- if ( str.isEmpty() ) return QDateTime();
+
+QDateTime OConversion::dateTimeFromString( const QString& str )
+{
+
+ if ( str.isEmpty() )
+ return QDateTime();
int day = str.mid(0, 2).toInt();
int month = str.mid(2, 2).toInt();
diff --git a/libopie2/opiepim/core/oconversion.h b/libopie2/opiepim/core/oconversion.h
index 3c4fdf3..eeb97e5 100644
--- a/libopie2/opiepim/core/oconversion.h
+++ b/libopie2/opiepim/core/oconversion.h
@@ -28,9 +28,8 @@
*/
-#ifndef __oconversion_h__
-#define __oconversion_h__
+#ifndef OCONVERSION_H
+#define OCONVERSION_H
-/* #include <time.h> */
-/* #include <sys/types.h> */
+/* QT */
#include <qdatetime.h>
diff --git a/libopie2/opiepim/core/opimcache.h b/libopie2/opiepim/core/opimcache.h
index e70a910..a033574 100644
--- a/libopie2/opiepim/core/opimcache.h
+++ b/libopie2/opiepim/core/opimcache.h
@@ -27,11 +27,13 @@
Boston, MA 02111-1307, USA.
*/
-#ifndef OPIE_PIM_CACHE_H
-#define OPIE_PIM_CACHE_H
-
-#include <qintcache.h>
+#ifndef OPIMCACHE_H
+#define OPIMCACHE_H
+/* OPIE */
#include <opie2/opimrecord.h>
+/* QT */
+#include <qintcache.h>
+
namespace Opie {
class OPimCacheItemPrivate;
diff --git a/libopie2/opiepim/core/opimmaintainer.cpp b/libopie2/opiepim/core/opimmaintainer.cpp
index b2eff12..b8d829a 100644
--- a/libopie2/opiepim/core/opimmaintainer.cpp
+++ b/libopie2/opiepim/core/opimmaintainer.cpp
@@ -28,5 +28,5 @@
*/
-#include <opie2/opimmaintainer.h>
+#include "opimmaintainer.h"
namespace Opie {
diff --git a/libopie2/opiepim/core/opimmaintainer.h b/libopie2/opiepim/core/opimmaintainer.h
index 46bc9d2..e7e7eeb 100644
--- a/libopie2/opiepim/core/opimmaintainer.h
+++ b/libopie2/opiepim/core/opimmaintainer.h
@@ -27,7 +27,8 @@
Boston, MA 02111-1307, USA.
*/
-#ifndef OPIE_PIM_MAINTAINER_H
-#define OPIE_PIM_MAINTAINER_H
+#ifndef OPIMMAINTAINER_H
+#define OPIMMAINTAINER_H
+/* QT */
#include <qstring.h>
diff --git a/libopie2/opiepim/core/opimresolver.cpp b/libopie2/opiepim/core/opimresolver.cpp
index eceabcb..73d7de1 100644
--- a/libopie2/opiepim/core/opimresolver.cpp
+++ b/libopie2/opiepim/core/opimresolver.cpp
@@ -27,13 +27,14 @@
Boston, MA 02111-1307, USA.
*/
-#include <qcopchannel_qws.h>
-#include <qpe/qcopenvelope_qws.h>
+#include "opimresolver.h"
-#include <opie2/otodoaccess.h>
+/* OPIE */
#include <opie2/ocontactaccess.h>
+#include <opie2/otodoaccess.h>
+#include <qpe/qcopenvelope_qws.h>
-//#include "opimfactory.h"
-#include <opie2/opimresolver.h>
+/* QT */
+#include <qcopchannel_qws.h>
namespace Opie {
diff --git a/libopie2/opiepim/core/opimresolver.h b/libopie2/opiepim/core/opimresolver.h
index adc7c16..dd6f07f 100644
--- a/libopie2/opiepim/core/opimresolver.h
+++ b/libopie2/opiepim/core/opimresolver.h
@@ -27,12 +27,14 @@
Boston, MA 02111-1307, USA.
*/
-#ifndef OPIE_PIM_RESOLVER
-#define OPIE_PIM_RESOLVER
+#ifndef OPIMRESOLVER_H
+#define OPIMRESOLVER_H
+/* OPIE */
+#include <opie2/otemplatebase.h>
+
+/* QT */
#include <qstring.h>
#include <qvaluelist.h>
-#include <opie2/otemplatebase.h>
-
namespace Opie {
/**
@@ -48,4 +50,5 @@ namespace Opie {
*/
class OPimResolver {
+
public:
enum BuiltIn { TodoList = 0,
@@ -101,4 +104,5 @@ public:
OPimBase* backend( const QString& service );
OPimBase* backend( int rtti );
+
private:
OPimResolver();
diff --git a/libopie2/opiepim/core/opimstate.cpp b/libopie2/opiepim/core/opimstate.cpp
index 1013a1c..8aff558 100644
--- a/libopie2/opiepim/core/opimstate.cpp
+++ b/libopie2/opiepim/core/opimstate.cpp
@@ -27,8 +27,9 @@
Boston, MA 02111-1307, USA.
*/
-#include <qshared.h>
-
#include "opimstate.h"
+/* QT */
+#include <qshared.h>
+
namespace Opie {
/*
diff --git a/libopie2/opiepim/core/opimstate.h b/libopie2/opiepim/core/opimstate.h
index 78e8cd0..8336b3e 100644
--- a/libopie2/opiepim/core/opimstate.h
+++ b/libopie2/opiepim/core/opimstate.h
@@ -27,7 +27,8 @@
Boston, MA 02111-1307, USA.
*/
-#ifndef OPIE_PIM_STATE_H
-#define OPIE_PIM_STATE_H
+#ifndef OPIMSTATE_H
+#define OPIMSTATE_H
+/* QT */
#include <qstring.h>
@@ -45,4 +46,5 @@ namespace Opie {
*/
class OPimState {
+
public:
enum State {
@@ -61,4 +63,5 @@ public:
void setState( int state);
int state()const;
+
private:
void deref();
diff --git a/libopie2/opiepim/core/opimxref.cpp b/libopie2/opiepim/core/opimxref.cpp
index 85d3345..f58ebb5 100644
--- a/libopie2/opiepim/core/opimxref.cpp
+++ b/libopie2/opiepim/core/opimxref.cpp
@@ -27,5 +27,5 @@
Boston, MA 02111-1307, USA.
*/
-#include <opie2/opimxref.h>
+#include "opimxref.h"
namespace Opie {
@@ -37,14 +37,16 @@ OPimXRef::OPimXRef( const OPimXRefPartner& one, const OPimXRefPartner& two )
m_partners[1] = two;
}
-OPimXRef::OPimXRef()
- : m_partners(2)
+OPimXRef::OPimXRef():m_partners(2)
{
}
+
OPimXRef::OPimXRef( const OPimXRef& ref) {
*this = ref;
}
+
OPimXRef::~OPimXRef() {
}
+
OPimXRef &OPimXRef::operator=( const OPimXRef& ref) {
m_partners = ref.m_partners;
@@ -53,4 +55,5 @@ OPimXRef &OPimXRef::operator=( const OPimXRef& ref) {
return* this;
}
+
bool OPimXRef::operator==( const OPimXRef& oper ) {
if ( m_partners == oper.m_partners ) return true;
@@ -61,7 +64,9 @@ OPimXRefPartner OPimXRef::partner( enum Partners par) const{
return m_partners[par];
}
+
void OPimXRef::setPartner( enum Partners par, const OPimXRefPartner& part) {
m_partners[par] = part;
}
+
bool OPimXRef::containsString( const QString& string ) const{
if ( m_partners[One].service() == string ||
@@ -70,4 +75,5 @@ bool OPimXRef::containsString( const QString& string ) const{
return false;
}
+
bool OPimXRef::containsUid( int uid ) const{
if ( m_partners[One].uid() == uid ||
diff --git a/libopie2/opiepim/core/opimxref.h b/libopie2/opiepim/core/opimxref.h
index 820c9c4..f3e814e 100644
--- a/libopie2/opiepim/core/opimxref.h
+++ b/libopie2/opiepim/core/opimxref.h
@@ -28,12 +28,14 @@
*/
-#ifndef OPIM_XREF_H
-#define OPIM_XREF_H
+#ifndef OPIMXREF_H
+#define OPIMXREF_H
+/* OPIE */
+#include <opie2/opimxrefpartner.h>
+
+/* QT */
#include <qarray.h>
#include <qvaluelist.h>
-#include <opie2/opimxrefpartner.h>
-
namespace Opie {
/**
diff --git a/libopie2/opiepim/core/opimxrefmanager.cpp b/libopie2/opiepim/core/opimxrefmanager.cpp
index bf6fed6..e7c6c5a 100644
--- a/libopie2/opiepim/core/opimxrefmanager.cpp
+++ b/libopie2/opiepim/core/opimxrefmanager.cpp
@@ -27,5 +27,5 @@
Boston, MA 02111-1307, USA.
*/
-#include <opie2/opimxrefmanager.h>
+#include "opimxrefmanager.h"
namespace Opie {
@@ -33,13 +33,17 @@ namespace Opie {
OPimXRefManager::OPimXRefManager() {
}
+
OPimXRefManager::OPimXRefManager( const OPimXRefManager& ref) {
m_list = ref.m_list;
}
+
OPimXRefManager::~OPimXRefManager() {
}
+
OPimXRefManager &OPimXRefManager::operator=( const OPimXRefManager& ref) {
m_list = ref.m_list;
return *this;
}
+
bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
// if ( m_list == ref.m_list ) return true;
@@ -47,17 +51,22 @@ bool OPimXRefManager::operator==( const OPimXRefManager& /*ref*/) {
return false;
}
+
void OPimXRefManager::add( const OPimXRef& ref) {
m_list.append( ref );
}
+
void OPimXRefManager::remove( const OPimXRef& ref) {
m_list.remove( ref );
}
+
void OPimXRefManager::replace( const OPimXRef& ref) {
m_list.remove( ref );
m_list.append( ref );
}
+
void OPimXRefManager::clear() {
m_list.clear();
}
+
QStringList OPimXRefManager::apps()const {
OPimXRef::ValueList::ConstIterator it;
@@ -74,7 +83,9 @@ QStringList OPimXRefManager::apps()const {
return list;
}
+
OPimXRef::ValueList OPimXRefManager::list()const {
return m_list;
}
+
OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
OPimXRef::ValueList list;
@@ -88,4 +99,5 @@ OPimXRef::ValueList OPimXRefManager::list( const QString& appName )const{
return list;
}
+
OPimXRef::ValueList OPimXRefManager::list( int uid )const {
OPimXRef::ValueList list;
diff --git a/libopie2/opiepim/core/opimxrefmanager.h b/libopie2/opiepim/core/opimxrefmanager.h
index fa2d7f4..b80a645 100644
--- a/libopie2/opiepim/core/opimxrefmanager.h
+++ b/libopie2/opiepim/core/opimxrefmanager.h
@@ -27,11 +27,14 @@
Boston, MA 02111-1307, USA.
*/
-#ifndef OPIM_XREF_MANAGER_H
-#define OPIM_XREF_MANAGER_H
-#include <qstringlist.h>
+#ifndef OPIMXREFMANAGER_H
+#define OPIMXREFMANAGER_H
+/* OPIE */
#include <opie2/opimxref.h>
+/* QT */
+#include <qstringlist.h>
+
namespace Opie {
/**
diff --git a/libopie2/opiepim/core/opimxrefpartner.cpp b/libopie2/opiepim/core/opimxrefpartner.cpp
index f6ccc7f..3741bc3 100644
--- a/libopie2/opiepim/core/opimxrefpartner.cpp
+++ b/libopie2/opiepim/core/opimxrefpartner.cpp
@@ -27,5 +27,5 @@
Boston, MA 02111-1307, USA.
*/
-#include <opie2/opimxrefpartner.h>
+#include "opimxrefpartner.h"
namespace Opie {
@@ -35,9 +35,12 @@ OPimXRefPartner::OPimXRefPartner( const QString& appName,
: m_app(appName), m_uid(uid), m_field( field ) {
}
+
OPimXRefPartner::OPimXRefPartner( const OPimXRefPartner& ref ) {
*this = ref;
}
+
OPimXRefPartner::~OPimXRefPartner() {
}
+
OPimXRefPartner &OPimXRefPartner::operator=( const OPimXRefPartner& par ) {
m_app = par.m_app;
@@ -47,4 +50,5 @@ OPimXRefPartner &OPimXRefPartner::operator=( const OPimXRefPartner& par ) {
return *this;
}
+
bool OPimXRefPartner::operator==( const OPimXRefPartner& par ) {
if ( m_app != par.m_app ) return false;
@@ -54,19 +58,25 @@ bool OPimXRefPartner::operator==( const OPimXRefPartner& par ) {
return true;
}
+
QString OPimXRefPartner::service()const {
return m_app;
}
+
int OPimXRefPartner::uid()const {
return m_uid;
}
+
int OPimXRefPartner::field()const {
return m_field;
}
+
void OPimXRefPartner::setService( const QString& appName ) {
m_app = appName;
}
+
void OPimXRefPartner::setUid( int uid ) {
m_uid = uid;
}
+
void OPimXRefPartner::setField( int field ) {
m_field = field;
diff --git a/libopie2/opiepim/core/opimxrefpartner.h b/libopie2/opiepim/core/opimxrefpartner.h
index 6853d5b..005dbc0 100644
--- a/libopie2/opiepim/core/opimxrefpartner.h
+++ b/libopie2/opiepim/core/opimxrefpartner.h
@@ -30,4 +30,5 @@
#define OPIM_XREF_PARTNER_H
+/* QT */
#include <qstring.h>
@@ -41,4 +42,5 @@ namespace Opie {
*/
class OPimXRefPartner {
+
public:
OPimXRefPartner( const QString& service = QString::null,
@@ -57,4 +59,5 @@ public:
void setUid( int uid );
void setField( int field );
+
private:
QString m_app;
diff --git a/libopie2/opiepim/core/orecur.cpp b/libopie2/opiepim/core/orecur.cpp
index 033f264..5e2da25 100644
--- a/libopie2/opiepim/core/orecur.cpp
+++ b/libopie2/opiepim/core/orecur.cpp
@@ -28,14 +28,18 @@
*/
-#include <time.h>
+#include "orecur.h"
-#include <qshared.h>
+/* OPIE */
+#include <opie2/otimezone.h>
+#include <qpe/timeconversion.h>
-#include <qtopia/timeconversion.h>
+/* QT */
+#include <qshared.h>
-#include <opie2/otimezone.h>
-#include <opie2/orecur.h>
+/* STD */
+#include <time.h>
namespace Opie {
+
struct ORecur::Data : public QShared {
Data() : QShared() {
@@ -78,4 +82,6 @@ ORecur::ORecur( const ORecur& rec)
data->ref();
}
+
+
ORecur::~ORecur() {
if ( data->deref() ) {
@@ -84,4 +90,6 @@ ORecur::~ORecur() {
}
}
+
+
void ORecur::deref() {
if ( data->deref() ) {
@@ -90,7 +98,11 @@ void ORecur::deref() {
}
}
+
+
bool ORecur::operator==( const ORecur& )const {
return false;
}
+
+
ORecur &ORecur::operator=( const ORecur& re) {
if ( *this == re ) return *this;
@@ -102,7 +114,11 @@ ORecur &ORecur::operator=( const ORecur& re) {
return *this;
}
+
+
bool ORecur::doesRecur()const {
return !( type() == NoRepeat );
}
+
+
/*
* we try to be smart here
@@ -119,4 +135,6 @@ bool ORecur::doesRecur( const QDate& date ) {
return (recur == date);
}
+
+
// FIXME unuglify!
// GPL from Datebookdb.cpp
@@ -130,4 +148,6 @@ bool ORecur::nextOcurrence( const QDate& from, QDate& next ) {
return stillLooking;
}
+
+
bool ORecur::p_nextOccurrence( const QDate& from, QDate& next ) {
@@ -402,77 +422,121 @@ bool ORecur::p_nextOccurrence( const QDate& from, QDate& next ) {
}
}
+
+
ORecur::RepeatType ORecur::type()const{
return data->type;
}
+
+
int ORecur::frequency()const {
return data->freq;
}
+
+
int ORecur::position()const {
return data->pos;
}
+
+
char ORecur::days() const{
return data->days;
}
+
+
bool ORecur::hasEndDate()const {
return data->hasEnd;
}
+
+
QDate ORecur::endDate()const {
return data->end;
}
+
+
QDate ORecur::start()const{
return data->start;
}
+
+
QDateTime ORecur::createdDateTime()const {
return data->create;
}
+
+
int ORecur::repetition()const {
return data->rep;
}
+
+
QString ORecur::service()const {
return data->app;
}
+
+
ORecur::ExceptionList& ORecur::exceptions() {
return data->list;
}
+
+
void ORecur::setType( const RepeatType& z) {
checkOrModify();
data->type = z;
}
+
+
void ORecur::setFrequency( int freq ) {
checkOrModify();
data->freq = freq;
}
+
+
void ORecur::setPosition( int pos ) {
checkOrModify();
data->pos = pos;
}
+
+
void ORecur::setDays( char c ) {
checkOrModify();
data->days = c;
}
+
+
void ORecur::setEndDate( const QDate& dt) {
checkOrModify();
data->end = dt;
}
+
+
void ORecur::setCreatedDateTime( const QDateTime& t) {
checkOrModify();
data->create = t;
}
+
+
void ORecur::setHasEndDate( bool b) {
checkOrModify();
data->hasEnd = b;
}
+
+
void ORecur::setRepitition( int rep ) {
checkOrModify();
data->rep = rep;
}
+
+
void ORecur::setService( const QString& app ) {
checkOrModify();
data->app = app;
}
+
+
void ORecur::setStart( const QDate& dt ) {
checkOrModify();
data->start = dt;
}
+
+
void ORecur::checkOrModify() {
if ( data->count != 1 ) {
@@ -493,4 +557,6 @@ void ORecur::checkOrModify() {
}
}
+
+
QString ORecur::toString()const {
QString buf;
diff --git a/libopie2/opiepim/core/orecur.h b/libopie2/opiepim/core/orecur.h
index 60508f5..7808897 100644
--- a/libopie2/opiepim/core/orecur.h
+++ b/libopie2/opiepim/core/orecur.h
@@ -28,13 +28,14 @@
*/
-#ifndef OPIE_RECUR_H
-#define OPIE_RECUR_H
-
-#include <sys/types.h>
+#ifndef ORECUR_H
+#define ORECUR_H
+/* QT */
#include <qdatetime.h>
#include <qvaluelist.h>
#include <qmap.h>
+/* STD */
+#include <sys/types.h>
namespace Opie {
@@ -44,4 +45,5 @@ namespace Opie {
class ORecur {
+
public:
typedef QValueList<QDate> ExceptionList;
@@ -115,4 +117,5 @@ public:
/* almost internal */
QString toString()const;
+
private:
bool p_nextOccurrence( const QDate& from, QDate& next );
diff --git a/libopie2/opiepim/core/otemplatebase.h b/libopie2/opiepim/core/otemplatebase.h
index 17d9961..58cbfeb 100644
--- a/libopie2/opiepim/core/otemplatebase.h
+++ b/libopie2/opiepim/core/otemplatebase.h
@@ -27,11 +27,12 @@
Boston, MA 02111-1307, USA.
*/
-#ifndef OPIE_TEMPLATE_BASE_H
-#define OPIE_TEMPLATE_BASE_H
-
-#include <qarray.h>
+#ifndef OTEMPLATEBASE_H
+#define OTEMPLATEBASE_H
+/* OPIE */
#include <opie2/opimrecord.h>
+/* QT */
+#include <qarray.h>
namespace Opie {
diff --git a/libopie2/opiepim/core/otimezone.cpp b/libopie2/opiepim/core/otimezone.cpp
index dab68af..e67715f 100644
--- a/libopie2/opiepim/core/otimezone.cpp
+++ b/libopie2/opiepim/core/otimezone.cpp
@@ -28,14 +28,16 @@
*/
+#include "otimezone.h"
+
+/* STD */
#include <stdio.h>
#include <stdlib.h>
-
#include <sys/types.h>
-#include <opie2/otimezone.h>
+namespace Opie
+{
-namespace Opie {
-
- QDateTime utcTime( time_t t) {
+QDateTime utcTime( time_t t )
+{
tm* broken = ::gmtime( &t );
QDateTime ret;
@@ -44,7 +46,9 @@ namespace Opie {
return ret;
}
- QDateTime utcTime( time_t t, const QString& zone) {
+QDateTime utcTime( time_t t, const QString& zone )
+{
QCString org = ::getenv( "TZ" );
#ifndef Q_OS_MACX // Following line causes bus errors on Mac
+
::setenv( "TZ", zone.latin1(), true );
::tzset();
@@ -54,4 +58,5 @@ namespace Opie {
#else
#warning "Need a replacement for MacOSX!!"
+
tm* broken = ::localtime( &t );
#endif
@@ -63,5 +68,6 @@ namespace Opie {
return ret;
}
- time_t to_Time_t( const QDateTime& utc, const QString& str ) {
+time_t to_Time_t( const QDateTime& utc, const QString& str )
+{
QDate d = utc.date();
QTime t = utc.time();
@@ -77,4 +83,5 @@ namespace Opie {
QCString org = ::getenv( "TZ" );
#ifndef Q_OS_MACX // Following line causes bus errors on Mac
+
::setenv( "TZ", str.latin1(), true );
::tzset();
@@ -84,18 +91,25 @@ namespace Opie {
#else
#warning "Need a replacement for MacOSX!!"
+
time_t ti = ::mktime( &broken );
#endif
+
return ti;
}
}
-namespace Opie {
+namespace Opie
+{
OTimeZone::OTimeZone( const ZoneName& zone )
- : m_name(zone) {
-}
-OTimeZone::~OTimeZone() {
-}
+ : m_name( zone )
+{}
+
+
+OTimeZone::~OTimeZone()
+{}
-bool OTimeZone::isValid()const {
+
+bool OTimeZone::isValid() const
+{
return !m_name.isEmpty();
}
@@ -105,40 +119,68 @@ bool OTimeZone::isValid()const {
* and ask it to convert to the timezone date
*/
-QDateTime OTimeZone::toLocalDateTime( const QDateTime& dt) {
+QDateTime OTimeZone::toLocalDateTime( const QDateTime& dt )
+{
return OTimeZone::current().toDateTime( dt, *this );
}
-QDateTime OTimeZone::toUTCDateTime( const QDateTime& dt ) {
+
+
+QDateTime OTimeZone::toUTCDateTime( const QDateTime& dt )
+{
return OTimeZone::utc().toDateTime( dt, *this );
}
-QDateTime OTimeZone::fromUTCDateTime( time_t t) {
+
+
+QDateTime OTimeZone::fromUTCDateTime( time_t t )
+{
return utcTime( t );
}
-QDateTime OTimeZone::toDateTime( time_t t) {
+
+
+QDateTime OTimeZone::toDateTime( time_t t )
+{
return utcTime( t, m_name );
}
+
+
/*
* convert dt to utc using zone.m_name
* convert utc -> timeZoneDT using this->m_name
*/
-QDateTime OTimeZone::toDateTime( const QDateTime& dt, const OTimeZone& zone ) {
+QDateTime OTimeZone::toDateTime( const QDateTime& dt, const OTimeZone& zone )
+{
time_t utc = to_Time_t( dt, zone.m_name );
qWarning("%d %s", utc, zone.m_name.latin1() );
return utcTime( utc, m_name );
}
-time_t OTimeZone::fromDateTime( const QDateTime& time ) {
+
+
+time_t OTimeZone::fromDateTime( const QDateTime& time )
+{
return to_Time_t( time, m_name );
}
-time_t OTimeZone::fromUTCDateTime( const QDateTime& time ) {
+
+
+time_t OTimeZone::fromUTCDateTime( const QDateTime& time )
+{
return to_Time_t( time, "UTC" );
}
-OTimeZone OTimeZone::current() {
+
+
+OTimeZone OTimeZone::current()
+{
QCString str = ::getenv("TZ");
OTimeZone zone( str );
return zone;
}
-OTimeZone OTimeZone::utc() {
+
+
+OTimeZone OTimeZone::utc()
+{
return OTimeZone("UTC");
}
-QString OTimeZone::timeZone()const {
+
+
+QString OTimeZone::timeZone() const
+{
return m_name;
}
diff --git a/libopie2/opiepim/core/otimezone.h b/libopie2/opiepim/core/otimezone.h
index 28ae6cb..f0b4022 100644
--- a/libopie2/opiepim/core/otimezone.h
+++ b/libopie2/opiepim/core/otimezone.h
@@ -28,10 +28,13 @@
*/
-#ifndef OPIE_TIME_ZONE_H
-#define OPIE_TIME_ZONE_H
+#ifndef OTIMEZONE_H
+#define OTIMEZONE_H
-#include <time.h>
+/* QT */
#include <qdatetime.h>
+/* STD */
+#include <time.h>
+
namespace Opie
{
@@ -43,4 +46,5 @@ namespace Opie
*/
class OTimeZone {
+
public:
typedef QString ZoneName;
@@ -93,4 +97,5 @@ class OTimeZone {
QString timeZone()const;
+
private:
ZoneName m_name;
diff --git a/libopie2/opieui/otabwidget.h b/libopie2/opieui/otabwidget.h
index 51d1c6d..c7d32c2 100644
--- a/libopie2/opieui/otabwidget.h
+++ b/libopie2/opieui/otabwidget.h
@@ -1,6 +1,5 @@
/*
                This file is part of the Opie Project
-
-              Copyright (c) 2002 Dan Williams <williamsdr@acm.org>
+              Copyright (C) 2002 Dan Williams <williamsdr@acm.org>
=.
.=l.
@@ -70,6 +69,6 @@ class OTabWidget : public QWidget
{
Q_OBJECT
-public:
+ public:
/**
* @enum TabStyle
@@ -108,5 +107,4 @@ public:
* determine how the widget selection control will be displayed.
*/
- // FIXME WFlags? -zecke
OTabWidget( QWidget * = 0, const char * = 0, TabStyle = Global, TabPosition = Top );
diff --git a/libopie2/opieui/owait.cpp b/libopie2/opieui/owait.cpp
index 0fdf08d..8bb4ed6 100644
--- a/libopie2/opieui/owait.cpp
+++ b/libopie2/opieui/owait.cpp
@@ -1,31 +1,42 @@
-/* This file is part of the OPIE libraries
- Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+/*
+                This file is part of the Opie Project
+              Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-*/
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qtimer.h>
-#include <qpe/qpeapplication.h>
-#include <qpainter.h>
+*/
#include "owait.h"
+/* OPIE */
+#include <qpe/qpeapplication.h>
#include <qpe/resource.h>
+/* QT */
+#include <qlayout.h>
+#include <qpainter.h>
+
static int frame = 0;
@@ -40,5 +51,6 @@ static int frame = 0;
*/
OWait::OWait(QWidget *parent, const char* msg, bool dispIcon )
- :QDialog(parent, msg, TRUE,WStyle_Customize) {
+ :QDialog( parent, msg, TRUE, WStyle_Customize )
+{
@@ -61,15 +73,18 @@ OWait::OWait(QWidget *parent, const char* msg, bool dispIcon )
}
-void OWait::timerEvent( QTimerEvent * ) {
+void OWait::timerEvent( QTimerEvent * )
+{
frame = (++frame) % 4;
repaint();
}
-void OWait::paintEvent( QPaintEvent * ) {
+void OWait::paintEvent( QPaintEvent * )
+{
QPainter p( m_lb );
p.drawPixmap( 0, 0, m_pix, m_aniSize * frame, 0, m_aniSize, m_aniSize );
}
-void OWait::show() {
+void OWait::show()
+{
move( ( ( qApp->desktop()->width() ) / 2 ) - ( m_aniSize / 2 ), ( ( qApp->desktop()->height() ) / 2 ) - ( m_aniSize / 2 ) );
@@ -79,5 +94,6 @@ void OWait::show() {
}
-void OWait::hide() {
+void OWait::hide()
+{
killTimers();
m_waitTimer->stop();
@@ -86,8 +102,9 @@ void OWait::hide() {
}
-void OWait::setTimerLength( int length ) {
+void OWait::setTimerLength( int length )
+{
m_timerLength = length;
}
-OWait::~OWait() {
-}
+OWait::~OWait()
+{}
diff --git a/libopie2/opieui/owait.h b/libopie2/opieui/owait.h
index cbfc8d6..3267064 100644
--- a/libopie2/opieui/owait.h
+++ b/libopie2/opieui/owait.h
@@ -1,29 +1,39 @@
-/* This file is part of the OPIE libraries
- Copyright (C) 2003 Maximilian Reiss (harlekin@handhelds.org)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+/*
+                This file is part of the Opie Project
+              Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
+ =.
+ .=l.
+           .>+-=
+ _;:,     .>    :=|. This program is free software; you can
+.> <`_,   >  .   <= redistribute it and/or modify it under
+:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
+.="- .-=="i,     .._ License as published by the Free Software
+ - .   .-<_>     .<> Foundation; either version 2 of the License,
+     ._= =}       : or (at your option) any later version.
+    .%`+i>       _;_.
+    .i_,=:_.      -<s. This program is distributed in the hope that
+     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
+    : ..    .:,     . . . without even the implied warranty of
+    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
+  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
+..}^=.=       =       ; Library General Public License for more
+++=   -.     .`     .: details.
+ :     =  ...= . :.=-
+ -.   .:....=;==+<; You should have received a copy of the GNU
+  -_. . .   )=.  = Library General Public License along with
+    --        :-=` this library; see the file COPYING.LIB.
+ If not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
-*/
-
+*/
-#ifndef WAITPOPUP_H
-#define WAITPOPUP_H
+#ifndef OWAIT_H
+#define OWAIT_H
+/* QT */
#include <qdialog.h>
-#include <qpixmap.h>
#include <qlabel.h>
+#include <qpixmap.h>
#include <qtimer.h>
@@ -35,10 +45,9 @@
* @author Maximilian Reiß
*/
-class OWait : public QDialog {
-
+class OWait : public QDialog
+{
Q_OBJECT
public:
- // FIXME Wflags -zecke?
OWait(QWidget *parent=0,const char* name=0, bool dispIcon=TRUE);
~OWait();