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

Move some functions of JobItem to a better place

parent 37210b83
No related branches found
No related tags found
1 merge request!99Refactor model: JobItem
...@@ -135,6 +135,11 @@ void JobItem::setStatus(const QString& status) ...@@ -135,6 +135,11 @@ void JobItem::setStatus(const QString& status)
} }
} }
bool JobItem::isStatusPropertyName(const QString& name)
{
return name == P_STATUS;
}
bool JobItem::isIdle() const bool JobItem::isIdle() const
{ {
return getStatus() == "Idle"; return getStatus() == "Idle";
...@@ -194,6 +199,11 @@ void JobItem::setComments(const QString& comments) ...@@ -194,6 +199,11 @@ void JobItem::setComments(const QString& comments)
setItemValue(P_COMMENTS, comments); setItemValue(P_COMMENTS, comments);
} }
bool JobItem::isCommentsPropertyName(const QString& name)
{
return name == P_COMMENTS;
}
int JobItem::getProgress() const int JobItem::getProgress() const
{ {
return getItemValue(P_PROGRESS).toInt(); return getItemValue(P_PROGRESS).toInt();
...@@ -284,16 +294,6 @@ void JobItem::setInstrumentName(const QString& name) ...@@ -284,16 +294,6 @@ void JobItem::setInstrumentName(const QString& name)
getItem(P_INSTRUMENT_NAME)->setValue(name); getItem(P_INSTRUMENT_NAME)->setValue(name);
} }
bool JobItem::isStatusPropertyName(const QString& name)
{
return name == P_STATUS;
}
bool JobItem::isCommentsPropertyName(const QString& name)
{
return name == P_COMMENTS;
}
const QString JobItem::presentationType() const const QString JobItem::presentationType() const
{ {
return getItemValue(P_PRESENTATION_TYPE).toString(); return getItemValue(P_PRESENTATION_TYPE).toString();
......
...@@ -66,6 +66,7 @@ public: ...@@ -66,6 +66,7 @@ public:
QString getStatus() const; QString getStatus() const;
void setStatus(const QString& status); void setStatus(const QString& status);
static bool isStatusPropertyName(const QString& name);
bool isIdle() const; bool isIdle() const;
bool isRunning() const; bool isRunning() const;
...@@ -82,6 +83,7 @@ public: ...@@ -82,6 +83,7 @@ public:
QString getComments() const; QString getComments() const;
void setComments(const QString& comments); void setComments(const QString& comments);
static bool isCommentsPropertyName(const QString& name);
int getProgress() const; int getProgress() const;
void setProgress(int progress); void setProgress(int progress);
...@@ -113,10 +115,6 @@ public: ...@@ -113,10 +115,6 @@ public:
void setInstrumentName(const QString& name); void setInstrumentName(const QString& name);
static bool isStatusPropertyName(const QString& name);
static bool isCommentsPropertyName(const QString& name);
const QString presentationType() const; const QString presentationType() const;
void setPresentationType(const QString& type); void setPresentationType(const QString& type);
......
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