created base for all the list based settings

This commit is contained in:
fourtf
2018-05-06 00:32:45 +02:00
parent 4c3f0921e2
commit ba4173822e
21 changed files with 646 additions and 317 deletions
+4 -4
View File
@@ -14,13 +14,13 @@ Command::Command(const QString &_text)
return;
}
this->name = _text.mid(0, index);
this->func = _text.mid(index + 1);
this->name = _text.mid(0, index).trimmed();
this->func = _text.mid(index + 1).trimmed();
}
Command::Command(const QString &_name, const QString &_func)
: name(_name)
, func(_func)
: name(_name.trimmed())
, func(_func.trimmed())
{
}
-12
View File
@@ -25,18 +25,6 @@ void CommandModel::getRowFromItem(const Command &item, std::vector<QStandardItem
row[1]->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable);
}
// returns the related index of the SignalVector
int CommandModel::getVectorIndexFromModelIndex(int index)
{
return index;
}
// returns the related index of the model
int CommandModel::getModelIndexFromVectorIndex(int index)
{
return index;
}
} // namespace commands
} // namespace controllers
} // namespace chatterino
@@ -22,12 +22,6 @@ protected:
// turns a row in the model into a vector item
virtual void getRowFromItem(const Command &item, std::vector<QStandardItem *> &row) override;
// returns the related index of the SignalVector
virtual int getVectorIndexFromModelIndex(int index) override;
// returns the related index of the model
virtual int getModelIndexFromVectorIndex(int index) override;
friend class CommandController;
};