refactor: some Application & style things (#5561)

This commit is contained in:
pajlada
2024-08-25 15:33:07 +02:00
committed by GitHub
parent ac88730563
commit 627c735524
41 changed files with 733 additions and 678 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ QString formatTime(int totalSeconds)
return res;
}
QString formatTime(QString totalSecondsString)
QString formatTime(const QString &totalSecondsString)
{
bool ok = true;
int totalSeconds(totalSecondsString.toInt(&ok));
+1 -1
View File
@@ -8,7 +8,7 @@ namespace chatterino {
// format: 1h 23m 42s
QString formatTime(int totalSeconds);
QString formatTime(QString totalSecondsString);
QString formatTime(const QString &totalSecondsString);
QString formatTime(std::chrono::seconds totalSeconds);
} // namespace chatterino
+1 -1
View File
@@ -10,7 +10,7 @@ namespace chatterino {
// https://stackoverflow.com/questions/21646467/how-to-execute-a-functor-or-a-lambda-in-a-given-thread-in-qt-gcd-style
// Qt 5/4 - preferred, has least allocations
template <typename F>
static void postToThread(F &&fun, QObject *obj = qApp)
static void postToThread(F &&fun, QObject *obj = QCoreApplication::instance())
{
struct Event : public QEvent {
using Fun = typename std::decay<F>::type;