Use QCoreApplication::applicationName() directly
This commit is contained in:
@@ -48,7 +48,6 @@ OSDBase::OSDBase(const SharedPtr<SystemTrayIcon> tray_icon, QObject *parent)
|
||||
: QObject(parent),
|
||||
tray_icon_(tray_icon),
|
||||
pretty_popup_(new OSDPretty(OSDPretty::Mode::Popup)),
|
||||
app_name_(QCoreApplication::applicationName()),
|
||||
timeout_msec_(5000),
|
||||
type_(OSDSettings::Type::Native),
|
||||
show_on_volume_change_(false),
|
||||
@@ -59,11 +58,7 @@ OSDBase::OSDBase(const SharedPtr<SystemTrayIcon> tray_icon, QObject *parent)
|
||||
use_custom_text_(false),
|
||||
force_show_next_(false),
|
||||
ignore_next_stopped_(false),
|
||||
playing_(false) {
|
||||
|
||||
app_name_[0] = app_name_[0].toUpper();
|
||||
|
||||
}
|
||||
playing_(false) {}
|
||||
|
||||
OSDBase::~OSDBase() {
|
||||
delete pretty_popup_;
|
||||
@@ -264,7 +259,7 @@ void OSDBase::Stopped() {
|
||||
}
|
||||
|
||||
void OSDBase::StopAfterToggle(const bool stop) {
|
||||
ShowMessage(app_name_, tr("Stop playing after track: %1").arg(stop ? tr("On") : tr("Off")));
|
||||
ShowMessage(QCoreApplication::applicationName(), tr("Stop playing after track: %1").arg(stop ? tr("On") : tr("Off")));
|
||||
}
|
||||
|
||||
void OSDBase::PlaylistFinished() {
|
||||
@@ -272,7 +267,7 @@ void OSDBase::PlaylistFinished() {
|
||||
// We get a PlaylistFinished followed by a Stopped from the player
|
||||
ignore_next_stopped_ = true;
|
||||
|
||||
ShowMessage(app_name_, tr("Playlist finished"));
|
||||
ShowMessage(QCoreApplication::applicationName(), tr("Playlist finished"));
|
||||
|
||||
}
|
||||
|
||||
@@ -290,7 +285,7 @@ void OSDBase::VolumeChanged(const uint value) {
|
||||
}
|
||||
#endif
|
||||
|
||||
ShowMessage(app_name_, message);
|
||||
ShowMessage(QCoreApplication::applicationName(), message);
|
||||
|
||||
}
|
||||
|
||||
@@ -346,7 +341,7 @@ void OSDBase::ShuffleModeChanged(const PlaylistSequence::ShuffleMode mode) {
|
||||
case PlaylistSequence::ShuffleMode::InsideAlbum: current_mode = tr("Shuffle tracks in this album"); break;
|
||||
case PlaylistSequence::ShuffleMode::Albums: current_mode = tr("Shuffle albums"); break;
|
||||
}
|
||||
ShowMessage(app_name_, current_mode);
|
||||
ShowMessage(QCoreApplication::applicationName(), current_mode);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -363,7 +358,7 @@ void OSDBase::RepeatModeChanged(const PlaylistSequence::RepeatMode mode) {
|
||||
case PlaylistSequence::RepeatMode::OneByOne: current_mode = tr("Stop after every track"); break;
|
||||
case PlaylistSequence::RepeatMode::Intro: current_mode = tr("Intro tracks"); break;
|
||||
}
|
||||
ShowMessage(app_name_, current_mode);
|
||||
ShowMessage(QCoreApplication::applicationName(), current_mode);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,8 +53,6 @@ class OSDBase : public QObject {
|
||||
virtual bool SupportsNativeNotifications();
|
||||
virtual bool SupportsTrayPopups();
|
||||
|
||||
QString app_name() { return app_name_; }
|
||||
|
||||
public Q_SLOTS:
|
||||
void ReloadSettings();
|
||||
|
||||
@@ -88,7 +86,6 @@ class OSDBase : public QObject {
|
||||
const SharedPtr<SystemTrayIcon> tray_icon_;
|
||||
OSDPretty *pretty_popup_;
|
||||
|
||||
QString app_name_;
|
||||
int timeout_msec_;
|
||||
OSDSettings::Type type_;
|
||||
bool show_on_volume_change_;
|
||||
|
||||
@@ -170,7 +170,7 @@ void OSDDBus::ShowMessageNative(const QString &summary, const QString &message,
|
||||
id = notification_id_;
|
||||
}
|
||||
|
||||
QDBusPendingReply<uint> reply = interface_->Notify(app_name(), id, icon, summary_stripped, message, QStringList(), hints, timeout_msec());
|
||||
QDBusPendingReply<uint> reply = interface_->Notify(QCoreApplication::applicationName(), id, icon, summary_stripped, message, QStringList(), hints, timeout_msec());
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
|
||||
QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &OSDDBus::CallFinished);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user