qtmobility/src/versit/qversitwriter_p.cpp
changeset 4 90517678cc4f
parent 1 2b40d63a9c3d
child 11 06b8e2af4411
--- a/qtmobility/src/versit/qversitwriter_p.cpp	Fri Apr 16 15:51:22 2010 +0300
+++ b/qtmobility/src/versit/qversitwriter_p.cpp	Mon May 03 13:18:40 2010 +0300
@@ -50,6 +50,7 @@
 #include <QMutexLocker>
 #include <QScopedPointer>
 #include <QTextCodec>
+#include <QBuffer>
 
 QTM_USE_NAMESPACE
 
@@ -68,13 +69,21 @@
 {
 }
 
+/*! Links the signals from this to the signals of \a writer. */
+void QVersitWriterPrivate::init(QVersitWriter* writer)
+{
+    qRegisterMetaType<QVersitWriter::State>("QVersitWriter::State");
+    connect(this, SIGNAL(stateChanged(QVersitWriter::State)),
+            writer, SIGNAL(stateChanged(QVersitWriter::State)), Qt::DirectConnection);
+}
+
 /*!
  * Do the actual writing and set the error and state appropriately.
  */
 void QVersitWriterPrivate::write()
 {
     bool canceled = false;
-    foreach (QVersitDocument document, mInput) {
+    foreach (const QVersitDocument& document, mInput) {
         if (isCanceling()) {
             canceled = true;
             break;