[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Mon Aug 16 17:12:24 CEST 2004
CVS commit by staikos:
fix the last unresolved symbol on OS X, or so it seems according to nm.
M +9 -1 Makefile.am 1.137
M +18 -0 kstdatacollection.cpp 1.15
M +1 -0 kstdatacollection.h 1.20
M +6 -6 kstscalar.cpp 1.26
--- kdeextragear-2/kst/kst/kstscalar.cpp #1.25:1.26
@@ -25,5 +25,5 @@ static int iAnonymousScalarCounter = 0;
/** Create the base scalar */
-KstScalar::KstScalar(const QString& in_tag, double val, bool orphan, bool displayable, bool bLock)
+KstScalar::KstScalar(const QString& in_tag, double val, bool orphan, bool displayable, bool doLock)
: KstObject(), _orphan(orphan), _displayable(displayable) {
QString _tag = in_tag;
@@ -33,8 +33,8 @@ KstScalar::KstScalar(const QString& in_t
do {
_tag = nt.arg(iAnonymousScalarCounter++);
- } while (KST::vectorTagNameNotUnique(_tag, false));
+ } while (KST::vectorTagNameNotUniqueInternal(_tag));
} else {
- while (KST::vectorTagNameNotUnique(_tag, false)) {
- _tag += "'";
+ while (KST::vectorTagNameNotUniqueInternal(_tag)) {
+ _tag += '\'';
}
}
@@ -43,9 +43,9 @@ KstScalar::KstScalar(const QString& in_t
// FIXME: passing in a lock variable indicates a design problem
- if (bLock) {
+ if (doLock) {
KST::scalarList.lock().writeLock();
}
KST::scalarList.append(this);
- if (bLock) {
+ if (doLock) {
KST::scalarList.lock().writeUnlock();
}
--- kdeextragear-2/kst/kst/kstdatacollection.cpp #1.14:1.15
@@ -72,3 +72,21 @@ void *KST::malloc(size_t size) {
}
+
+bool KST::vectorTagNameNotUniqueInternal(const QString& tag) {
+ /* verify that the tag name is not empty */
+ if (tag.stripWhiteSpace().isEmpty()) {
+ return true;
+ }
+
+ /* verify that the tag name is not used by a data object */
+ KstReadLocker ml(&KST::vectorList.lock());
+ KstReadLocker ml2(&KST::scalarList.lock());
+ if (KST::vectorList.findTag(tag) != KST::vectorList.end() ||
+ KST::scalarList.findTag(tag) != KST::scalarList.end()) {
+ return true;
+ }
+
+ return false;
+}
+
// vim: ts=2 sw=2 et
--- kdeextragear-2/kst/kst/kstdatacollection.h #1.19:1.20
@@ -43,4 +43,5 @@ namespace KST {
extern bool dataTagNameNotUnique(const QString& tag, bool warn = true, void *parent = 0L);
extern bool vectorTagNameNotUnique(const QString& tag, bool warn = true, void *parent = 0L);
+ extern bool vectorTagNameNotUniqueInternal(const QString& tag);
/** Save a vector to a file */
--- kdeextragear-2/kst/kst/Makefile.am #1.136:1.137
@@ -15,5 +15,13 @@
lib_LTLIBRARIES = libkst.la
-libkst_la_SOURCES = kstobject.cpp kstdatasource.cpp stdinsource.cpp kstextension.cpp kstdatacollection.cpp kstdebug.cpp rwlock.cpp kstscalar.cpp $(PROCPS_COPY)
+libkst_la_SOURCES = kstobject.cpp \
+ kstdatasource.cpp \
+ stdinsource.cpp \
+ kstextension.cpp \
+ kstdatacollection.cpp \
+ kstdebug.cpp \
+ rwlock.cpp \
+ kstscalar.cpp $(PROCPS_COPY)
+
libkst_la_LDFLAGS = -version-info 1:0:0 -no-undefined $(all_libraries)
libkst_la_LIBADD = $(LIB_KPARTS) $(LIB_KMDI)
More information about the Kst
mailing list