[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Thu Feb 5 15:13:22 CET 2004


CVS commit by staikos: 

Fix bug reported by Claude Mercier regarding unique name detection not working
in the vector dialog

CCMAIL: claude.mercier at ias.u-psud.fr


  M +7 -2      kstdatacollection-nogui.cpp   1.2
  M +1 -0      kstdatacollection.h   1.8
  M +16 -14    kstvectordialog_i.cpp   1.24


--- kdeextragear-2/kst/kst/kstdatacollection-nogui.cpp  #1.1:1.2
@@ -18,6 +18,10 @@
 #include "kstdatacollection.h"
 
+bool KST::tagNameNotUnique(const QString &tag, bool warn) {
+  return dataTagNameNotUnique(tag, warn) || vectorTagNameNotUnique(tag, warn);
+}
+
 bool KST::dataTagNameNotUnique(const QString &tag, bool warn) {
-  Q_UNUSED(warn);
+  Q_UNUSED(warn)
   /* verify that the tag name is not empty */
   if (tag.stripWhiteSpace().isEmpty()) {
@@ -34,5 +38,5 @@ bool KST::dataTagNameNotUnique(const QSt
 
 bool KST::vectorTagNameNotUnique(const QString &tag, bool warn) {
-  Q_UNUSED(warn);
+  Q_UNUSED(warn)
   /* verify that the tag name is not empty */
   if (tag.stripWhiteSpace().isEmpty()) {
@@ -49,2 +53,3 @@ bool KST::vectorTagNameNotUnique(const Q
 }
 
+// vim: ts=2 sw=2 et

--- kdeextragear-2/kst/kst/kstdatacollection.h  #1.7:1.8
@@ -44,4 +44,5 @@ namespace KST {
 
   /** check that a tag has not been used by any other tags */
+  extern bool tagNameNotUnique(const QString &tag, bool warn = true);
   extern bool dataTagNameNotUnique(const QString &tag, bool warn = true);
   extern bool vectorTagNameNotUnique(const QString &tag, bool warn = true);

--- kdeextragear-2/kst/kst/kstvectordialog_i.cpp  #1.23:1.24
@@ -237,5 +237,5 @@ void KstVectorDialogI::new_I() {
 
   int i_c = KST::vectorList.count() + 1;
-  while (KST::dataTagNameNotUnique(tag_name, false)) {
+  while (KST::vectorTagNameNotUnique(tag_name, false)) {
     tag_name.sprintf("V%d-", i_c);
     tag_name += Field->currentText();
@@ -298,5 +298,7 @@ void KstVectorDialogI::edit_I() {
     /* verify that the vector name is unique */
     if (Select->currentText() != vectorList[index]->tagName()) {
-      if (KST::dataTagNameNotUnique(Select->currentText())) return;
+      if (KST::vectorTagNameNotUnique(Select->currentText())) {
+        return;
+      }
     }
 





More information about the Kst mailing list