renamed IrcConnection_ to IrcServerData
This commit is contained in:
@@ -18,21 +18,21 @@ namespace {
|
||||
return combinePath(getPaths()->settingsDirectory, "irc.json");
|
||||
}
|
||||
|
||||
class Model : public SignalVectorModel<IrcConnection_>
|
||||
class Model : public SignalVectorModel<IrcServerData>
|
||||
{
|
||||
public:
|
||||
Model(QObject *parent)
|
||||
: SignalVectorModel<IrcConnection_>(8, parent)
|
||||
: SignalVectorModel<IrcServerData>(8, parent)
|
||||
{
|
||||
}
|
||||
|
||||
// turn a vector item into a model row
|
||||
IrcConnection_ getItemFromRow(std::vector<QStandardItem *> &row,
|
||||
const IrcConnection_ &original)
|
||||
IrcServerData getItemFromRow(std::vector<QStandardItem *> &row,
|
||||
const IrcServerData &original)
|
||||
{
|
||||
qDebug() << row[2]->data(Qt::CheckStateRole).toBool();
|
||||
|
||||
return IrcConnection_{
|
||||
return IrcServerData{
|
||||
row[0]->data(Qt::EditRole).toString(), // host
|
||||
row[1]->data(Qt::EditRole).toInt(), // port
|
||||
row[2]->data(Qt::CheckStateRole).toBool(), // ssl
|
||||
@@ -45,7 +45,7 @@ namespace {
|
||||
}
|
||||
|
||||
// turns a row in the model into a vector item
|
||||
void getRowFromItem(const IrcConnection_ &item,
|
||||
void getRowFromItem(const IrcServerData &item,
|
||||
std::vector<QStandardItem *> &row)
|
||||
{
|
||||
setStringItem(row[0], item.host, false);
|
||||
@@ -218,7 +218,7 @@ void Irc::load()
|
||||
for (auto server : doc.object().value("servers").toArray())
|
||||
{
|
||||
auto obj = server.toObject();
|
||||
IrcConnection_ conn;
|
||||
IrcServerData conn;
|
||||
conn.host = obj.value("host").toString(conn.host);
|
||||
conn.port = obj.value("port").toInt(conn.port);
|
||||
conn.ssl = obj.value("ssl").toBool(conn.ssl);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace chatterino {
|
||||
|
||||
//enum IrcAuthType { Anonymous, /*Sals,*/ Pass, MsgNickServ, NickServ };
|
||||
|
||||
struct IrcConnection_ {
|
||||
struct IrcServerData {
|
||||
QString host;
|
||||
int port = 6667;
|
||||
bool ssl = false;
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
static Irc &getInstance();
|
||||
|
||||
UnsortedSignalVector<IrcConnection_> connections;
|
||||
UnsortedSignalVector<IrcServerData> connections;
|
||||
QAbstractTableModel *newConnectionModel(QObject *parent);
|
||||
|
||||
ChannelPtr getOrAddChannel(int serverId, QString name);
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
IrcServer::IrcServer(const IrcConnection_ &data)
|
||||
: data_(new IrcConnection_(data))
|
||||
IrcServer::IrcServer(const IrcServerData &data)
|
||||
: data_(new IrcServerData(data))
|
||||
{
|
||||
this->connect();
|
||||
}
|
||||
|
||||
IrcServer::IrcServer(const IrcConnection_ &data,
|
||||
IrcServer::IrcServer(const IrcServerData &data,
|
||||
const std::vector<std::weak_ptr<Channel>> &restoreChannels)
|
||||
: IrcServer(data)
|
||||
{
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
struct IrcConnection_;
|
||||
struct IrcServerData;
|
||||
|
||||
class IrcServer : public AbstractIrcServer
|
||||
{
|
||||
public:
|
||||
explicit IrcServer(const IrcConnection_ &data);
|
||||
IrcServer(const IrcConnection_ &data,
|
||||
explicit IrcServer(const IrcServerData &data);
|
||||
IrcServer(const IrcServerData &data,
|
||||
const std::vector<std::weak_ptr<Channel>> &restoreChannels);
|
||||
~IrcServer() override;
|
||||
|
||||
@@ -32,7 +32,7 @@ protected:
|
||||
|
||||
private:
|
||||
// pointer so we don't have to circle include Irc2.hpp
|
||||
IrcConnection_ *data_;
|
||||
IrcServerData *data_;
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user