Skip to content
Snippets Groups Projects
Commit e40030ed authored by Mikhail Svechnikov's avatar Mikhail Svechnikov Committed by Mikhail Svechnikov
Browse files

RealModel is not SessionModel

parent 68903142
No related branches found
No related tags found
1 merge request!1340Delete SessionItem and SessionModel classes
......@@ -37,7 +37,6 @@ ApplicationModels::ApplicationModels()
m_realDataModel = std::make_unique<RealModel>(this);
m_jobModel = std::make_unique<JobModel>(this);
connectModel(m_realDataModel.get());
connectModel(m_jobModel.get());
}
......
......@@ -29,7 +29,7 @@ const QString SelectedRank("SelectedRank");
} // namespace
RealModel::RealModel(QObject* parent)
: SessionModel("no_model_tag", parent)
: QObject(parent)
{
setObjectName("RealModel");
}
......
......@@ -15,13 +15,15 @@
#ifndef BORNAGAIN_GUI_MODEL_MODEL_REALMODEL_H
#define BORNAGAIN_GUI_MODEL_MODEL_REALMODEL_H
#include "GUI/Model/Model/SessionModel.h"
#include <QObject>
#include <QXmlStreamWriter>
class RealItem;
class DataItem;
class MessageService;
//! The RealModel class is a model to store all imported RealItem's.
class RealModel : public SessionModel {
class RealModel : public QObject {
Q_OBJECT
public:
......@@ -29,7 +31,7 @@ public:
~RealModel();
QVector<DataItem*> dataItems() const;
void clear() override;
void clear();
void writeToProject(QXmlStreamWriter* w, const QString& projectDir);
void readFromProject(QXmlStreamReader* r, const QString& projectDir,
MessageService* messageService = nullptr);
......
......@@ -29,9 +29,6 @@ RealDataTreeModel::RealDataTreeModel(QObject* parent, RealModel* model)
m_items[rank - 1] = model->realItems(rank);
updateSubscriptions();
connect(m_model, &RealModel::modelAboutToBeReset, this, &RealDataTreeModel::clear,
Qt::UniqueConnection);
}
void RealDataTreeModel::setVisibleRanks(QSet<int> visibleRanks)
......@@ -62,15 +59,6 @@ void RealDataTreeModel::refreshAfterModelChange()
updateSubscriptions();
}
void RealDataTreeModel::clear()
{
beginResetModel();
m_items[0].clear();
m_items[1].clear();
endResetModel();
updateSubscriptions();
}
void RealDataTreeModel::removeItem(RealItem* item)
{
QModelIndex index = indexForItem(item);
......
......@@ -55,7 +55,6 @@ public:
private:
void updateSubscriptions();
void onContentsProcessed(RealItem* item);
void clear();
private:
RealModel* m_model = nullptr;
......
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