[Kst] branches/work/kst/portto4/kst/src/libkstapp

Barth Netterfield netterfield at astro.utoronto.ca
Thu Dec 3 00:13:12 CET 2009


SVN commit 1057620 by netterfield:

Fix crash.

Loading kst files still has update troubles.



 M  +6 -0      mainwindow.cpp  
 M  +1 -0      viewitemdialog.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1057619:1057620
@@ -231,6 +231,8 @@
 bool MainWindow::initFromCommandLine() {
   delete _doc;
   _doc = new Document(this);
+  UpdateManager::self()->setStore(_doc->objectStore());
+
   CommandLineParser P(_doc);
   bool ok = _doc->initFromCommandLine(&P);
   if (!P.pngFile().isEmpty()) {
@@ -247,12 +249,16 @@
 void MainWindow::openFile(const QString &file) {
   delete _doc;
   _doc = new Document(this);
+  UpdateManager::self()->setStore(_doc->objectStore());
+
   bool ok = _doc->open(file);
   if (!ok) {
     QMessageBox::critical(this, tr("Kst"), tr("Error opening document '%1':\n%2").arg(file, _doc->lastError()));
     delete _doc;
     _doc = new Document(this);
+    UpdateManager::self()->setStore(_doc->objectStore());
   } else {
+    UpdateManager::self()->doUpdates(true);
     _doc->setChanged(false);
   }
 }
--- branches/work/kst/portto4/kst/src/libkstapp/viewitemdialog.cpp #1057619:1057620
@@ -360,6 +360,7 @@
   } else {
     Q_ASSERT_X(false,"parent test", "item has no parentview item");
     parentWidth = parentHeight = 1.0;
+    parentX = parentY = 0.0;
   }
 
   qreal aspectRatio;


More information about the Kst mailing list