summaryrefslogtreecommitdiff
path: root/libopie/pim/opimmainwindow.cpp
authorzecke <zecke>2002-12-10 17:01:18 (UTC)
committer zecke <zecke>2002-12-10 17:01:18 (UTC)
commit4ecbf7407c19b59fc136c334f9386c53db453930 (patch) (unidiff)
tree1cba438e2533f7109af169b0b77988cec6664192 /libopie/pim/opimmainwindow.cpp
parent36375df6ff103e52455823f7afd64c4f4ae7fcb8 (diff)
downloadopie-4ecbf7407c19b59fc136c334f9386c53db453930.zip
opie-4ecbf7407c19b59fc136c334f9386c53db453930.tar.gz
opie-4ecbf7407c19b59fc136c334f9386c53db453930.tar.bz2
get in sync with HEAD again
-OPimBase was added to be used as a default struct inside OPimResolver and to work with DSOs -TodoListXML backend now uses mmap and madvise to load data -OContact added/changed rtti -OTodo added changed rtti OPimAccess* added stuff necessary for the Resolver and a 'state'/'hint' on how to load data OPimResolver which resolves uid + services to Records, rtti to QCOPChannels loads arbitary Service backends ( will work with DSOs soon ) -OPimMainWindow added some setDocument scripting possibility and internal marshalling and demarshalling of Records -OPimRecord added loadDataFromm and saveDataTo for marshalling purposes much more :)
Diffstat (limited to 'libopie/pim/opimmainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/opimmainwindow.cpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/libopie/pim/opimmainwindow.cpp b/libopie/pim/opimmainwindow.cpp
index 92be2fd..7e57f3a 100644
--- a/libopie/pim/opimmainwindow.cpp
+++ b/libopie/pim/opimmainwindow.cpp
@@ -3,11 +3,12 @@
3 3
4#include <qpe/qcopenvelope_qws.h> 4#include <qpe/qcopenvelope_qws.h>
5 5
6#include "opimresolver.h"
6#include "opimmainwindow.h" 7#include "opimmainwindow.h"
7 8
8OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, 9OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent,
9 const char* name, WFlags flag ) 10 const char* name, WFlags flag )
10 : QMainWindow( parent, name, flag ), m_service( service ), m_fallBack(0l) { 11 : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) {
11 12
12 /* 13 /*
13 * let's generate our QCopChannel 14 * let's generate our QCopChannel
@@ -29,6 +30,9 @@ OPimMainWindow::~OPimMainWindow() {
29QCopChannel* OPimMainWindow::channel() { 30QCopChannel* OPimMainWindow::channel() {
30 return m_channel; 31 return m_channel;
31} 32}
33void OPimMainWindow::doSetDocument( const QString& ) {
34
35}
32void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) { 36void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) {
33 /* 37 /*
34 * create demands to create 38 * create demands to create
@@ -69,3 +73,33 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
69 delete m_fallBack; 73 delete m_fallBack;
70 } 74 }
71} 75}
76/* implement the url scripting here */
77void OPimMainWindow::setDocument( const QString& str) {
78 doSetDocument( str );
79}
80/*
81 * we now try to get the array demarshalled
82 * check if the rtti matches this one
83 */
84OPimRecord* OPimMainWindow::record( int rtti, const QByteArray& array ) {
85 if ( service() != rtti )
86 return 0l;
87
88 OPimRecord* record = OPimResolver::self()->record( rtti );
89 QDataStream str(array, IO_ReadOnly );
90 if ( !record || !record->loadFromStream(str) ) {
91 delete record;
92 record = 0l;
93 }
94
95 return record;
96}
97/*
98 * get the rtti for the service
99 */
100int OPimMainWindow::service() {
101 if ( m_rtti == -1 )
102 m_rtti = OPimResolver::self()->serviceId( m_service );
103
104 return m_rtti;
105}