[rkward-cvs] [rkward] /: Fix validity-check and requiredness-handling for <valueslot>

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Jan 7 09:06:54 UTC 2015


Git commit b859d7636b3a728e481a071054fd09e4e4a7050e by Thomas Friedrichsmeier.
Committed on 07/01/2015 at 07:57.
Pushed by tfry into branch 'master'.

Fix validity-check and requiredness-handling for <valueslot>

M  +1    -0    ChangeLog
M  +1    -2    rkward/plugin/rkcomponentproperties.cpp
M  +1    -1    rkward/plugin/rkvarslot.cpp
M  +1    -1    rkward/plugins/data/recode_categorical.xml

http://commits.kde.org/rkward/b859d7636b3a728e481a071054fd09e4e4a7050e

diff --git a/ChangeLog b/ChangeLog
index 76743f7..6491636 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+- Fixed: <valueslot>s were quirky with respect to showing as invalid
 - Fix a hang-on-exit issue
 - Add R function rk.set.plugin.status() to allow further customization of loaded plugins (hiding of individual menu entries)
 - Pluginmap-management was reworked, partially, and moved to Settings->Manage R packages and plugins
diff --git a/rkward/plugin/rkcomponentproperties.cpp b/rkward/plugin/rkcomponentproperties.cpp
index 017db0a..5807e76 100644
--- a/rkward/plugin/rkcomponentproperties.cpp
+++ b/rkward/plugin/rkcomponentproperties.cpp
@@ -173,8 +173,7 @@ void RKComponentPropertyAbstractList::setAllowedLength ( int min_num_items, int
 	RKComponentPropertyAbstractList::min_num_items = min_num_items;
 	RKComponentPropertyAbstractList::min_num_items_if_any = min_num_items_if_any;
 	RKComponentPropertyAbstractList::max_num_items = max_num_items;
-
-	// TODO: re-validize?
+	is_valid = checkListLength ();
 }
 
 bool RKComponentPropertyAbstractList::checkListLength () {
diff --git a/rkward/plugin/rkvarslot.cpp b/rkward/plugin/rkvarslot.cpp
index 2d17973..83a4ca1 100644
--- a/rkward/plugin/rkvarslot.cpp
+++ b/rkward/plugin/rkvarslot.cpp
@@ -101,11 +101,11 @@ RKVarSlot::RKVarSlot (const QDomElement &element, RKComponent *parent_component,
 	if (mode == Varslot) {
 		// initialize filters
 		static_cast<RKComponentPropertyRObjects*> (available)->setClassFilter (xml->getStringAttribute (element, "classes", QString (), DL_INFO).split (" ", QString::SkipEmptyParts));
-		setRequired (xml->getBoolAttribute (element, "required", false, DL_INFO));
 		static_cast<RKComponentPropertyRObjects*> (available)->setTypeFilter (xml->getStringAttribute (element, "types", QString::null, DL_INFO).split (" ", QString::SkipEmptyParts));
 		static_cast<RKComponentPropertyRObjects*> (available)->setDimensionFilter (xml->getIntAttribute (element, "num_dimensions", 0, DL_INFO), xml->getIntAttribute (element, "min_length", 0, DL_INFO), xml->getIntAttribute (element, "max_length", INT_MAX, DL_INFO));
 	}
 	available->setStripDuplicates (!xml->getBoolAttribute (element, "allow_duplicates", false, DL_INFO));
+	setRequired (xml->getBoolAttribute (element, "required", false, DL_INFO));
 
 	connect (available, SIGNAL (valueChanged(RKComponentPropertyBase*)), this, SLOT (availablePropertyChanged(RKComponentPropertyBase*)));
 	availablePropertyChanged (available);		// initialize
diff --git a/rkward/plugins/data/recode_categorical.xml b/rkward/plugins/data/recode_categorical.xml
index 2df0a9b..bc86dcb 100644
--- a/rkward/plugins/data/recode_categorical.xml
+++ b/rkward/plugins/data/recode_categorical.xml
@@ -80,7 +80,7 @@
 										</radio>
 										<row>
 											<embed id="levels" component="rkward::level_select"/>
-											<valueslot multi="true" min_vars="1" id="values" label="" source="levels.selector"/>
+											<valueslot multi="true" required="true" min_vars="1" id="values" label="" source="levels.selector"/>
 										</row>
 									</column>
 									<column>





More information about the rkward-tracker mailing list