2018-05-06 12:52:47 +02:00
|
|
|
#include "accountmodel.hpp"
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
namespace controllers {
|
|
|
|
namespace accounts {
|
|
|
|
|
|
|
|
AccountModel::AccountModel(QObject *parent)
|
|
|
|
: util::SignalVectorModel<std::shared_ptr<Account>>(1, parent)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// turn a vector item into a model row
|
2018-05-26 20:25:00 +02:00
|
|
|
std::shared_ptr<Account> AccountModel::getItemFromRow(std::vector<QStandardItem *> &,
|
|
|
|
const std::shared_ptr<Account> &original)
|
2018-05-06 12:52:47 +02:00
|
|
|
{
|
2018-05-26 20:25:00 +02:00
|
|
|
return original;
|
2018-05-06 12:52:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// turns a row in the model into a vector item
|
|
|
|
void AccountModel::getRowFromItem(const std::shared_ptr<Account> &item,
|
|
|
|
std::vector<QStandardItem *> &row)
|
|
|
|
{
|
|
|
|
row[0]->setData(item->toString(), Qt::DisplayRole);
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace accounts
|
|
|
|
} // namespace controllers
|
|
|
|
} // namespace chatterino
|