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

Peter Kümmel syntheticpp at yahoo.com
Wed Apr 28 15:15:03 CEST 2010


SVN commit 1120140 by kuemmel:

Don't crash when opening a .kst file.
But the plot is only visible after moving/resizing the kst windows.

CCBUG: 234390



 M  +1 -0      document.cpp  
 M  +1 -5      mainwindow.cpp  
 M  +3 -1      tabwidget.cpp  
 M  +2 -1      tabwidget.h  


--- branches/work/kst/portto4/kst/src/libkstapp/document.cpp #1120139:1120140
@@ -326,6 +326,7 @@
 
   UpdateManager::self()->doUpdates(true);
   setChanged(false);
+
   return _isOpen = true;
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1120139:1120140
@@ -275,16 +275,12 @@
   _doc = new Document(this);
 
   bool ok = _doc->open(file);
-  if (!ok) {
     QApplication::restoreOverrideCursor();
 
+  if (!ok) {
     QMessageBox::critical(this, tr("Kst"), tr("Error opening document '%1':\n%2").arg(file, _doc->lastError()));
     delete _doc;
     _doc = new Document(this);
-  } else {
-    UpdateManager::self()->doUpdates(true);
-    _doc->setChanged(false);
-    QApplication::restoreOverrideCursor();
   }
 }
 
--- branches/work/kst/portto4/kst/src/libkstapp/tabwidget.cpp #1120139:1120140
@@ -78,7 +78,9 @@
     createView();
     setCurrentIndex(0);
   }
-  delete currentView();
+  QWidget* tab = currentView();
+  removeTab(indexOf(tab));
+  delete tab;
 }
 
 
--- branches/work/kst/portto4/kst/src/libkstapp/tabwidget.h #1120139:1120140
@@ -21,6 +21,7 @@
 class TabWidget : public QTabWidget
 {
   Q_OBJECT
+
   public:
     TabWidget(QWidget *parent);
     ~TabWidget();
@@ -36,9 +37,9 @@
   private Q_SLOTS:
     void viewDestroyed(QObject *object);
     void contextMenu(const QPoint&);
+
   private:
     int _cnt;
-
 };
 
 }


More information about the Kst mailing list