-rw-r--r-- | core/pim/today/today.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 67b23e1..450ecb7 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -23,30 +23,32 @@ | |||
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "today.h" | 31 | #include "today.h" |
32 | 32 | ||
33 | #include <opie2/odebug.h> | 33 | #include <opie2/odebug.h> |
34 | #include <opie2/opluginloader.h> | 34 | #include <opie2/opluginloader.h> |
35 | #include <opie2/opimcontact.h> | ||
36 | #include <opie2/ocontactaccessbackend_vcard.h> | ||
37 | #include <opie2/ocontactaccess.h> | ||
35 | #include <opie2/oconfig.h> | 38 | #include <opie2/oconfig.h> |
36 | #include <opie2/oresource.h> | 39 | #include <opie2/oresource.h> |
37 | 40 | ||
38 | #include <qpe/qcopenvelope_qws.h> | 41 | #include <qpe/qcopenvelope_qws.h> |
39 | #include <qpe/qpeapplication.h> | 42 | #include <qpe/qpeapplication.h> |
40 | #include <qpe/contact.h> | ||
41 | 43 | ||
42 | #include <qdir.h> | 44 | #include <qdir.h> |
43 | #include <qtimer.h> | 45 | #include <qtimer.h> |
44 | #include <qwhatsthis.h> | 46 | #include <qwhatsthis.h> |
45 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
46 | 48 | ||
47 | using namespace Opie::Ui; | 49 | using namespace Opie::Ui; |
48 | using Opie::Core::OPluginItem; | 50 | using Opie::Core::OPluginItem; |
49 | using Opie::Core::OPluginLoader; | 51 | using Opie::Core::OPluginLoader; |
50 | using Opie::Core::OPluginManager; | 52 | using Opie::Core::OPluginManager; |
51 | using Opie::Core::OConfig; | 53 | using Opie::Core::OConfig; |
52 | 54 | ||
@@ -123,27 +125,29 @@ void Today::setRefreshTimer( int interval ) { | |||
123 | // 0 is "never" case | 125 | // 0 is "never" case |
124 | if ( !interval == 0 ) { | 126 | if ( !interval == 0 ) { |
125 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); | 127 | connect( m_refreshTimer, SIGNAL( timeout() ), this, SLOT( refresh() ) ); |
126 | m_refreshTimer->changeInterval( interval ); | 128 | m_refreshTimer->changeInterval( interval ); |
127 | } | 129 | } |
128 | } | 130 | } |
129 | 131 | ||
130 | 132 | ||
131 | /** | 133 | /** |
132 | * Initialises the owner field with the default value, the username | 134 | * Initialises the owner field with the default value, the username |
133 | */ | 135 | */ |
134 | void Today::setOwnerField() { | 136 | void Today::setOwnerField() { |
135 | QString file = Global::applicationFileName( "addressbook", "businesscard.vcf" ); | 137 | QString vfilename = Global::applicationFileName("addressbook", "businesscard.vcf"); |
136 | if ( QFile::exists( file ) ) { | 138 | Opie::OPimContactAccess acc( "today", vfilename, |
137 | Contact cont = Contact::readVCard( file )[0]; | 139 | new Opie::OPimContactAccessBackend_VCard("today", vfilename ) ); |
140 | if ( acc.load() ) { | ||
141 | Opie::OPimContact cont = acc.allRecords()[0]; | ||
138 | QString returnString = cont.fullName(); | 142 | QString returnString = cont.fullName(); |
139 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); | 143 | OwnerField->setText( "<b>" + tr ( "Owned by " ) + returnString + "</b>" ); |
140 | } else { | 144 | } else { |
141 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); | 145 | OwnerField->setText( "<b>" + tr ( "Please fill out the business card" ) + " </b>" ); |
142 | } | 146 | } |
143 | } | 147 | } |
144 | 148 | ||
145 | /** | 149 | /** |
146 | * Set the owner field with a given QString, for example per qcop. | 150 | * Set the owner field with a given QString, for example per qcop. |
147 | */ | 151 | */ |
148 | void Today::setOwnerField( QString &message ) { | 152 | void Today::setOwnerField( QString &message ) { |
149 | if ( !message.isEmpty() ) { | 153 | if ( !message.isEmpty() ) { |