Skip to content
Snippets Groups Projects
Commit 983ce000 authored by t.knopff's avatar t.knopff
Browse files

Make JobItem::P_PRESENTATION_TYPE private

parent 82422578
No related branches found
No related tags found
1 merge request!99Refactor model: JobItem
......@@ -288,6 +288,16 @@ bool JobItem::isCommentsPropertyName(const QString& name)
return name == P_COMMENTS;
}
const QString JobItem::presentationType() const
{
return getItemValue(P_PRESENTATION_TYPE).toString();
}
void JobItem::setPresentationType(const QString& type)
{
setItemValue(P_PRESENTATION_TYPE, type);
}
//! Updates the name of file to store intensity data.
void JobItem::updateIntensityDataFileName()
......
......@@ -43,9 +43,9 @@ private:
static const QString P_DURATION;
static const QString P_COMMENTS;
static const QString P_PROGRESS;
static const QString P_PRESENTATION_TYPE;
public:
static const QString P_PRESENTATION_TYPE;
static const QString T_SAMPLE;
static const QString T_MATERIAL_CONTAINER;
static const QString T_INSTRUMENT;
......@@ -116,6 +116,9 @@ public:
static bool isCommentsPropertyName(const QString& name);
const QString presentationType() const;
void setPresentationType(const QString& type);
private:
void updateIntensityDataFileName();
const SimulationOptionsItem* simulationOptionsItem() const;
......
......@@ -36,8 +36,8 @@ QString JobResultsPresenter::itemPresentation() const
if (!currentItem())
return {};
const auto& value = currentItem()->getItemValue(JobItem::P_PRESENTATION_TYPE);
return value.isValid() ? value.toString() : selectedPresentation();
const QString value = dynamic_cast<const JobItem*>(currentItem())->presentationType();
return value.isEmpty() ? selectedPresentation() : value;
}
void JobResultsPresenter::setPresentation(const QString& presentationType)
......@@ -46,7 +46,7 @@ void JobResultsPresenter::setPresentation(const QString& presentationType)
return;
ItemComboWidget::setPresentation(presentationType);
currentItem()->setItemValue(JobItem::P_PRESENTATION_TYPE, presentationType);
dynamic_cast<JobItem*>(currentItem())->setPresentationType(presentationType);
}
void JobResultsPresenter::setPresentation(JobViewFlags::EActivities activity)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment