[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Fri Jan 7 00:45:39 CET 2005


CVS commit by arwalker: 

CCMAIL: 96441-done at bugs.kde.org

I think this addresses the problem. I've added an additional column to the list of vectors which is the position of the vector in the list. Sorting is done on this column by default, but can be changed by clicking on the column header.


  M +24 -6     datawizard.ui.h   1.105


--- kdeextragear-2/kst/kst/datawizard.ui.h  #1.104:1.105
@@ -31,4 +31,7 @@ void DataWizard::init()
     connect(finishButton(), SIGNAL(clicked()), this, SLOT(finished()));
 
+    _vectors->addColumn(i18n("Position"));
+    _vectors->setSorting(1);
+
     // No help button
     setHelpEnabled(_pageDataSource, false);
@@ -114,4 +117,7 @@ void DataWizard::sourceChanged( const QS
         bool complete = false;
         QString fileType;
+  QString str;
+  int index = 0;
+  int count;
 
         if (ds) {
@@ -143,7 +149,19 @@ void DataWizard::sourceChanged( const QS
         _xVector->completionObject()->insertItems(fl);
         _xVector->setEditable(!complete);
+
+  count = fl.count();
+  if (count > 0) {
+    count = 1+(int)log10((double)count);
+  } else {
+    count = 1;
+  }
         for (QStringList::ConstIterator it = fl.begin(); it != fl.end(); ++it) {
-            new QCheckListItem(_vectors, *it, QCheckListItem::CheckBox);
+            QCheckListItem *pItem = new QCheckListItem(_vectors, *it, QCheckListItem::CheckBox);
+      str.sprintf("%0*d", count, index);
+      pItem->setText(1, str);
+      index++;
         }
+  _vectors->sort();
+  
         KST::vectorDefaults.sync();
         QString defaultX = KST::vectorDefaults.wizardXVector();
@@ -310,5 +328,5 @@ void DataWizard::vectorSubset(const QStr
     QListViewItem *after = 0L;
     _vectors->clearSelection();
-    _vectors->setSorting(2, true); // Qt 3.1 compat
+    _vectors->setSorting(3, true); // Qt 3.1 compat
     QRegExp re(filter, true /* case insensitive */, true /* wildcard */);
     QListViewItemIterator it(_vectors);




More information about the Kst mailing list