[Kst] kdeextragear-2/kst/kst/datasources/planck
George Staikos
staikos at kde.org
Wed Feb 4 17:30:15 CET 2004
CVS commit by staikos:
updates working
M +0 -4 planck.cpp 1.13
M +42 -24 plancktoi.cpp 1.12
--- kdeextragear-2/kst/kst/datasources/planck/planck.cpp #1.12:1.13
@@ -46,8 +46,4 @@ PlanckSource::~PlanckSource() {
KstObject::UpdateType PlanckSource::update(int u) {
Q_UNUSED(u)
- // We have to update:
- // - object list - an object disappears from a group being watched
- // - ranges - range of an object in a group being watched is changed
- // - new contents?
if (_valid && _planckTOI && _planckTOI->updated()) {
return KstObject::UPDATE;
--- kdeextragear-2/kst/kst/datasources/planck/plancktoi.cpp #1.11:1.12
@@ -38,4 +38,6 @@ class Planck::TOIGroup {
void close();
+ bool updateObjectList();
+
#ifdef KST_HAVE_PLANCK
PIOSTRING *objTypes;
@@ -72,7 +74,11 @@ bool TOI::updated() const {
#ifdef KST_HAVE_PLANCK
if (_isValid) {
- const TOIGroup *tg = findGroup(_group);
+ TOIGroup *tg = findGroup(_group);
if (tg) {
- return PIOUPDATE == PIOCheckUpdateGrp(tg->_group);
+ bool rc = PIOUPDATE == PIOCheckUpdateGrp(tg->_group);
+ if (rc) {
+ tg->updateObjectList();
+ }
+ return rc;
}
}
@@ -299,21 +305,12 @@ void TOIGroup::close() {
-bool TOIGroup::open(const QString& groupURL) {
-#ifdef PIOLIBDEBUG
- kdDebug() << ">>>>>>>>> TOIGroup open - " << groupURL << endl;
-#endif
-#ifdef KST_HAVE_PLANCK
-
- close();
-
- // API bug
- _group = PIOOpenVoidGrp(const_cast<char*>(groupURL.latin1()), const_cast<char*>("r"));
+bool TOIGroup::updateObjectList() {
+ if (objNames) {
+ free(objNames);
+ objNames = 0L;
+ free(objTypes);
+ objTypes = 0L;
+ }
- if (_group) {
- assert(!objNames);
- assert(!objTypes);
-#ifdef PIOLIBDEBUG
- kdDebug() << " -> opened." << endl;
-#endif
PIOErr e = PIOGetObjList(&objNames, &objTypes, _group);
if (e > 0) {
@@ -335,5 +332,26 @@ bool TOIGroup::open(const QString& group
#endif
}
- } else {
+ return true;
+ }
+ return false;
+}
+
+
+bool TOIGroup::open(const QString& groupURL) {
+#ifdef PIOLIBDEBUG
+ kdDebug() << ">>>>>>>>> TOIGroup open - " << groupURL << endl;
+#endif
+#ifdef KST_HAVE_PLANCK
+
+ close();
+
+ // API bug
+ _group = PIOOpenVoidGrp(const_cast<char*>(groupURL.latin1()), const_cast<char*>("r"));
+
+ if (_group) {
+#ifdef PIOLIBDEBUG
+ kdDebug() << " -> opened." << endl;
+#endif
+ if (!updateObjectList()) {
PIOCloseVoidGrp(_group);
objectListSize = 0;
More information about the Kst
mailing list