[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Mon Jan 31 03:35:11 CET 2005
CVS commit by staikos:
- add ability to save data source configs for specific instances
(note: this would have to be done via XML)
- add a d-ptr and commit to BC for the next release
M +9 -2 kstdatasource.cpp 1.51
M +5 -1 kstdatasource.h 1.32
--- kdeextragear-2/kst/kst/kstdatasource.h #1.31:1.32
@@ -198,5 +198,4 @@ class KstDataSourceList : public KstObje
-// BINARY COMPATIBILITY IS NOT YET GUARANTEED
class KstDataSourceConfigWidget : public QWidget {
Q_OBJECT
@@ -213,4 +212,9 @@ class KstDataSourceConfigWidget : public
protected:
KConfig *_cfg;
+ // If _instance is nonzero, then your settings are to be saved for this
+ // particular instance of the source, as opposed to globally.
+ KstDataSourcePtr _instance;
+ class Private;
+ Private *d;
};
--- kdeextragear-2/kst/kst/kstdatasource.cpp #1.50:1.51
@@ -303,5 +303,12 @@ KstDataSourcePtr KstDataSource::loadSour
KstDataSourceConfigWidget* KstDataSource::configWidget() const {
- return configWidgetForSource(_filename, fileType());
+ KstDataSourceConfigWidget *w = configWidgetForSource(_filename, fileType());
+ if (w) {
+ // FIXME: what to do here? This is ugly, but the method is const and we
+ // can't put a const shared pointer in the config widget. Fix for
+ // Kst 2.0 by making this non-const?
+ w->_instance = const_cast<KstDataSource*>(this);
+ }
+ return w;
}
@@ -600,5 +607,5 @@ int KstDataSource::relativeTimeForSample
/////////////////////////////////////////////////////////////////////////////
KstDataSourceConfigWidget::KstDataSourceConfigWidget()
-: QWidget(0L), _cfg(0L) {
+: QWidget(0L), _cfg(0L), d(0L) {
}
More information about the Kst
mailing list