summaryrefslogtreecommitdiff
path: root/libopie/pim/opimmainwindow.cpp
Side-by-side diff
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
@@ -5,2 +5,3 @@
+#include "opimresolver.h"
#include "opimmainwindow.h"
@@ -9,3 +10,3 @@ OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent,
const char* name, WFlags flag )
- : QMainWindow( parent, name, flag ), m_service( service ), m_fallBack(0l) {
+ : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) {
@@ -31,2 +32,5 @@ QCopChannel* OPimMainWindow::channel() {
}
+void OPimMainWindow::doSetDocument( const QString& ) {
+
+}
void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) {
@@ -71 +75,31 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
}
+/* implement the url scripting here */
+void OPimMainWindow::setDocument( const QString& str) {
+ doSetDocument( str );
+}
+/*
+ * we now try to get the array demarshalled
+ * check if the rtti matches this one
+ */
+OPimRecord* OPimMainWindow::record( int rtti, const QByteArray& array ) {
+ if ( service() != rtti )
+ return 0l;
+
+ OPimRecord* record = OPimResolver::self()->record( rtti );
+ QDataStream str(array, IO_ReadOnly );
+ if ( !record || !record->loadFromStream(str) ) {
+ delete record;
+ record = 0l;
+ }
+
+ return record;
+}
+/*
+ * get the rtti for the service
+ */
+int OPimMainWindow::service() {
+ if ( m_rtti == -1 )
+ m_rtti = OPimResolver::self()->serviceId( m_service );
+
+ return m_rtti;
+}