[rkward] /: Remove useless index column in multi-varslots/-valueslots

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Jun 2 12:17:24 UTC 2015


Git commit 5d6db65e3c9004b7b1daa2bdedf6287ebc8c02ae by Thomas Friedrichsmeier.
Committed on 02/06/2015 at 12:17.
Pushed by tfry into branch 'master'.

Remove useless index column in multi-varslots/-valueslots

M  +1    -0    ChangeLog
M  +6    -8    rkward/plugin/rkvarslot.cpp

http://commits.kde.org/rkward/5d6db65e3c9004b7b1daa2bdedf6287ebc8c02ae

diff --git a/ChangeLog b/ChangeLog
index 9902209..a618f49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+- Don't show (useless) index number in mutli-value varslots and valueslots
 - Make the option to disable / enable editing more visible (in the data editor's toolbar)
 - Do not invoke symbol name completion while in the middle (not end) of a word
 - Add context menu to HTML viewer window, including the ability to open links in a new window
diff --git a/rkward/plugin/rkvarslot.cpp b/rkward/plugin/rkvarslot.cpp
index d01db1c..67976ea 100644
--- a/rkward/plugin/rkvarslot.cpp
+++ b/rkward/plugin/rkvarslot.cpp
@@ -2,7 +2,7 @@
                           rkvarslot.cpp  -  description
                              -------------------
     begin                : Thu Nov 7 2002
-    copyright            : (C) 2002-2014 by Thomas Friedrichsmeier
+    copyright            : (C) 2002-2015 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -56,7 +56,7 @@ RKVarSlot::RKVarSlot (const QDomElement &element, RKComponent *parent_component,
 
 	list = new QTreeWidget (this);
 	list->setSelectionMode (QAbstractItemView::ExtendedSelection);
-	list->setHeaderLabels (QStringList () << " " << i18n ("Name"));
+	list->setHeaderLabels (QStringList () << i18n ("Name"));
 	list->setSortingEnabled (false);
 	list->setUniformRowHeights (true);
 	list->setRootIsDecorated (false);
@@ -92,7 +92,6 @@ RKVarSlot::RKVarSlot (const QDomElement &element, RKComponent *parent_component,
 		list->getContentsMargins (&left, &top, &right, &bottom);
 		list->setFixedHeight (list->visualItemRect (&dummy).height () + 2*list->visualItemRect (&dummy).top () + top + bottom);
 		list->header ()->setStretchLastSection (true);
-		list->hideColumn (0);
 		list->setHorizontalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
 		list->setVerticalScrollBarPolicy (Qt::ScrollBarAlwaysOff);
 		g_layout->setRowStretch (3, 1);		// so the label does not get separated from the view
@@ -154,17 +153,16 @@ void RKVarSlot::availablePropertyChanged (RKComponentPropertyBase *) {
 	int len = available->listLength ();
 	for (int i = 0; i < len; ++i) {
 		QTreeWidgetItem *new_item = new QTreeWidgetItem (list);
-		new_item->setText (0, QString::number (i + 1));
 
 		if (mode == Valueslot) {
-			new_item->setText (1, static_cast<RKComponentPropertyStringList*> (available)->valueAt (i));
+			new_item->setText (0, static_cast<RKComponentPropertyStringList*> (available)->valueAt (i));
 		} else {
 			RObject *object = static_cast<RKComponentPropertyRObjects*> (available)->objectAt (i);
-			new_item->setText (1, object->getShortName ());
+			new_item->setText (0, object->getShortName ());
 			QString probs = static_cast<RKComponentPropertyRObjects*> (available)->objectProblems (i);
 			if (!probs.isEmpty ()) {
-				new_item->setToolTip (1, i18n ("<p>This object is not allowed, here, for the following reason(s):</p>") + probs);
-				new_item->setIcon (1, RKStandardIcons::getIcon (RKStandardIcons::ActionDeleteVar));
+				new_item->setToolTip (0, i18n ("<p>This object is not allowed, here, for the following reason(s):</p>") + probs);
+				new_item->setIcon (0, RKStandardIcons::getIcon (RKStandardIcons::ActionDeleteVar));
 			}
 		}
 	}



More information about the rkward-tracker mailing list