[Kst] extragear/graphics/kst/src/libkstapp
George Staikos
staikos at kde.org
Tue Aug 1 00:10:11 CEST 2006
SVN commit 568363 by staikos:
add a findPlotByName() helper to search through efficiently and find a plot,
and remove a dead function
M +21 -9 kst2dplot.cpp
M +1 -1 kst2dplot.h
--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.cpp #568362:568363
@@ -5263,6 +5263,27 @@
}
+Kst2DPlotPtr Kst2DPlot::findPlotByName(const QString& name) {
+ Kst2DPlotPtr rc;
+ KstApp *app = KstApp::inst();
+ KMdiIterator<KMdiChildView*> *it = app->createIterator();
+ if (it) {
+ while (it->currentItem()) {
+ KstViewWindow *view = dynamic_cast<KstViewWindow*>(it->currentItem());
+ if (view) {
+ rc = kst_cast<Kst2DPlot>(view->view()->findChild(name));
+ if (rc) {
+ break;
+ }
+ }
+ it->next();
+ }
+ app->deleteIterator(it);
+ }
+ return rc;
+}
+
+
// FIXME: this does not strip out dupes. Why? Because we can't have them
// by definition at present. this might change one day. Unfortunately
// removal of dupes makes O(n) code become O(n^2).
@@ -5285,15 +5306,6 @@
}
-Kst2DPlotList Kst2DPlot::plotListForWindow() {
- KstViewObjectPtr v = KstViewObjectPtr(this);
- while (v->parent()) {
- v = v->parent();
- }
- return v->findChildrenType<Kst2DPlot>(true);
-}
-
-
#ifndef WHEEL_DELTA
#define WHEEL_DELTA 120
#endif
--- trunk/extragear/graphics/kst/src/libkstapp/kst2dplot.h #568362:568363
@@ -95,7 +95,7 @@
virtual ~Kst2DPlot();
static Kst2DPlotList globalPlotList();
- Kst2DPlotList plotListForWindow();
+ static Kst2DPlotPtr findPlotByName(const QString& name);
static bool checkRange(double& min_in, double& max_in);
static bool checkLRange(double& min_in, double& max_in, bool isLog, double logBase);
static void genAxisTickLabel(QString& label, double z, bool isLog, double logBase);
More information about the Kst
mailing list