2016-11-02 21:05:32 +01:00
|
|
|
#include "./syncthingmodel.h"
|
|
|
|
|
|
|
|
namespace Data {
|
|
|
|
|
2017-05-01 03:34:43 +02:00
|
|
|
SyncthingModel::SyncthingModel(SyncthingConnection &connection, QObject *parent)
|
|
|
|
: QAbstractItemModel(parent)
|
|
|
|
, m_connection(connection)
|
2017-08-29 23:51:03 +02:00
|
|
|
, m_brightColors(false)
|
2017-05-01 03:34:43 +02:00
|
|
|
{
|
|
|
|
}
|
2016-11-02 21:05:32 +01:00
|
|
|
|
2017-09-11 23:44:19 +02:00
|
|
|
const QVector<int> &SyncthingModel::colorRoles() const
|
|
|
|
{
|
|
|
|
static const QVector<int> colorRoles;
|
|
|
|
return colorRoles;
|
|
|
|
}
|
|
|
|
|
2016-11-02 21:05:32 +01:00
|
|
|
void SyncthingModel::setBrightColors(bool brightColors)
|
|
|
|
{
|
2017-05-01 03:34:43 +02:00
|
|
|
if (m_brightColors != brightColors) {
|
2016-11-02 21:05:32 +01:00
|
|
|
m_brightColors = brightColors;
|
2017-09-11 23:44:19 +02:00
|
|
|
const QVector<int> &affectedRoles = colorRoles();
|
|
|
|
if (!affectedRoles.isEmpty()) {
|
|
|
|
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1), affectedRoles);
|
|
|
|
}
|
2016-11-02 21:05:32 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Data
|