Bug 87972 - Re-grid setting in plot dialog is not defaulted correctly after loading a .kst file
Summary: Re-grid setting in plot dialog is not defaulted correctly after loading a .ks...
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Rick Chern
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-24 21:39 UTC by Rick Chern
Modified: 2004-08-24 23:02 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rick Chern 2004-08-24 21:39:53 UTC
Version:           1.0.0_devel (using KDE KDE 3.2.1)
Installed from:    Unlisted Binary Package
OS:                Linux

How to reproduce:
- start kst
- produce 4 plots using data wizard
- save the kst session to file
- (optionally close kst)
- open the saved kst session
- open the plot dialog

The re-grid setting has columns set to 1, even though it should be set to 2.
Also, if a custom layout was used before saving, the re-grid setting is checked after loading, even though it should not be.
Comment 1 Rick Chern 2004-08-24 23:02:47 UTC
CVS commit by rchern: 

Save the <columns> tag as part of the window, not the plot 

CCMAIL: 87972-done@bugs.kde.org


  M +5 -2      ksttoplevelview.cpp   1.73
  M +3 -4      kstviewobject.cpp   1.89


--- kdeextragear-2/kst/kst/ksttoplevelview.cpp  #1.72:1.73
@@ -32,4 +32,5 @@
 KstTopLevelView::KstTopLevelView(QWidget *parent, const char *name, WFlags w)
 : KstViewObject("KstTopLevelView"), _w(new KstViewWidget(this, parent, name, w)) {
+  _onGrid = true;
   commonConstructor();
 }
@@ -44,5 +44,4 @@ KstTopLevelView::KstTopLevelView(QDomEle
 
 void KstTopLevelView::commonConstructor() {
-  _onGrid = true;
   _focusOn = false;
   setViewMode(_mode = DisplayMode);
@@ -64,4 +63,8 @@ KstObject::UpdateType KstTopLevelView::u
 
 void KstTopLevelView::save(QTextStream& ts) {
+  if (_onGrid && _columns > 0) { // only if on a grid and we have contents
+    ts << "  <columns>" << _columns << "</columns>" << endl;
+  }
+
   for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
     (*i)->saveTag(ts);

--- kdeextragear-2/kst/kst/kstviewobject.cpp  #1.88:1.89
@@ -61,5 +61,5 @@ void KstViewObject::load(QDomElement& e)
   _layoutActions = 0;
   _maximized = false;
-  _onGrid = true;
+  _onGrid = false;
   _columns = 0;
   _focus = false;
@@ -127,4 +127,5 @@ KstObject::UpdateType KstViewObject::upd
 
 void KstViewObject::save(QTextStream& ts) {
+KstDebug::self()->log(i18n("KstViewObject::save was called"), KstDebug::Warning);
   KstAspectRatio aspect;
 
@@ -140,7 +141,5 @@ void KstViewObject::save(QTextStream& ts
                "\" w=\"" << aspect.w <<
                "\" h=\"" << aspect.h << "\" />" << endl;
-  if (_onGrid && _columns > 0) { // only if on a grid and we have contents
-    ts << "  <columns>" << _columns << "</columns>" << endl;
-  }
+               
   for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
     (*i)->save(ts);