changeset 146:f90fad823cea

* Add Recent Files menu * (Untested attempt to) avoid hang when exporting sparse models to XML
author Chris Cannam
date Fri, 28 Jul 2006 11:09:36 +0000
parents 82f529a08cf3
children 3a13b0d4934e
files base/Model.cpp base/Model.h base/View.cpp
diffstat 3 files changed, 21 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/base/Model.cpp	Thu Jul 27 16:06:32 2006 +0000
+++ b/base/Model.cpp	Fri Jul 28 11:09:36 2006 +0000
@@ -16,6 +16,8 @@
 #include "Model.h"
 #include "PlayParameterRepository.h"
 
+#include <QTextStream>
+
 #include <iostream>
 
 const int Model::COMPLETION_UNKNOWN = -1;
@@ -31,6 +33,20 @@
     PlayParameterRepository::getInstance()->removeModel(this);
 }
 
+void
+Model::toXml(QTextStream &stream, QString indent,
+             QString extraAttributes) const
+{
+    stream << indent;
+    stream << QString("<model id=\"%1\" name=\"%2\" sampleRate=\"%3\" start=\"%4\" end=\"%5\" %6/>\n")
+	.arg(getObjectExportId(this))
+	.arg(encodeEntities(objectName()))
+	.arg(getSampleRate())
+	.arg(getStartFrame())
+	.arg(getEndFrame())
+	.arg(extraAttributes);
+}
+
 QString
 Model::toXmlString(QString indent, QString extraAttributes) const
 {
--- a/base/Model.h	Thu Jul 27 16:06:32 2006 +0000
+++ b/base/Model.h	Fri Jul 28 11:09:36 2006 +0000
@@ -93,6 +93,10 @@
     }
     static const int COMPLETION_UNKNOWN;
 
+    virtual void toXml(QTextStream &stream,
+                       QString indent = "",
+                       QString extraAttributes = "") const;
+
     virtual QString toXmlString(QString indent = "",
 				QString extraAttributes = "") const;
 
--- a/base/View.cpp	Thu Jul 27 16:06:32 2006 +0000
+++ b/base/View.cpp	Fri Jul 28 11:09:36 2006 +0000
@@ -678,7 +678,7 @@
     checkProgress(obj);
 
     update();
-//!!    update(x0, 0, x1 - x0 + 1, height());
+//!!!    update(x0, 0, x1 - x0 + 1, height());
 }    
 
 void