Version: 0.98-devel (using KDE KDE 3.2.1) Installed from: RedHat RPMs Compiler: gcc (GCC) 3.3.2 20031022 OS: Linux Autogenerated plot names don't seem to check existing plot names. How to reproduce: - start Kst - go to Plots->Edit Plots, enter P1 for Unique plot name, click "Apply as New" - enter name for new window if prompted - start Data Wizard, and create at least one plot with any data Go to Plots->Edit Plots, and there will be two plots with name P1 Expected Behaviour: Autogenerated plot name does not duplicate existing plot name. Is this because KST::suggestPlotName only uses a counter to generate plot names, and does not check existing plot names?
CVS commit by rchern: Make datawizard create plots in the same way as the data object dialogs, through KstViewWindow M +6 -6 datawizard.ui.h 1.57 --- kdeextragear-2/kst/kst/datawizard.ui.h #1.56:1.57 @@ -527,5 +527,5 @@ void DataWizard::finished() // Generate the plots if (_onePlot->isChecked()) { - Kst2DPlotPtr p = w->view()->createPlot<Kst2DPlot>(KST::suggestPlotName()); + Kst2DPlotPtr p = dynamic_cast<Kst2DPlot*>(w->view()->findChild(w->createPlot<Kst2DPlot>(KST::suggestPlotName())).data()); plots.append(p.data()); if (_radioButtonPlotDataPSD->isChecked()) { @@ -535,5 +535,5 @@ void DataWizard::finished() w = static_cast<KstViewWindow*>(app->findWindow(n)); } - Kst2DPlotPtr p = w->view()->createPlot<Kst2DPlot>(KST::suggestPlotName()); + Kst2DPlotPtr p = dynamic_cast<Kst2DPlot*>(w->view()->findChild(w->createPlot<Kst2DPlot>(KST::suggestPlotName())).data()); plots.append(p.data()); } @@ -542,5 +542,5 @@ void DataWizard::finished() if (_radioButtonPlotDataPSD->isChecked()) { for (uint i = 0; i < l.count(); ++i) { - p = w->view()->createPlot<Kst2DPlot>(KST::suggestPlotName()); + p = dynamic_cast<Kst2DPlot*>(w->view()->findChild(w->createPlot<Kst2DPlot>(KST::suggestPlotName())).data()); plots.append(p.data()); } @@ -552,5 +552,5 @@ void DataWizard::finished() } for (uint i = 0; i < l.count(); ++i) { - p = w->view()->createPlot<Kst2DPlot>(KST::suggestPlotName()); + p = dynamic_cast<Kst2DPlot*>(w->view()->findChild(w->createPlot<Kst2DPlot>(KST::suggestPlotName())).data()); plots.append(p.data()); } @@ -569,5 +569,5 @@ void DataWizard::finished() if (_radioButtonPlotDataPSD->isChecked()) { for (int i = 0; i < _plotNumber->value(); ++i) { - p = w->view()->createPlot<Kst2DPlot>(KST::suggestPlotName()); + p = dynamic_cast<Kst2DPlot*>(w->view()->findChild(w->createPlot<Kst2DPlot>(KST::suggestPlotName())).data()); plots.append(p.data()); } @@ -578,5 +578,5 @@ void DataWizard::finished() } for (int i = 0; i < _plotNumber->value(); ++i) { - p = w->view()->createPlot<Kst2DPlot>(KST::suggestPlotName()); + p = dynamic_cast<Kst2DPlot*>(w->view()->findChild(w->createPlot<Kst2DPlot>(KST::suggestPlotName())).data()); plots.append(p.data()); }