Index: src/UIElements/Views/Qt4/QtFragmentList.cpp
===================================================================
--- src/UIElements/Views/Qt4/QtFragmentList.cpp	(revision b677ab5201194a0236fb05cf30291c0d3fd0bd89)
+++ src/UIElements/Views/Qt4/QtFragmentList.cpp	(revision 9583126d552a498ec6a0147ae02647de07721eef)
@@ -41,4 +41,6 @@
 
 #include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
 
 #include "Descriptors/AtomIdDescriptor.hpp"
@@ -53,5 +55,5 @@
 
 const int QtFragmentList::COLUMNCOUNT = COLUMNTYPES_MAX;
-const char *QtFragmentList::COLUMNNAMES[QtFragmentList::COLUMNCOUNT]={"Number","KeySet","Formula","Energy"};
+const char *QtFragmentList::COLUMNNAMES[QtFragmentList::COLUMNCOUNT]={"Number","KeySet","Formula","Energy value","Energy contribution"};
 
 QtFragmentList::QtFragmentList(QWidget * _parent) :
@@ -65,5 +67,5 @@
 	setHeaderLabels(header);
 
-	setSelectionMode( SingleSelection );
+	setSelectionMode( MultiSelection );
 
 	dirty = true;
@@ -95,5 +97,5 @@
   clear();
   clearing = false;
-  //emit changed(); doesn't work!?!
+  emit changed(); // doesn't work!?!
 }
 
@@ -112,4 +114,5 @@
   const IndexSetContainer keysets(fragments.getKeySets());
   const FragmentationResultContainer::shortrangedata_t &shortrange = fragments.getShortRangeResults();
+  const FragmentationShortRangeResults::summedshortrange_t &summedshortrange = fragments.getShortRangeSummedResults();
   IndexSetContainer::Container_t::const_iterator keyiter = keysets.getContainer().begin();
   FragmentationResultContainer::shortrangedata_t::const_iterator resultiter = shortrange.begin();
@@ -131,13 +134,38 @@
           ++indexiter) {
         const atom *_atom = World::getInstance().getAtom(AtomById(*indexiter));
-        formula.addElements(_atom->getElementNo(), 1);
+        if (_atom != NULL)
+          formula.addElements(_atom->getElementNo(), 1);
+        else
+          ELOG(2, "QtFragmentList::refill() - Could not find id " << *indexiter << " for formula.");
       }
       output << formula.toString();
       treeItem->setText(FORMULA, QString(output.str().c_str()));
     }
-    {
-      std::stringstream output;
-      output << resultiter->second.energies.total;
-      treeItem->setText(ENERGY, QString(output.str().c_str()));
+    if (summedshortrange.empty()) {
+      {
+        std::stringstream output;
+        output << resultiter->second.energies.total;
+        treeItem->setText(ENERGYVALUE, QString(output.str().c_str()));
+      }
+      {
+        std::stringstream output;
+        output << "";
+        treeItem->setText(ENERGYCONTRIBUTION, QString(output.str().c_str()));
+      }
+    } else {
+      FragmentationShortRangeResults::summedshortrange_t::const_iterator sumresiter =
+          summedshortrange.find(*keyiter);
+      ASSERT( sumresiter != summedshortrange.end(),
+          "QtFragmentList::refill() - "+toString(*keyiter)+" not present in summed results.");
+      {
+        std::stringstream output;
+        output << sumresiter->second.first.energies.total;
+        treeItem->setText(ENERGYVALUE, QString(output.str().c_str()));
+      }
+      {
+        std::stringstream output;
+        output << sumresiter->second.second.energies.total;
+        treeItem->setText(ENERGYCONTRIBUTION, QString(output.str().c_str()));
+      }
     }
     FragmentSelection.push_back(treeItem->isSelected());
@@ -167,4 +195,18 @@
 {
   //std::cout << "rowSelected\n";
+  // unselect
+  for (int i=0;i<topLevelItemCount();++i) {
+    QTreeWidgetItem *item = topLevelItem(i);
+    bool newSelection = item->isSelected();
+    if (newSelection != FragmentSelection[i]){
+      // get the keyset and select the specific atoms
+      if (!newSelection)
+        for (IndexSet::const_iterator iter = indexsets[i].begin();
+            iter != indexsets[i].end();
+            ++iter)
+          World::getInstance().unselectAtom(*iter);
+    }
+  }
+  // select all
   for (int i=0;i<topLevelItemCount();++i) {
     QTreeWidgetItem *item = topLevelItem(i);
@@ -173,11 +215,9 @@
       FragmentSelection[i] = newSelection;
       // get the keyset and select the specific atoms
-      for (IndexSet::const_iterator iter = indexsets[i].begin();
-          iter != indexsets[i].end();
-          ++iter)
-        if (newSelection)
+      if (newSelection)
+        for (IndexSet::const_iterator iter = indexsets[i].begin();
+            iter != indexsets[i].end();
+            ++iter)
           World::getInstance().selectAtom(*iter);
-        else
-          World::getInstance().unselectAtom(*iter);
     }
   }
