summaryrefslogtreecommitdiff
path: root/libopie
authoreilers <eilers>2003-08-01 12:30:16 (UTC)
committer eilers <eilers>2003-08-01 12:30:16 (UTC)
commit6c715b67a8f0e32a4edca5be91332622834c8d91 (patch) (side-by-side diff)
treeae2d660e1fd9c990c2d725c075ce6c42480b0af8 /libopie
parentcb45aa10043fdd6fddcab42ef0e07ddafc3d506d (diff)
downloadopie-6c715b67a8f0e32a4edca5be91332622834c8d91.zip
opie-6c715b67a8f0e32a4edca5be91332622834c8d91.tar.gz
opie-6c715b67a8f0e32a4edca5be91332622834c8d91.tar.bz2
Merging changes from BRANCH_1_0 to HEAD
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/obackendfactory.h12
-rw-r--r--libopie/pim/ocontact.cpp253
-rw-r--r--libopie/pim/ocontact.h9
-rw-r--r--libopie/pim/ocontactaccess.h11
-rw-r--r--libopie/pim/ocontactaccessbackend.h14
-rw-r--r--libopie/pim/ocontactaccessbackend_vcard.cpp22
-rw-r--r--libopie/pim/ocontactaccessbackend_xml.cpp3
-rw-r--r--libopie/pim/oconversion.h5
-rw-r--r--libopie/pim/odatebookaccessbackend.h4
-rw-r--r--libopie/pim/odatebookaccessbackend_xml.cpp6
-rw-r--r--libopie/pim/opimaccessbackend.h4
-rw-r--r--libopie/pim/opimaccesstemplate.h4
-rw-r--r--libopie/pim/opimcache.h6
-rw-r--r--libopie/pim/opimmainwindow.cpp14
-rw-r--r--libopie/pim/opimxrefmanager.h2
-rw-r--r--libopie/pim/orecordlist.h12
-rw-r--r--libopie/pim/otemplatebase.h7
-rw-r--r--libopie/pim/otodo.cpp16
-rw-r--r--libopie/pim/otodo.h9
-rw-r--r--libopie/pim/otodoaccessbackend.h4
-rw-r--r--libopie/pim/otodoaccessvcal.cpp26
-rw-r--r--libopie/pim/otodoaccessxml.cpp6
22 files changed, 327 insertions, 122 deletions
diff --git a/libopie/pim/obackendfactory.h b/libopie/pim/obackendfactory.h
index ad6cf5a..f3c339d 100644
--- a/libopie/pim/obackendfactory.h
+++ b/libopie/pim/obackendfactory.h
@@ -17,4 +17,12 @@
* History:
* $Log$
+ * Revision 1.7 2003/08/01 12:30:16 eilers
+ * Merging changes from BRANCH_1_0 to HEAD
+ *
+ * Revision 1.6.4.1 2003/06/30 14:34:19 eilers
+ * Patches from Zecke:
+ * Fixing and cleaning up extraMap handling
+ * Adding d_ptr for binary compatibility in the future
+ *
* Revision 1.6 2003/04/13 18:07:10 zecke
* More API doc
@@ -69,4 +77,6 @@
#endif
+class OBackendPrivate;
+
/**
* This class is our factory. It will give us the default implementations
@@ -149,4 +159,6 @@ class OBackendFactory
}
+ private:
+ OBackendPrivate* d;
};
diff --git a/libopie/pim/ocontact.cpp b/libopie/pim/ocontact.cpp
index be4ce0a..3473baa 100644
--- a/libopie/pim/ocontact.cpp
+++ b/libopie/pim/ocontact.cpp
@@ -22,8 +22,9 @@
#include "ocontact.h"
#include "opimresolver.h"
+#include "oconversion.h"
#include <qpe/stringutil.h>
-#include "oconversion.h"
#include <qpe/timestring.h>
+#include <qpe/config.h>
#include <qobject.h>
@@ -439,10 +440,14 @@ QString OContact::toRichText() const
bool marker = false;
+ Config cfg("qpe");
+ cfg.setGroup("Appearance");
+ int addressformat = cfg.readNumEntry( "AddressFormat", Zip_City_State );
+
// name, jobtitle and company
if ( !(value = fullName()).isEmpty() )
- text += "<b><h3><img src=\"addressbook/AddressBook\">" + Qtopia::escapeString(value) + "</h3></b>";
-
+ text += "<b><h3><img src=\"addressbook/AddressBook\"> " + Qtopia::escapeString(value) + "</h3></b>";
+
if ( !(value = jobTitle()).isEmpty() )
- text += Qtopia::escapeString(value) + "<br>";
+ text += Qtopia::escapeString(value);
comp = company();
@@ -455,75 +460,108 @@ QString OContact::toRichText() const
}
if ( !comp.isEmpty() )
- text += Qtopia::escapeString(comp) + "<br>";
+ text += Qtopia::escapeString(comp);
- text += "<hr><br>";
+ text += "<br><hr>";
// defailt email
QString defEmail = defaultEmail();
- if ( !defEmail.isEmpty() )
- text += "<b><img src=\"addressbook/email\">" + QObject::tr("Default Email: ") + "</b>"
- + Qtopia::escapeString(defEmail) + "<br>";
-
- text += "<br>";
+ if ( !defEmail.isEmpty() ){
+ text += "<b><img src=\"addressbook/email\"> " + QObject::tr("Default Email: ") + "</b>"
+ + Qtopia::escapeString(defEmail);
+ marker = true;
+ }
// business address
if ( !businessStreet().isEmpty() || !businessCity().isEmpty() ||
!businessZip().isEmpty() || !businessCountry().isEmpty() ) {
- text += QObject::tr( "<b>Work Address:</b>" );
- text += "<br>";
+ text += QObject::tr( "<br><br><b>Work Address:</b>" );
marker = true;
}
- if ( !(value = businessStreet()).isEmpty() )
- text += Qtopia::escapeString(value) + "<br>";
- state = businessState();
- if ( !(value = businessZip()).isEmpty() )
- text += Qtopia::escapeString(value) + " ";
- if ( !(value = businessCity()).isEmpty() ) {
- text += Qtopia::escapeString(value);
- if ( state )
- text += ", " + Qtopia::escapeString(state);
- text += "<br>";
- } else if ( !state.isEmpty() )
- text += Qtopia::escapeString(state) + "<br>";
+ if ( !(value = businessStreet()).isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(value);
+ marker = true;
+ }
+
+ switch( addressformat ){
+ case Zip_City_State:{ // Zip_Code City, State
+ state = businessState();
+ if ( !(value = businessZip()).isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(value) + " ";
+ marker = true;
+
+ } else
+ text += "<br>";
+
+ if ( !(value = businessCity()).isEmpty() ) {
+ marker = true;
+ text += Qtopia::escapeString(value);
+ if ( state )
+ text += ", " + Qtopia::escapeString(state);
+ } else if ( !state.isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(state);
+ marker = true;
+ }
+ break;
+ }
+ case City_State_Zip:{ // City, State Zip_Code
+ state = businessState();
+ if ( !(value = businessCity()).isEmpty() ) {
+ marker = true;
+ text += "<br>" + Qtopia::escapeString(value);
+ if ( state )
+ text += ", " + Qtopia::escapeString(state);
+ } else if ( !state.isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(state);
+ marker = true;
+ }
+ if ( !(value = businessZip()).isEmpty() ){
+ text += " " + Qtopia::escapeString(value);
+ marker = true;
+ }
+ break;
+ }
+ }
- if ( !(value = businessCountry()).isEmpty() )
- text += Qtopia::escapeString(value) + "<br>";
+ if ( !(value = businessCountry()).isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(value);
+ marker = true;
+ }
// rest of Business data
str = office();
if ( !str.isEmpty() ){
- text += "<b>" + QObject::tr("Office: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Office: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = businessWebpage();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/webpagework\">" + QObject::tr("Business Web Page: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/webpagework\"> " + QObject::tr("Business Web Page: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = businessPhone();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/phonework\">" + QObject::tr("Business Phone: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/phonework\"> " + QObject::tr("Business Phone: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = businessFax();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/faxwork\">" + QObject::tr("Business Fax: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/faxwork\"> " + QObject::tr("Business Fax: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = businessMobile();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/mobilework\">" + QObject::tr("Business Mobile: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/mobilework\"> " + QObject::tr("Business Mobile: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = businessPager();
if ( !str.isEmpty() ){
- text += "<b>" + QObject::tr("Business Pager: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Business Pager: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
@@ -534,105 +572,140 @@ QString OContact::toRichText() const
if ( !homeStreet().isEmpty() || !homeCity().isEmpty() ||
!homeZip().isEmpty() || !homeCountry().isEmpty() ) {
- text += QObject::tr( "<b>Home Address:</b>" );
- text += "<br>";
+ text += QObject::tr( "<br><br><b>Home Address:</b>" );
+ marker = true;
}
- if ( !(value = homeStreet()).isEmpty() )
- text += Qtopia::escapeString(value) + "<br>";
- state = homeState();
- if ( !(value = homeZip()).isEmpty() )
- text += Qtopia::escapeString(value) + " ";
- if ( !(value = homeCity()).isEmpty() ) {
- text += Qtopia::escapeString(value);
- if ( !state.isEmpty() )
- text += ", " + Qtopia::escapeString(state);
- text += "<br>";
- } else if (!state.isEmpty())
- text += Qtopia::escapeString(state) + "<br>";
- if ( !(value = homeCountry()).isEmpty() )
- text += Qtopia::escapeString(value) + "<br>";
+ if ( !(value = homeStreet()).isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(value);
+ marker = true;
+ }
+
+ switch( addressformat ){
+ case Zip_City_State:{ // Zip_Code City, State
+ state = homeState();
+ if ( !(value = homeZip()).isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(value) + " ";
+ marker = true;
+ } else
+ text += "<br>";
+
+ if ( !(value = homeCity()).isEmpty() ) {
+ marker = true;
+ text += Qtopia::escapeString(value);
+ if ( !state.isEmpty() )
+ text += ", " + Qtopia::escapeString(state);
+ } else if (!state.isEmpty()) {
+ text += "<br>" + Qtopia::escapeString(state);
+ marker = true;
+ }
+ break;
+ }
+ case City_State_Zip:{ // City, State Zip_Code
+ state = homeState();
+ if ( !(value = homeCity()).isEmpty() ) {
+ marker = true;
+ text += "<br>" + Qtopia::escapeString(value);
+ if ( state )
+ text += ", " + Qtopia::escapeString(state);
+ } else if ( !state.isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(state);
+ marker = true;
+ }
+ if ( !(value = homeZip()).isEmpty() ){
+ text += " " + Qtopia::escapeString(value);
+ marker = true;
+ }
+ break;
+ }
+ }
+
+ if ( !(value = homeCountry()).isEmpty() ){
+ text += "<br>" + Qtopia::escapeString(value);
+ marker = true;
+ }
// rest of Home data
str = homeWebpage();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/webpagehome\">" + QObject::tr("Home Web Page: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/webpagehome\"> " + QObject::tr("Home Web Page: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = homePhone();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/phonehome\">" + QObject::tr("Home Phone: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/phonehome\"> " + QObject::tr("Home Phone: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = homeFax();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/faxhome\">" + QObject::tr("Home Fax: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/faxhome\"> " + QObject::tr("Home Fax: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
str = homeMobile();
if ( !str.isEmpty() ){
- text += "<b><img src=\"addressbook/mobilehome\">" + QObject::tr("Home Mobile: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b><img src=\"addressbook/mobilehome\"> " + QObject::tr("Home Mobile: ") + "</b>"
+ + Qtopia::escapeString(str);
marker = true;
}
if ( marker )
- text += "<br><hr><br>";
- // the others...
+ text += "<br><hr>";
+
+ // the rest...
str = emails();
if ( !str.isEmpty() && ( str != defEmail ) )
- text += "<b>" + QObject::tr("All Emails: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("All Emails: ") + "</b>"
+ + Qtopia::escapeString(str);
str = profession();
if ( !str.isEmpty() )
- text += "<b>" + QObject::tr("Profession: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Profession: ") + "</b>"
+ + Qtopia::escapeString(str);
str = assistant();
if ( !str.isEmpty() )
- text += "<b>" + QObject::tr("Assistant: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Assistant: ") + "</b>"
+ + Qtopia::escapeString(str);
str = manager();
if ( !str.isEmpty() )
- text += "<b>" + QObject::tr("Manager: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Manager: ") + "</b>"
+ + Qtopia::escapeString(str);
str = gender();
if ( !str.isEmpty() && str.toInt() != 0 ) {
- if ( str.toInt() == 1 )
- str = QObject::tr( "Male" );
- else if ( str.toInt() == 2 )
- str = QObject::tr( "Female" );
- text += "<b>" + QObject::tr("Gender: ") + "</b>" + str + "<br>";
+ text += "<br>";
+ if ( str.toInt() == 1 )
+ str = QObject::tr( "Male" );
+ else if ( str.toInt() == 2 )
+ str = QObject::tr( "Female" );
+ text += "<b>" + QObject::tr("Gender: ") + "</b>" + str;
}
str = spouse();
if ( !str.isEmpty() )
- text += "<b>" + QObject::tr("Spouse: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Spouse: ") + "</b>"
+ + Qtopia::escapeString(str);
if ( birthday().isValid() ){
str = TimeString::numberDateString( birthday() );
- text += "<b>" + QObject::tr("Birthday: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Birthday: ") + "</b>"
+ + Qtopia::escapeString(str);
}
if ( anniversary().isValid() ){
str = TimeString::numberDateString( anniversary() );
- text += "<b>" + QObject::tr("Anniversary: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Anniversary: ") + "</b>"
+ + Qtopia::escapeString(str);
}
str = children();
if ( !str.isEmpty() )
- text += "<b>" + QObject::tr("Children: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Children: ") + "</b>"
+ + Qtopia::escapeString(str);
str = nickname();
if ( !str.isEmpty() )
- text += "<b>" + QObject::tr("Nickname: ") + "</b>"
- + Qtopia::escapeString(str) + "<br>";
+ text += "<br><b>" + QObject::tr("Nickname: ") + "</b>"
+ + Qtopia::escapeString(str);
// categories
if ( categoryNames("Contacts").count() ){
- text += "<b>" + QObject::tr( "Category:") + "</b> ";
+ text += "<br><b>" + QObject::tr( "Category:") + "</b> ";
text += categoryNames("Contacts").join(", ");
- text += "<br>";
}
diff --git a/libopie/pim/ocontact.h b/libopie/pim/ocontact.h
index dd2de17..9a1a8dc 100644
--- a/libopie/pim/ocontact.h
+++ b/libopie/pim/ocontact.h
@@ -33,5 +33,5 @@ QPC_TEMPLATEEXTERN template class QPC_EXPORT QMap<int, QString>;
#endif
-class ContactPrivate;
+class OContactPrivate;
/**
@@ -50,4 +50,9 @@ public:
virtual ~OContact();
+ enum DateFormat{
+ Zip_City_State = 0,
+ City_State_Zip
+ };
+
/*
* do we need to inline them
@@ -234,5 +239,5 @@ private:
QMap<int, QString> mMap;
- ContactPrivate *d;
+ OContactPrivate *d;
};
diff --git a/libopie/pim/ocontactaccess.h b/libopie/pim/ocontactaccess.h
index e90db32..9b0a719 100644
--- a/libopie/pim/ocontactaccess.h
+++ b/libopie/pim/ocontactaccess.h
@@ -18,4 +18,12 @@
* History:
* $Log$
+ * Revision 1.9 2003/08/01 12:30:16 eilers
+ * Merging changes from BRANCH_1_0 to HEAD
+ *
+ * Revision 1.8.2.1 2003/06/30 14:34:19 eilers
+ * Patches from Zecke:
+ * Fixing and cleaning up extraMap handling
+ * Adding d_ptr for binary compatibility in the future
+ *
* Revision 1.8 2003/05/08 13:55:09 tille
* search stuff
@@ -166,4 +174,7 @@ class OContactAccess: public QObject, public OPimAccessTemplate<OContact>
void copMessage( const QCString &msg, const QByteArray &data );
+ private:
+ class Private;
+ Private *d;
};
diff --git a/libopie/pim/ocontactaccessbackend.h b/libopie/pim/ocontactaccessbackend.h
index ebeb42d..280e05c 100644
--- a/libopie/pim/ocontactaccessbackend.h
+++ b/libopie/pim/ocontactaccessbackend.h
@@ -20,4 +20,12 @@
* History:
* $Log$
+ * Revision 1.6 2003/08/01 12:30:16 eilers
+ * Merging changes from BRANCH_1_0 to HEAD
+ *
+ * Revision 1.5.4.1 2003/06/30 14:34:19 eilers
+ * Patches from Zecke:
+ * Fixing and cleaning up extraMap handling
+ * Adding d_ptr for binary compatibility in the future
+ *
* Revision 1.5 2003/04/13 18:07:10 zecke
* More API doc
@@ -103,5 +111,9 @@ class OContactAccessBackend: public OPimAccessBackend<OContact> {
*/
virtual QArray<int> sorted( bool ascending, int sortOrder, int sortFilter, int cat ) = 0;
-
+
+
+private:
+ class Private;
+ Private *d;
};
#endif
diff --git a/libopie/pim/ocontactaccessbackend_vcard.cpp b/libopie/pim/ocontactaccessbackend_vcard.cpp
index 270bef3..b60c5be 100644
--- a/libopie/pim/ocontactaccessbackend_vcard.cpp
+++ b/libopie/pim/ocontactaccessbackend_vcard.cpp
@@ -18,4 +18,19 @@
* History:
* $Log$
+ * Revision 1.11 2003/08/01 12:30:16 eilers
+ * Merging changes from BRANCH_1_0 to HEAD
+ *
+ * Revision 1.10.4.3 2003/07/23 08:54:37 eilers
+ * Default email was added to the list of all emails, which already contains
+ * the default email..
+ * This closes bug #1045
+ *
+ * Revision 1.10.4.2 2003/07/23 08:44:45 eilers
+ * Importing of Notes in vcard files wasn't implemented.
+ * Closes bug #1044
+ *
+ * Revision 1.10.4.1 2003/06/02 13:37:49 eilers
+ * Fixing memory leak
+ *
* Revision 1.10 2003/04/13 18:07:10 zecke
* More API doc
@@ -152,4 +167,5 @@ bool OContactAccessBackend_VCard::save()
}
cleanStrTbl();
+ deleteVObject( obj );
m_dirty = false;
@@ -447,5 +463,7 @@ OContact OContactAccessBackend_VCard::parseVObject( VObject *obj )
}
-
+ else if ( name == VCCommentProp ) {
+ c.setNotes( value );
+ }
#if 0
else {
@@ -535,5 +553,5 @@ VObject* OContactAccessBackend_VCard::createVObject( const OContact &c )
QStringList emails = c.emailList();
- emails.prepend( c.defaultEmail() );
+ // emails.prepend( c.defaultEmail() ); Fix for bugreport #1045
for( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) {
VObject *email = safeAddPropValue( vcard, VCEmailAddressProp, *it );
diff --git a/libopie/pim/ocontactaccessbackend_xml.cpp b/libopie/pim/ocontactaccessbackend_xml.cpp
index 097142b..1c21619 100644
--- a/libopie/pim/ocontactaccessbackend_xml.cpp
+++ b/libopie/pim/ocontactaccessbackend_xml.cpp
@@ -18,4 +18,7 @@
* History:
* $Log$
+ * Revision 1.7 2003/08/01 12:30:16 eilers
+ * Merging changes from BRANCH_1_0 to HEAD
+ *
* Revision 1.6 2003/07/07 16:19:47 eilers
* Fixing serious bug in hasQuerySettings()
diff --git a/libopie/pim/oconversion.h b/libopie/pim/oconversion.h
index 13367e1..4c0a497 100644
--- a/libopie/pim/oconversion.h
+++ b/libopie/pim/oconversion.h
@@ -38,4 +38,9 @@ public:
static QString dateTimeToString( const QDateTime& );
static QDateTime dateTimeFromString( const QString& );
+
+private:
+ class Private;
+ Private* d;
+
};
diff --git a/libopie/pim/odatebookaccessbackend.h b/libopie/pim/odatebookaccessbackend.h
index 86ff298..3c02c42 100644
--- a/libopie/pim/odatebookaccessbackend.h
+++ b/libopie/pim/odatebookaccessbackend.h
@@ -69,4 +69,8 @@ public:
virtual OEffectiveEvent::ValueList effecticeEvents( const QDateTime& start );
+private:
+ class Private;
+ Private *d;
+
};
diff --git a/libopie/pim/odatebookaccessbackend_xml.cpp b/libopie/pim/odatebookaccessbackend_xml.cpp
index ab2eea4..5ea945c 100644
--- a/libopie/pim/odatebookaccessbackend_xml.cpp
+++ b/libopie/pim/odatebookaccessbackend_xml.cpp
@@ -431,7 +431,7 @@ bool ODateBookAccessBackend_XML::loadFile() {
find = dict[attr.data()];
if (!find)
- ev.setCustomField( attr, value );
+ ev.setCustomField( attr, str );
else {
- setField( ev, *find, value );
+ setField( ev, *find, str );
}
}
@@ -454,5 +454,5 @@ void ODateBookAccessBackend_XML::finalizeRecord( OEvent& ev ) {
}else {
/* to current date time */
- qWarning(" Start is %d", start );
+ // qWarning(" Start is %d", start );
OTimeZone zone( ev.timeZone().isEmpty() ? OTimeZone::current() : ev.timeZone() );
QDateTime date = zone.toDateTime( start );
diff --git a/libopie/pim/opimaccessbackend.h b/libopie/pim/opimaccessbackend.h
index f4bbe35..c3d91f7 100644
--- a/libopie/pim/opimaccessbackend.h
+++ b/libopie/pim/opimaccessbackend.h
@@ -8,4 +8,5 @@
+class OPimAccessBackendPrivate;
/**
* OPimAccessBackend is the base class
@@ -108,6 +109,5 @@ protected:
private:
- class Private;
- Private* d;
+ OPimAccessBackendPrivate *d;
Frontend* m_front;
uint m_read;
diff --git a/libopie/pim/opimaccesstemplate.h b/libopie/pim/opimaccesstemplate.h
index 8ff205c..ecbeb68 100644
--- a/libopie/pim/opimaccesstemplate.h
+++ b/libopie/pim/opimaccesstemplate.h
@@ -11,4 +11,5 @@
#include "otemplatebase.h"
+class OPimAccessTemplatePrivate;
/**
* Thats the frontend to our OPIE PIM
@@ -153,4 +154,7 @@ protected:
Cache m_cache;
+private:
+ OPimAccessTemplatePrivate *d;
+
};
diff --git a/libopie/pim/opimcache.h b/libopie/pim/opimcache.h
index 73414e5..7f7cff5 100644
--- a/libopie/pim/opimcache.h
+++ b/libopie/pim/opimcache.h
@@ -6,4 +6,6 @@
#include "opimrecord.h"
+class OPimCacheItemPrivate;
+
template <class T = OPimRecord>
class OPimCacheItem {
@@ -19,6 +21,9 @@ public:
private:
T m_t;
+ OPimCacheItemPrivate *d;
};
+
+class OPimCachePrivate;
/**
* OPimCache for caching the items
@@ -47,4 +52,5 @@ public:
private:
QIntCache<Item> m_cache;
+ OPimCachePrivate* d;
};
diff --git a/libopie/pim/opimmainwindow.cpp b/libopie/pim/opimmainwindow.cpp
index 4044bc1..2739e26 100644
--- a/libopie/pim/opimmainwindow.cpp
+++ b/libopie/pim/opimmainwindow.cpp
@@ -5,4 +5,5 @@
#include <qpe/sound.h>
#include <qpe/qcopenvelope_qws.h>
+#include <qpe/qpeapplication.h>
#include "opimresolver.h"
@@ -39,4 +40,5 @@ void OPimMainWindow::doSetDocument( const QString& ) {
}
void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) {
+ bool needShow = false;
/*
* create demands to create
@@ -45,7 +47,9 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
QDataStream stream(array, IO_ReadOnly);
if ( cmd == "create()" ) {
+ raise();
int uid = create();
QCopEnvelope e(m_str, "created(int)" );
e << uid;
+ needShow = true;
}else if ( cmd == "remove(int)" ) {
int uid;
@@ -54,4 +58,5 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
QCopEnvelope e(m_str, "removed(bool)" );
e << rem;
+ needShow = true;
}else if ( cmd == "beam(int)" ) {
int uid;
@@ -59,8 +64,11 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
beam( uid);
}else if ( cmd == "show(int)" ) {
+ raise();
int uid;
stream >> uid;
show( uid );
+ needShow = true;
}else if ( cmd == "edit(int)" ) {
+ raise();
int uid;
stream >> uid;
@@ -76,4 +84,5 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
delete m_fallBack;
}else if ( cmd == "alarm(QDateTime,int)" ) {
+ raise();
QDateTime dt; int uid;
stream >> dt;
@@ -84,6 +93,9 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
return;
doAlarm( dt, uid );
-
+ needShow = true;
}
+
+ if (needShow )
+ QPEApplication::setKeepRunning();
}
/* implement the url scripting here */
diff --git a/libopie/pim/opimxrefmanager.h b/libopie/pim/opimxrefmanager.h
index 39e5eef..c485e98 100644
--- a/libopie/pim/opimxrefmanager.h
+++ b/libopie/pim/opimxrefmanager.h
@@ -37,4 +37,6 @@ public:
private:
OPimXRef::ValueList m_list;
+ class Private;
+ Private *d;
};
diff --git a/libopie/pim/orecordlist.h b/libopie/pim/orecordlist.h
index edcd729..5211f57 100644
--- a/libopie/pim/orecordlist.h
+++ b/libopie/pim/orecordlist.h
@@ -8,4 +8,5 @@
#include "opimrecord.h"
+class ORecordListIteratorPrivate;
/**
* Our List Iterator
@@ -72,7 +73,8 @@ private:
/* d pointer for future versions */
- class IteratorPrivate;
- IteratorPrivate *d;
+ ORecordListIteratorPrivate *d;
};
+
+class ORecordListPrivate;
/**
* The recordlist used as a return type
@@ -112,5 +114,5 @@ ORecordList( const QArray<int>& ids,
int uidAt(uint i );
- /**
+ /**
* Remove the contact with given uid
*/
@@ -124,4 +126,5 @@ private:
QArray<int> m_ids;
const Base* m_acc;
+ ORecordListPrivate *d;
};
@@ -221,4 +224,7 @@ ORecordListIterator<T>::ORecordListIterator( const QArray<int> uids,
m_direction( false )
{
+ /* if the list is empty we're already at the end of the list */
+ if (uids.count() == 0 )
+ m_end = true;
}
template <class T>
diff --git a/libopie/pim/otemplatebase.h b/libopie/pim/otemplatebase.h
index 29fb6ec..cadac74 100644
--- a/libopie/pim/otemplatebase.h
+++ b/libopie/pim/otemplatebase.h
@@ -15,4 +15,5 @@
* POOR mans interface
*/
+class OPimBasePrivate;
struct OPimBase {
/**
@@ -33,4 +34,6 @@ struct OPimBase {
* -zecke
*/
+private:
+ OPimBasePrivate* d;
};
@@ -39,4 +42,5 @@ struct OPimBase {
* T needs to implement the copy c'tor!!!
*/
+class OTemplateBasePrivate;
template <class T = OPimRecord>
class OTemplateBase : public OPimBase {
@@ -62,4 +66,7 @@ public:
OPimRecord* record(int uid )const;
static T* rec();
+
+private:
+ OTemplateBasePrivate *d;
};
diff --git a/libopie/pim/otodo.cpp b/libopie/pim/otodo.cpp
index 38b93f7..5a18c37 100644
--- a/libopie/pim/otodo.cpp
+++ b/libopie/pim/otodo.cpp
@@ -29,4 +29,9 @@ struct OTodo::OTodoData : public QShared {
notifiers = 0;
};
+ ~OTodoData() {
+ delete recur;
+ delete maintainer;
+ delete notifiers;
+ }
QDate date;
@@ -275,5 +280,5 @@ QString OTodo::toRichText() const
// summary
- text += "<b><h3><img src=\"todo/TodoList\">";
+ text += "<b><h3><img src=\"todo/TodoList\"> ";
if ( !summary().isEmpty() ) {
text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "" );
@@ -283,6 +288,6 @@ QString OTodo::toRichText() const
// description
if( !description().isEmpty() ){
- text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
- text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) ;
+ text += "<b>" + QObject::tr( "Notes:" ) + "</b><br>";
+ text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
}
@@ -290,7 +295,6 @@ QString OTodo::toRichText() const
int priorityval = priority();
text += "<b>" + QObject::tr( "Priority:") +" </b><img src=\"todo/priority" +
- QString::number( priorityval ) + "\">";
-// text += "<b>" + QObject::tr( "Priority:") +"</b><img src=\"todo/priority" +
-// QString::number( priority() ) + "\"><br>";
+ QString::number( priorityval ) + "\"> ";
+
switch ( priorityval )
{
diff --git a/libopie/pim/otodo.h b/libopie/pim/otodo.h
index f9a345a..6df98b9 100644
--- a/libopie/pim/otodo.h
+++ b/libopie/pim/otodo.h
@@ -99,9 +99,4 @@ public:
/**
- * Does this Event has an alarm time ?
- */
- bool hasAlarmDateTime() const;
-
- /**
* What is the priority?
*/
@@ -242,8 +237,4 @@ public:
void setRecurrence( const ORecur& );
- /**
- * set the alarm time
- */
- void setAlarmDateTime ( const QDateTime& alarm );
void setDescription(const QString& );
diff --git a/libopie/pim/otodoaccessbackend.h b/libopie/pim/otodoaccessbackend.h
index 05e8ca9..6be95bc 100644
--- a/libopie/pim/otodoaccessbackend.h
+++ b/libopie/pim/otodoaccessbackend.h
@@ -19,4 +19,8 @@ public:
virtual void removeAllCompleted() = 0;
virtual QBitArray supports()const = 0;
+
+private:
+ class Private;
+ Private *d;
};
diff --git a/libopie/pim/otodoaccessvcal.cpp b/libopie/pim/otodoaccessvcal.cpp
index 3577e14..6415952 100644
--- a/libopie/pim/otodoaccessvcal.cpp
+++ b/libopie/pim/otodoaccessvcal.cpp
@@ -16,10 +16,18 @@ namespace {
if( ( ob = isAPropertyOf( obj, VCDescriptionProp )) != 0 ){
name = vObjectStringZValue( ob );
+#if 0
event.setDescription( name );
+#else
+ event.setSummary( name );
+#endif
}
// summary
if ( ( ob = isAPropertyOf( obj, VCSummaryProp ) ) != 0 ) {
name = vObjectStringZValue( ob );
+#if 0
event.setSummary( name );
+#else
+ event.setDescription( name );
+#endif
}
// completed
@@ -75,4 +83,12 @@ namespace {
event.idsToString( event.categories() ).local8Bit() );
+#if 0
+
+ // There seems a misrepresentation between summary in otodoevent
+ // and summary in vcard.
+ // The same with description..
+ // Description is summary and vice versa.. Argh.. (eilers)
+
+
addPropValue( task, VCDescriptionProp,
event.description().local8Bit() );
@@ -80,4 +96,12 @@ namespace {
addPropValue( task, VCSummaryProp,
event.summary().local8Bit() );
+
+#else
+ addPropValue( task, VCDescriptionProp,
+ event.summary().local8Bit() );
+
+ addPropValue( task, VCSummaryProp,
+ event.description().local8Bit() );
+#endif
return task;
};
@@ -186,5 +210,5 @@ QArray<int> OTodoAccessVCal::allRecords()const {
return ar;
}
-QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp &r)const {
+QArray<int> OTodoAccessVCal::matchRegexp(const QRegExp& /* r */)const {
QArray<int> ar(0);
return ar;
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp
index 3d15354..f688735 100644
--- a/libopie/pim/otodoaccessxml.cpp
+++ b/libopie/pim/otodoaccessxml.cpp
@@ -88,5 +88,5 @@ bool OTodoAccessXML::load() {
* UPDATE dict if you change anything!!!
*/
- QAsciiDict<int> dict(21);
+ QAsciiDict<int> dict(26);
dict.setAutoDelete( TRUE );
dict.insert("Categories" , new int(OTodo::Category) );
@@ -837,8 +837,10 @@ QArray<int> OTodoAccessXML::sorted( bool asc, int sortOrder,
};
void OTodoAccessXML::removeAllCompleted() {
+ QMap<int, OTodo> events = m_events;
for ( QMap<int, OTodo>::Iterator it = m_events.begin(); it != m_events.end(); ++it ) {
if ( (*it).isCompleted() )
- m_events.remove( it );
+ events.remove( it.key() );
}
+ m_events = events;
}
QBitArray OTodoAccessXML::supports()const {