[SCM] massXpert mass spectrometry suite: debian packaging branch, upstream, updated. 41a70205093791df401b34b6867e830c5a46d1f9

Filippo Rusconi rusconi at mnhn.fr
Wed Apr 15 15:42:55 UTC 2009


The following commit has been merged in the upstream branch:
commit 41a70205093791df401b34b6867e830c5a46d1f9
Author: Filippo Rusconi <rusconi at mnhn.fr>
Date:   Wed Apr 15 17:21:06 2009 +0200

    Improved the exporting of the results as text.
    The textual representation of the results is now fully representative of the order in which
    the oligomer items are displayed in the tree views. This is of interest because the user
    might desire to have his/her results sorted.

diff --git a/gui/cleaveOligomerTreeView.cpp b/gui/cleaveOligomerTreeView.cpp
index d6f8eec..0817e0b 100644
--- a/gui/cleaveOligomerTreeView.cpp
+++ b/gui/cleaveOligomerTreeView.cpp
@@ -178,19 +178,20 @@ namespace massXpert
     Application *application = static_cast<Application *>(qApp);
     QLocale locale = application->locale();
     
-    QString *text = new QString();
-
     // We allocate a string in which we describe all the selected
     // items.
 
+    QString *text = new QString();
+
     QSortFilterProxyModel *sortModel = 
       static_cast<QSortFilterProxyModel *>(model());
     Q_ASSERT(sortModel);
     
     QItemSelectionModel *selModel = selectionModel();
     
-    QModelIndexList list = selModel->selectedRows();
-            
+    //    QModelIndexList list = selModel->selectedRows();
+    QModelIndexList list = selModel->selectedIndexes();
+
     for (int iter = 0; iter < list.size(); ++iter)
       {
 	QModelIndex oligomerIndex = list.at(iter);
@@ -199,6 +200,12 @@ namespace massXpert
 
 	QModelIndex sourceIndex = sortModel->mapToSource(oligomerIndex);
 
+	// If we do not make the filtering below, based upon the
+	// column index, then we would have 7 times the number of
+	// QModelIndex because there are 7 columns!
+	if (sourceIndex.column() != 0)
+	  continue;
+	
 	CleaveOligomerTreeViewItem *childItem = 
 	  static_cast<CleaveOligomerTreeViewItem *> 
 	 (sourceIndex.internalPointer());
@@ -229,6 +236,8 @@ namespace massXpert
 	  }
       }
 
+    *text += QString("\n");
+    
     return text;
   }
   
diff --git a/gui/fragmentOligomerTreeView.cpp b/gui/fragmentOligomerTreeView.cpp
index ebf2a65..e2c909b 100644
--- a/gui/fragmentOligomerTreeView.cpp
+++ b/gui/fragmentOligomerTreeView.cpp
@@ -187,8 +187,9 @@ namespace massXpert
     
     QItemSelectionModel *selModel = selectionModel();
     
-    QModelIndexList list = selModel->selectedRows();
-            
+    //    QModelIndexList list = selModel->selectedRows();
+    QModelIndexList list = selModel->selectedIndexes();
+
     for (int iter = 0; iter < list.size(); ++iter)
       {
 	QModelIndex oligomerIndex = list.at(iter);
@@ -197,6 +198,12 @@ namespace massXpert
 
 	QModelIndex sourceIndex = sortModel->mapToSource(oligomerIndex);
 
+	// If we do not make the filtering below, based upon the
+	// column index, then we would have 7 times the number of
+	// QModelIndex because there are 7 columns!
+	if (sourceIndex.column() != 0)
+	  continue;
+	
 	FragmentOligomerTreeViewItem *childItem = 
 	  static_cast<FragmentOligomerTreeViewItem *> 
 	 (sourceIndex.internalPointer());
@@ -227,6 +234,8 @@ namespace massXpert
 	  }
       }
 
+    *text += QString("\n");
+    
     return text;
   }
   
diff --git a/gui/massSearchOligomerTreeView.cpp b/gui/massSearchOligomerTreeView.cpp
index e113130..ac824f6 100644
--- a/gui/massSearchOligomerTreeView.cpp
+++ b/gui/massSearchOligomerTreeView.cpp
@@ -188,7 +188,8 @@ namespace massXpert
     
     QItemSelectionModel *selModel = selectionModel();
     
-    QModelIndexList list = selModel->selectedRows();
+    //    QModelIndexList list = selModel->selectedRows();
+    QModelIndexList list = selModel->selectedIndexes();
             
     // The header of the column set
     *text += QObject::tr("\nSearched mass \t : Name \t :"
@@ -203,6 +204,12 @@ namespace massXpert
 
 	QModelIndex sourceIndex = sortModel->mapToSource(oligomerIndex);
 
+	// If we do not make the filtering below, based upon the
+	// column index, then we would have 7 times the number of
+	// QModelIndex because there are 7 columns!
+	if (sourceIndex.column() != 0)
+	  continue;
+
 	MassSearchOligomerTreeViewItem *childItem = 
 	  static_cast<MassSearchOligomerTreeViewItem *> 
 	 (sourceIndex.internalPointer());
@@ -254,6 +261,8 @@ namespace massXpert
 	  }
       }
 
+    *text += QString("\n");
+
     return text;
   }
   

-- 
massXpert mass spectrometry suite: debian packaging



More information about the debian-science-commits mailing list