ifdef new function and calls
This commit is contained in:
parent
789e107091
commit
d487aec46f
|
@ -73,8 +73,10 @@
|
|||
#include <QToolButton>
|
||||
#include <QCheckBox>
|
||||
#include <QClipboard>
|
||||
#ifdef HAVE_DBUS
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusMessage>
|
||||
#endif
|
||||
|
||||
#include "core/logging.h"
|
||||
|
||||
|
@ -1272,7 +1274,9 @@ void MainWindow::Exit() {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
UpdateTaskbarProgress(false, 0, 0);
|
||||
#endif
|
||||
|
||||
DoExit();
|
||||
}
|
||||
|
@ -1326,7 +1330,9 @@ void MainWindow::MediaStopped() {
|
|||
tray_icon_->SetProgress(0);
|
||||
tray_icon_->SetStopped();
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
UpdateTaskbarProgress(false, 0, 0);
|
||||
#endif
|
||||
|
||||
song_playing_ = Song();
|
||||
song_ = Song();
|
||||
|
@ -1404,7 +1410,9 @@ void MainWindow::SongChanged(const Song &song) {
|
|||
setWindowTitle(song.PrettyTitleWithArtist());
|
||||
tray_icon_->SetProgress(0);
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
UpdateTaskbarProgress(false, 0, 0);
|
||||
#endif
|
||||
|
||||
SendNowPlaying();
|
||||
|
||||
|
@ -1695,7 +1703,9 @@ void MainWindow::Seeked(const qint64 microseconds) {
|
|||
const qint64 length = app_->player()->GetCurrentItem()->Metadata().length_nanosec() / kNsecPerSec;
|
||||
tray_icon_->SetProgress(static_cast<int>(static_cast<double>(position) / static_cast<double>(length) * 100.0));
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
UpdateTaskbarProgress(true, position, length);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
@ -1711,7 +1721,9 @@ void MainWindow::UpdateTrackPosition() {
|
|||
// Update the tray icon every 10 seconds
|
||||
if (position % 10 == 0) tray_icon_->SetProgress(static_cast<int>(static_cast<double>(position) / static_cast<double>(length) * 100.0));
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
UpdateTaskbarProgress(true, position, length);
|
||||
#endif
|
||||
|
||||
// Send Scrobble
|
||||
if (app_->scrobbler()->enabled() && item->Metadata().is_metadata_good()) {
|
||||
|
@ -1739,6 +1751,7 @@ void MainWindow::UpdateTrackSliderPosition() {
|
|||
|
||||
}
|
||||
|
||||
#ifdef HAVE_DBUS
|
||||
void MainWindow::UpdateTaskbarProgress(const bool visible, const double position, const double length) {
|
||||
|
||||
QVariantMap map;
|
||||
|
@ -1751,6 +1764,7 @@ void MainWindow::UpdateTaskbarProgress(const bool visible, const double position
|
|||
QDBusConnection::sessionBus().send(msg);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void MainWindow::ApplyAddBehaviour(const BehaviourSettingsPage::AddBehaviour b, MimeData *mimedata) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue