add ifdefs to fix conditional compilation

This commit is contained in:
Andrzej Rybczak
2015-11-04 21:01:29 +01:00
parent d7a16aebfc
commit 5ce704e31c
3 changed files with 12 additions and 2 deletions

View File

@@ -2268,12 +2268,18 @@ void SetSelectedItemsPriority::run()
bool ToggleOutput::canBeRun() bool ToggleOutput::canBeRun()
{ {
#ifdef ENABLE_OUTPUTS
return myScreen == myOutputs; return myScreen == myOutputs;
#else
return false;
#endif // ENABLE_OUTPUTS
} }
void ToggleOutput::run() void ToggleOutput::run()
{ {
#ifdef ENABLE_OUTPUTS
myOutputs->toggleOutput(); myOutputs->toggleOutput();
#endif // ENABLE_OUTPUTS
} }
bool ToggleVisualizationType::canBeRun() bool ToggleVisualizationType::canBeRun()

View File

@@ -693,7 +693,9 @@ private:
virtual bool canBeRun() OVERRIDE; virtual bool canBeRun() OVERRIDE;
virtual void run() OVERRIDE; virtual void run() OVERRIDE;
#ifdef HAVE_TAGLIB_H
const MPD::Song *m_song; const MPD::Song *m_song;
#endif // HAVE_TAGLIB_H
}; };
struct EditLibraryTag: BaseAction struct EditLibraryTag: BaseAction
@@ -788,7 +790,9 @@ private:
virtual bool canBeRun() OVERRIDE; virtual bool canBeRun() OVERRIDE;
virtual void run() OVERRIDE; virtual void run() OVERRIDE;
#ifdef HAVE_TAGLIB_H
const MPD::Song *m_song; const MPD::Song *m_song;
#endif // HAVE_TAGLIB_H
}; };
struct JumpToPositionInSong: BaseAction struct JumpToPositionInSong: BaseAction

View File

@@ -616,16 +616,16 @@ MPD::Song getLocalSong(const fs::directory_entry &entry, bool read_tags)
mpd_song *s = mpd_song_begin(&pair); mpd_song *s = mpd_song_begin(&pair);
if (s == nullptr) if (s == nullptr)
throw std::runtime_error("invalid path: " + entry.path().native()); throw std::runtime_error("invalid path: " + entry.path().native());
# ifdef HAVE_TAGLIB_H
if (read_tags) if (read_tags)
{ {
#ifdef HAVE_TAGLIB_H
Tags::setAttribute(s, "Last-Modified", Tags::setAttribute(s, "Last-Modified",
timeFormat("%Y-%m-%dT%H:%M:%SZ", fs::last_write_time(entry.path())) timeFormat("%Y-%m-%dT%H:%M:%SZ", fs::last_write_time(entry.path()))
); );
// read tags // read tags
Tags::read(s); Tags::read(s);
#endif // HAVE_TAGLIB_H
} }
# endif // HAVE_TAGLIB_H
return s; return s;
} }