Fix compile with optional components disabled
This commit is contained in:
@@ -213,9 +213,10 @@ void FileView::UndoCommand::undo() {
|
||||
|
||||
}
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
void FileView::Delete(const QStringList &filenames) {
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
|
||||
if (filenames.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -228,19 +229,28 @@ void FileView::Delete(const QStringList &filenames) {
|
||||
connect(delete_files, SIGNAL(Finished(SongList)), SLOT(DeleteFinished(SongList)));
|
||||
delete_files->Start(filenames);
|
||||
|
||||
#else
|
||||
Q_UNUSED(filenames)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void FileView::DeleteFinished(const SongList &songs_with_errors) {
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
|
||||
if (songs_with_errors.isEmpty()) return;
|
||||
|
||||
OrganiseErrorDialog *dialog = new OrganiseErrorDialog(this);
|
||||
dialog->Show(OrganiseErrorDialog::Type_Delete, songs_with_errors);
|
||||
// It deletes itself when the user closes it
|
||||
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(songs_with_errors)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void FileView::showEvent(QShowEvent *e) {
|
||||
|
||||
QWidget::showEvent(e);
|
||||
|
||||
@@ -79,10 +79,8 @@ class FileView : public QWidget {
|
||||
void ItemActivated(const QModelIndex &index);
|
||||
void ItemDoubleClick(const QModelIndex &index);
|
||||
|
||||
#ifdef HAVE_GSTREAMER
|
||||
void Delete(const QStringList &filenames);
|
||||
void DeleteFinished(const SongList &songs_with_errors);
|
||||
#endif
|
||||
|
||||
private:
|
||||
void ChangeFilePathWithoutUndo(const QString &new_path);
|
||||
|
||||
@@ -255,8 +255,12 @@ void OSD::ShowMessage(const QString &summary, const QString &message, const QStr
|
||||
|
||||
}
|
||||
|
||||
#if !defined(HAVE_X11) && defined(HAVE_DBUS)
|
||||
#if !defined(HAVE_X11)
|
||||
#if defined(HAVE_DBUS)
|
||||
void OSD::CallFinished(QDBusPendingCallWatcher*) {}
|
||||
#else
|
||||
void OSD::CallFinished() {}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void OSD::ShuffleModeChanged(PlaylistSequence::ShuffleMode mode) {
|
||||
|
||||
@@ -101,8 +101,10 @@ class OSD : public QObject {
|
||||
QString ReplaceVariable(const QString &variable, const Song &song);
|
||||
|
||||
private slots:
|
||||
#if defined(HAVE_DBUS)
|
||||
#ifdef HAVE_DBUS
|
||||
void CallFinished(QDBusPendingCallWatcher *watcher);
|
||||
#else
|
||||
void CallFinished();
|
||||
#endif
|
||||
void AlbumCoverLoaded(const Song &song, const QUrl &cover_url, const QImage &image);
|
||||
|
||||
|
||||
@@ -157,6 +157,10 @@ void OSD::ShowMessageNative(const QString &summary, const QString &message, cons
|
||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
|
||||
connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(CallFinished(QDBusPendingCallWatcher*)));
|
||||
#else // HAVE_DBUS
|
||||
Q_UNUSED(summary)
|
||||
Q_UNUSED(message)
|
||||
Q_UNUSED(icon)
|
||||
Q_UNUSED(image)
|
||||
qLog(Warning) << "not implemented";
|
||||
#endif // HAVE_DBUS
|
||||
|
||||
@@ -179,5 +183,6 @@ void OSD::CallFinished(QDBusPendingCallWatcher *watcher) {
|
||||
last_notification_time_ = QDateTime::currentDateTime();
|
||||
}
|
||||
}
|
||||
#else
|
||||
void OSD::CallFinished() {}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -80,6 +80,8 @@ TrackSlider::~TrackSlider() {
|
||||
void TrackSlider::SetApplication(Application* app) {
|
||||
#ifdef HAVE_MOODBAR
|
||||
if (!moodbar_style_) moodbar_style_ = new MoodbarProxyStyle(app, ui_->slider);
|
||||
#else
|
||||
Q_UNUSED(app);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user