refactored the managers

This commit is contained in:
2017-12-31 00:50:07 +01:00
parent 258288bad9
commit bfa2f1637e
80 changed files with 1023 additions and 964 deletions
+41
View File
@@ -0,0 +1,41 @@
#pragma once
#include <QAbstractListModel>
#include <QVector>
#include <map>
#include <string>
namespace chatterino {
class CompletionModel : public QAbstractListModel
{
public:
CompletionModel(const QString &_channelName);
virtual int columnCount(const QModelIndex &) const override
{
return 1;
}
virtual QVariant data(const QModelIndex &index, int) const override
{
// TODO: Implement more safely
return QVariant(this->emotes.at(index.row()));
}
virtual int rowCount(const QModelIndex &) const override
{
return this->emotes.size();
}
void refresh();
private:
void addString(const std::string &str);
void addString(const QString &str);
QVector<QString> emotes;
QString channelName;
};
}