summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-12-25 04:11:47 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-12-25 04:11:47 +0100
commit904cafcd392c498f6f2ee2e7da061b98524857bc (patch)
tree22f33998b08dbce99e4d103d8c93dfa319229eaf /src
parentbe9df45af90d68b1c1a15df3d0b34818bba3dbde (diff)
lint
Diffstat (limited to 'src')
-rw-r--r--src/BlurhashProvider.cpp3
-rw-r--r--src/Cache.cpp20
-rw-r--r--src/CommunitiesList.cpp3
-rw-r--r--src/Utils.cpp5
-rw-r--r--src/popups/SuggestionsPopup.cpp3
-rw-r--r--src/timeline/EventStore.h6
6 files changed, 25 insertions, 15 deletions
diff --git a/src/BlurhashProvider.cpp b/src/BlurhashProvider.cpp
index cc7d5a73..acaef400 100644
--- a/src/BlurhashProvider.cpp
+++ b/src/BlurhashProvider.cpp
@@ -31,7 +31,8 @@ BlurhashResponse::run()
return;
}
- QImage image(decoded.image.data(), (int)decoded.width, (int)decoded.height, QImage::Format_RGB32);
+ QImage image(
+ decoded.image.data(), (int)decoded.width, (int)decoded.height, QImage::Format_RGB32);
m_image = image.copy();
emit finished();
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 3099b0c9..3f8d5d96 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -1259,7 +1259,8 @@ Cache::saveState(const mtx::responses::Sync &res)
nhlog::db()->warn(
"failed to parse room info: room_id ({}), {}: {}",
room.first,
- std::string(data.data(), data.size()), e.what());
+ std::string(data.data(), data.size()),
+ e.what());
}
}
}
@@ -1460,7 +1461,8 @@ Cache::singleRoomInfo(const std::string &room_id)
} catch (const json::exception &e) {
nhlog::db()->warn("failed to parse room info: room_id ({}), {}: {}",
room_id,
- std::string(data.data(), data.size()), e.what());
+ std::string(data.data(), data.size()),
+ e.what());
}
}
@@ -1494,7 +1496,8 @@ Cache::getRoomInfo(const std::vector<std::string> &rooms)
} catch (const json::exception &e) {
nhlog::db()->warn("failed to parse room info: room_id ({}), {}: {}",
room,
- std::string(data.data(), data.size()), e.what());
+ std::string(data.data(), data.size()),
+ e.what());
}
} else {
// Check if the room is an invite.
@@ -1507,10 +1510,11 @@ Cache::getRoomInfo(const std::vector<std::string> &rooms)
room_info.emplace(QString::fromStdString(room),
std::move(tmp));
} catch (const json::exception &e) {
- nhlog::db()->warn(
- "failed to parse room info for invite: room_id ({}), {}: {}",
- room,
- std::string(data.data(), data.size()), e.what());
+ nhlog::db()->warn("failed to parse room info for invite: "
+ "room_id ({}), {}: {}",
+ room,
+ std::string(data.data(), data.size()),
+ e.what());
}
}
}
@@ -2043,7 +2047,7 @@ Cache::getRoomName(lmdb::txn &txn, lmdb::dbi &statesdb, lmdb::dbi &membersdb)
}
}
- auto cursor = lmdb::cursor::open(txn, membersdb);
+ auto cursor = lmdb::cursor::open(txn, membersdb);
const auto total = membersdb.size(txn);
std::size_t ii = 0;
diff --git a/src/CommunitiesList.cpp b/src/CommunitiesList.cpp
index 010200c8..f3af9932 100644
--- a/src/CommunitiesList.cpp
+++ b/src/CommunitiesList.cpp
@@ -104,7 +104,8 @@ CommunitiesList::setTagsForRoom(const QString &room_id, const std::vector<std::s
}
// insert or remove the room from the tag as appropriate
std::string current_tag =
- it->first.right(static_cast<int>(it->first.size() - strlen("tag:"))).toStdString();
+ it->first.right(static_cast<int>(it->first.size() - strlen("tag:")))
+ .toStdString();
if (std::find(tags.begin(), tags.end(), current_tag) != tags.end()) {
// the room has this tag
it->second->addRoom(room_id);
diff --git a/src/Utils.cpp b/src/Utils.cpp
index 7228faf4..3bb090df 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -388,8 +388,9 @@ utils::escapeBlacklistedHtml(const QString &rawStr)
switch (data.at(pos)) {
case '<': {
bool oneTagMatched = false;
- const int endPos = static_cast<int>(std::min(static_cast<size_t>(data.indexOf('>', pos)),
- static_cast<size_t>(data.indexOf(' ', pos))));
+ const int endPos =
+ static_cast<int>(std::min(static_cast<size_t>(data.indexOf('>', pos)),
+ static_cast<size_t>(data.indexOf(' ', pos))));
auto mid = data.mid(pos + 1, endPos - pos - 1);
for (const auto &tag : allowedTags) {
diff --git a/src/popups/SuggestionsPopup.cpp b/src/popups/SuggestionsPopup.cpp
index 42efe6ce..8add4313 100644
--- a/src/popups/SuggestionsPopup.cpp
+++ b/src/popups/SuggestionsPopup.cpp
@@ -150,7 +150,8 @@ SuggestionsPopup::removeLayoutItemsAfter(size_t startingPos)
size_t posToRemove = layout_->count() - 1;
QLayoutItem *item;
- while (startingPos <= posToRemove && (item = layout_->takeAt((int)posToRemove)) != nullptr) {
+ while (startingPos <= posToRemove &&
+ (item = layout_->takeAt((int)posToRemove)) != nullptr) {
delete item->widget();
delete item;
diff --git a/src/timeline/EventStore.h b/src/timeline/EventStore.h
index a71e95d5..c6b39742 100644
--- a/src/timeline/EventStore.h
+++ b/src/timeline/EventStore.h
@@ -29,7 +29,8 @@ public:
friend uint qHash(const Index &i, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
- seed = hash(seed, QByteArray::fromRawData(i.room.data(), (int)i.room.size()));
+ seed =
+ hash(seed, QByteArray::fromRawData(i.room.data(), (int)i.room.size()));
seed = hash(seed, i.idx);
return seed;
}
@@ -46,7 +47,8 @@ public:
friend uint qHash(const IdIndex &i, uint seed = 0) noexcept
{
QtPrivate::QHashCombine hash;
- seed = hash(seed, QByteArray::fromRawData(i.room.data(), (int)i.room.size()));
+ seed =
+ hash(seed, QByteArray::fromRawData(i.room.data(), (int)i.room.size()));
seed = hash(seed, QByteArray::fromRawData(i.id.data(), (int)i.id.size()));
return seed;
}