Clang-Tidy and Clazy fixes

This commit is contained in:
Jonas Kvinge
2021-06-20 19:04:08 +02:00
parent 755abec636
commit 1295033fae
374 changed files with 1304 additions and 900 deletions

View File

@@ -294,7 +294,7 @@ void OSDBase::VolumeChanged(int value) {
}
void OSDBase::ShowMessage(const QString &summary, const QString &message, const QString icon, const QImage &image) {
void OSDBase::ShowMessage(const QString &summary, const QString &message, const QString &icon, const QImage &image) {
if (pretty_popup_->toggle_mode()) {
pretty_popup_->ShowMessage(summary, message, image);

View File

@@ -88,7 +88,7 @@ class OSDBase : public QObject {
Type_Message,
};
void ShowPlaying(const Song &song, const QUrl &cover_url, const QImage &image, const bool preview = false);
void ShowMessage(const QString &summary, const QString &message = QString(), const QString icon = QString("strawberry"), const QImage &image = QImage());
void ShowMessage(const QString &summary, const QString &message = QString(), const QString &icon = "strawberry", const QImage &image = QImage());
QString ReplaceMessage(const MessageType type, const QString &message, const Song &song);
virtual void ShowMessageNative(const QString &summary, const QString &message, const QString &icon = QString(), const QImage &image = QImage());

View File

@@ -147,17 +147,17 @@ void OSDDBus::ShowMessageNative(const QString &summary, const QString &message,
if (!image.isNull()) {
if (version_ >= QVersionNumber(1, 2)) {
hints["image-data"] = QVariant(image);
hints["image-data"] = QVariant(image); // clazy:exclude=qt6-deprecated-api-fixes
}
else if (version_ >= QVersionNumber(1, 1)) {
hints["image_data"] = QVariant(image);
hints["image_data"] = QVariant(image); // clazy:exclude=qt6-deprecated-api-fixes
}
else {
hints["icon_data"] = QVariant(image);
hints["icon_data"] = QVariant(image); // clazy:exclude=qt6-deprecated-api-fixes
}
}
hints["transient"] = QVariant(true);
hints["transient"] = QVariant(true); // clazy:exclude=qt6-deprecated-api-fixes
int id = 0;
if (last_notification_time_.secsTo(QDateTime::currentDateTime()) * 1000 < timeout_msec()) {

View File

@@ -21,6 +21,8 @@
#include "config.h"
#include <chrono>
#include <QtGlobal>
#include <QApplication>
#include <QGuiApplication>
@@ -66,6 +68,8 @@
#include "core/utilities.h"
using namespace std::chrono_literals;
const char *OSDPretty::kSettingsGroup = "OSDPretty";
const int OSDPretty::kDropShadowSize = 13;
@@ -120,7 +124,7 @@ OSDPretty::OSDPretty(Mode mode, QWidget *parent)
// Timeout
timeout_->setSingleShot(true);
timeout_->setInterval(5000);
timeout_->setInterval(5s);
QObject::connect(timeout_, &QTimer::timeout, this, &OSDPretty::hide);
ui_->icon->setMaximumSize(kMaxIconSize, kMaxIconSize);
@@ -525,7 +529,7 @@ void OSDPretty::mouseReleaseEvent(QMouseEvent *) {
}
QScreen *OSDPretty::current_screen(const QPoint &pos) const {
QScreen *OSDPretty::current_screen(const QPoint pos) const {
QScreen *screen(nullptr);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
@@ -583,7 +587,7 @@ void OSDPretty::set_popup_duration(const int msec) {
timeout_->setInterval(msec);
}
void OSDPretty::set_font(const QFont font) {
void OSDPretty::set_font(const QFont &font) {
font_ = font;

View File

@@ -83,7 +83,7 @@ class OSDPretty : public QWidget {
void set_foreground_color(const QRgb color);
void set_background_color(const QRgb color);
void set_background_opacity(const qreal opacity);
void set_font(const QFont font);
void set_font(const QFont &font);
QRgb foreground_color() const { return foreground_color_.rgb(); }
QRgb background_color() const { return background_color_.rgb(); }
@@ -97,7 +97,7 @@ class OSDPretty : public QWidget {
// When the user has been moving the popup, use these to get its current position and screen.
// Note that these return invalid values if the popup is hidden.
QScreen *current_screen() const;
QScreen *current_screen(const QPoint &pos) const;
QScreen *current_screen(const QPoint pos) const;
QPoint current_pos() const;
// QWidget