More clazy fixes

This commit is contained in:
Tobias Fella
2021-08-03 20:12:36 +02:00
parent 3be9c0cfb3
commit d92b1895a9
2 changed files with 9 additions and 9 deletions

View File

@@ -74,9 +74,9 @@ void DevicesModel::logout(int index, const QString &password)
authData["identifier"] = identifier; authData["identifier"] = identifier;
auto *innerJob = Controller::instance().activeConnection()->callApi<NeochatDeleteDeviceJob>(m_devices[index].deviceId, authData); auto *innerJob = Controller::instance().activeConnection()->callApi<NeochatDeleteDeviceJob>(m_devices[index].deviceId, authData);
connect(innerJob, &BaseJob::success, this, [this, index]() { connect(innerJob, &BaseJob::success, this, [this, index]() {
Q_EMIT beginRemoveRows(QModelIndex(), index, index); beginRemoveRows(QModelIndex(), index, index);
m_devices.remove(index); m_devices.remove(index);
Q_EMIT endRemoveRows(); endRemoveRows();
}); });
} }
}); });
@@ -86,12 +86,12 @@ void DevicesModel::setName(int index, const QString &name)
{ {
auto job = Controller::instance().activeConnection()->callApi<UpdateDeviceJob>(m_devices[index].deviceId, name); auto job = Controller::instance().activeConnection()->callApi<UpdateDeviceJob>(m_devices[index].deviceId, name);
QString oldName = m_devices[index].displayName; QString oldName = m_devices[index].displayName;
Q_EMIT beginResetModel(); beginResetModel();
m_devices[index].displayName = name; m_devices[index].displayName = name;
Q_EMIT endResetModel(); endResetModel();
connect(job, &BaseJob::failure, this, [=]() { connect(job, &BaseJob::failure, this, [=]() {
Q_EMIT beginResetModel(); beginResetModel();
m_devices[index].displayName = oldName; m_devices[index].displayName = oldName;
Q_EMIT endResetModel(); endResetModel();
}); });
} }

View File

@@ -85,10 +85,10 @@ SpellcheckHighlighter::SpellcheckHighlighter(QObject *parent)
, m_cursorPosition(-1) , m_cursorPosition(-1)
{ {
// Danger red from our color scheme // Danger red from our color scheme
mErrorFormat.setForeground(QColor{"#ed1515"}); mErrorFormat.setForeground(QColor(0xED, 0x15, 0x15));
mErrorFormat.setUnderlineColor(QColor{"#ed1515"}); mErrorFormat.setUnderlineColor(QColor(0xED, 0x15, 0x15));
mErrorFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline); mErrorFormat.setUnderlineStyle(QTextCharFormat::SingleUnderline);
mQuoteFormat.setForeground(QColor{"#7f8c8d"}); mQuoteFormat.setForeground(QColor(0x7F, 0x8C, 0x8D));
#ifndef Q_OS_ANDROID #ifndef Q_OS_ANDROID
if (!mSpellchecker->isValid()) { if (!mSpellchecker->isValid()) {
qWarning() << "Spellchecker is invalid"; qWarning() << "Spellchecker is invalid";