[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/work/kst/portto4/kst/src/libkstapp
From: George Staikos <staikos () kde ! org>
Date: 2007-05-31 20:24:23
Message-ID: 1180643063.779472.22781.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 670240 by staikos:
hook in xml stream reader, which does basically nothing. next step is to make
a factory for generating document nodes from the xml nodes.
M +27 -0 document.cpp
--- branches/work/kst/portto4/kst/src/libkstapp/document.cpp #670239:670240
@@ -12,6 +12,10 @@
#include "document.h"
#include "sessionmodel.h"
+#include <QDebug>
+#include <QFile>
+#include <QXmlStreamReader>
+
namespace Kst {
Document::Document()
@@ -31,10 +35,33 @@
bool Document::save(const QString& to) {
+ return false;
}
bool Document::open(const QString& file) {
+ QFile f(file);
+ if (!f.open(QIODevice::ReadOnly)) {
+ // QMessageBox::critical
+ return false;
+ }
+
+ QXmlStreamReader xml;
+ xml.setDevice(&f);
+
+ while (!xml.atEnd()) {
+ if (xml.isStartElement()) {
+ qDebug() << "Got a node: " << xml.name().toString();
+ }
+ xml.readNext();
+ }
+
+ if (xml.hasError()) {
+ // QMessageBox::critical
+ return false;
+ }
+
+ return true;
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic