summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-28 22:36:49 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-28 22:36:49 +0100
commit0e9b0c80cd3e13fdb402791a5c65403e1301deea (patch)
tree0be917b106d9233026255cc3d3a903e9c3ead09f /src
parentFix more warnings and remove dead code (diff)
downloadnheko-0e9b0c80cd3e13fdb402791a5c65403e1301deea.tar.xz
more cleanups
Diffstat (limited to 'src')
-rw-r--r--src/Cache.cpp19
-rw-r--r--src/ReadReceiptsModel.cpp5
2 files changed, 12 insertions, 12 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp

index 90b087db..04dfb3cb 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp
@@ -222,15 +222,15 @@ Cache::setup() nhlog::db()->debug("setting up cache"); // Previous location of the cache directory - auto oldCache = QString("%1/%2%3") - .arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation)) - .arg(QString::fromUtf8(localUserId_.toUtf8().toHex())) - .arg(QString::fromUtf8(settings->profile().toUtf8().toHex())); + auto oldCache = + QString("%1/%2%3").arg(QStandardPaths::writableLocation(QStandardPaths::CacheLocation), + QString::fromUtf8(localUserId_.toUtf8().toHex()), + QString::fromUtf8(settings->profile().toUtf8().toHex())); - cacheDirectory_ = QString("%1/%2%3") - .arg(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)) - .arg(QString::fromUtf8(localUserId_.toUtf8().toHex())) - .arg(QString::fromUtf8(settings->profile().toUtf8().toHex())); + cacheDirectory_ = + QString("%1/%2%3").arg(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), + QString::fromUtf8(localUserId_.toUtf8().toHex()), + QString::fromUtf8(settings->profile().toUtf8().toHex())); bool isInitial = !QFile::exists(cacheDirectory_); @@ -276,7 +276,8 @@ Cache::setup() QDir stateDir(cacheDirectory_); - for (const auto &file : stateDir.entryList(QDir::NoDotAndDotDot)) { + auto eList = stateDir.entryList(QDir::NoDotAndDotDot); + for (const auto &file : qAsConst(eList)) { if (!stateDir.remove(file)) throw std::runtime_error(("Unable to delete file " + file).toStdString().c_str()); } diff --git a/src/ReadReceiptsModel.cpp b/src/ReadReceiptsModel.cpp
index ff93f7d8..066e850a 100644 --- a/src/ReadReceiptsModel.cpp +++ b/src/ReadReceiptsModel.cpp
@@ -112,9 +112,8 @@ ReadReceiptsModel::dateFormat(const QDateTime &then) const else if (days < 7) //: %1 is the name of the current day, %2 is the time the read receipt was read. The //: result may look like this: Monday, 7:15 - return QString("%1, %2") - .arg(then.toString("dddd")) - .arg(QLocale::system().toString(then.time(), QLocale::ShortFormat)); + return QString("%1, %2").arg(then.toString("dddd"), + QLocale::system().toString(then.time(), QLocale::ShortFormat)); return QLocale::system().toString(then.time(), QLocale::ShortFormat); }