diff --git a/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp b/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp index ca7cd005bf82..ac0026c66d68 100644 --- a/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp +++ b/Code/Mantid/Framework/ICat/src/ICat4/ICat4Catalog.cpp @@ -390,7 +390,7 @@ namespace Mantid if (outputws->getColumnNames().empty()) { // Add rows headers to the output workspace. - outputws->addColumn("str","Investigation id"); + outputws->addColumn("str","InvestigationID"); outputws->addColumn("str","Facility"); outputws->addColumn("str","Title"); outputws->addColumn("str","Instrument"); diff --git a/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp b/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp index b5aff51dbab5..b9ba3157cdbe 100644 --- a/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp +++ b/Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp @@ -75,15 +75,15 @@ namespace MantidQt // Populate the form with investigations that the user can publish to. for (size_t row = 0; row < workspace->rowCount(); row++) { - m_uiForm.investigationNumberCb->addItem(QString::fromStdString(workspace->cell(row, 0))); + m_uiForm.investigationNumberCb->addItem(QString::fromStdString(workspace->getRef("InvestigationID",row))); // Add better tooltip for ease of use (much easier to recall the investigation if title and instrument are also provided). m_uiForm.investigationNumberCb->setItemData(static_cast(row), - QString::fromStdString("The title of the investigation is: \"" + workspace->cell(row, 1) + - "\".\nThe instrument of the investigation is: \"" + workspace->cell(row, 2)) + "\".", + QString::fromStdString("The title of the investigation is: \"" + workspace->getRef("Title",row) + + "\".\nThe instrument of the investigation is: \"" + workspace->getRef("Instrument",row)) + "\".", Qt::ToolTipRole); // Set the user role to the sessionID. m_uiForm.investigationNumberCb->setItemData(static_cast(row), - QString::fromStdString(workspace->cell(row, 7)),Qt::UserRole); + QString::fromStdString(workspace->getRef("SessionID",row)),Qt::UserRole); } } diff --git a/Code/Mantid/MantidQt/MantidWidgets/src/CatalogSearch.cpp b/Code/Mantid/MantidQt/MantidWidgets/src/CatalogSearch.cpp index 8ed32fe89ffe..21523c99a81f 100644 --- a/Code/Mantid/MantidQt/MantidWidgets/src/CatalogSearch.cpp +++ b/Code/Mantid/MantidQt/MantidWidgets/src/CatalogSearch.cpp @@ -845,8 +845,9 @@ namespace MantidQt QTableWidget* searchResultsTable = m_icatUiForm.searchResultsTbl; - // Obtain the investigation id from the selected - QTableWidgetItem* investigationId = searchResultsTable->item(item->row(),0); + // Obtain the investigationID from the selected + QTableWidgetItem* investigationId = searchResultsTable->item( + item->row(),headerIndexByName(searchResultsTable,"InvestigationID")); // Remove previous dataFile search results. std::string dataFileResults = "dataFileResults"; @@ -995,14 +996,19 @@ namespace MantidQt */ void CatalogSearch::updateDataFileLabels(QTableWidgetItem* item) { + QTableWidget* searchResultsTable = m_icatUiForm.searchResultsTbl; + // Set the "title" label using the data from the investigation results workspace. - m_icatUiForm.dataFileTitleRes->setText(m_icatUiForm.searchResultsTbl->item(item->row(),1)->text()); + m_icatUiForm.dataFileTitleRes->setText(searchResultsTable->item(item->row(), + headerIndexByName(searchResultsTable, "Title"))->text()); // Set the instrument label using data from the investigation results workspace. - m_icatUiForm.dataFileInstrumentRes->setText(m_icatUiForm.searchResultsTbl->item(item->row(),2)->text()); + m_icatUiForm.dataFileInstrumentRes->setText(searchResultsTable->item(item->row(), + headerIndexByName(searchResultsTable, "Instrument"))->text()); // Show the related "run-range" for the specific dataFiles. - m_icatUiForm.dataFileRunRangeRes->setText(m_icatUiForm.searchResultsTbl->item(item->row(),3)->text()); + m_icatUiForm.dataFileRunRangeRes->setText(searchResultsTable->item(item->row(), + headerIndexByName(searchResultsTable, "Run range"))->text()); } /**