This commit is contained in:
fourtf
2018-06-26 13:24:55 +02:00
parent ec04f10895
commit c9722b9780
301 changed files with 0 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
#pragma once
#include "controllers/accounts/account.hpp"
#include "util/qstringhash.hpp"
#include "util/signalvectormodel.hpp"
#include <unordered_map>
namespace chatterino {
namespace controllers {
namespace accounts {
class AccountController;
class AccountModel : public util::SignalVectorModel<std::shared_ptr<Account>>
{
public:
AccountModel(QObject *parent);
protected:
// turn a vector item into a model row
virtual std::shared_ptr<Account> getItemFromRow(
std::vector<QStandardItem *> &row, const std::shared_ptr<Account> &original) override;
// turns a row in the model into a vector item
virtual void getRowFromItem(const std::shared_ptr<Account> &item,
std::vector<QStandardItem *> &row) override;
virtual int beforeInsert(const std::shared_ptr<Account> &item,
std::vector<QStandardItem *> &row, int proposedIndex) override;
virtual void afterRemoved(const std::shared_ptr<Account> &item,
std::vector<QStandardItem *> &row, int index) override;
friend class AccountController;
private:
std::unordered_map<QString, int> categoryCount;
};
} // namespace accounts
} // namespace controllers
} // namespace chatterino