actions: move isMPDMusicSet checks at the end of conditionals

master
Andrzej Rybczak 14 years ago
parent ae5bbbe63b
commit de1ad6cff3
  1. 23
      src/actions.cpp

@ -1342,7 +1342,8 @@ void SetCrossfade::Run()
bool EditSong::canBeRun() const bool EditSong::canBeRun() const
{ {
# ifdef HAVE_TAGLIB_H # ifdef HAVE_TAGLIB_H
return isMPDMusicDirSet() && currentSong(myScreen); return currentSong(myScreen)
&& isMPDMusicDirSet();
# else # else
return false; return false;
# endif // HAVE_TAGLIB_H # endif // HAVE_TAGLIB_H
@ -1360,9 +1361,9 @@ void EditSong::Run()
bool EditLibraryTag::canBeRun() const bool EditLibraryTag::canBeRun() const
{ {
# ifdef HAVE_TAGLIB_H # ifdef HAVE_TAGLIB_H
return isMPDMusicDirSet() return myScreen->isActiveWindow(myLibrary->Tags)
&& myScreen->isActiveWindow(myLibrary->Tags) && !myLibrary->Tags.empty()
&& !myLibrary->Tags.empty(); && isMPDMusicDirSet();
# else # else
return false; return false;
# endif // HAVE_TAGLIB_H # endif // HAVE_TAGLIB_H
@ -1412,9 +1413,9 @@ void EditLibraryTag::Run()
bool EditLibraryAlbum::canBeRun() const bool EditLibraryAlbum::canBeRun() const
{ {
# ifdef HAVE_TAGLIB_H # ifdef HAVE_TAGLIB_H
return isMPDMusicDirSet() return myScreen->isActiveWindow(myLibrary->Albums)
&& myScreen->isActiveWindow(myLibrary->Albums) && !myLibrary->Albums.empty()
&& !myLibrary->Albums.empty(); && isMPDMusicDirSet();
# else # else
return false; return false;
# endif // HAVE_TAGLIB_H # endif // HAVE_TAGLIB_H
@ -1465,8 +1466,7 @@ void EditLibraryAlbum::Run()
bool EditDirectoryName::canBeRun() const bool EditDirectoryName::canBeRun() const
{ {
return isMPDMusicDirSet() return ((myScreen == myBrowser
&& ((myScreen == myBrowser
&& !myBrowser->main().empty() && !myBrowser->main().empty()
&& myBrowser->main().current().value().type == MPD::itDirectory) && myBrowser->main().current().value().type == MPD::itDirectory)
# ifdef HAVE_TAGLIB_H # ifdef HAVE_TAGLIB_H
@ -1474,7 +1474,7 @@ bool EditDirectoryName::canBeRun() const
&& !myTagEditor->Dirs->empty() && !myTagEditor->Dirs->empty()
&& myTagEditor->Dirs->choice() > 0) && myTagEditor->Dirs->choice() > 0)
# endif // HAVE_TAGLIB_H # endif // HAVE_TAGLIB_H
); ) && isMPDMusicDirSet();
} }
void EditDirectoryName::Run() void EditDirectoryName::Run()
@ -1660,7 +1660,8 @@ void ToggleScreenLock::Run()
bool JumpToTagEditor::canBeRun() const bool JumpToTagEditor::canBeRun() const
{ {
# ifdef HAVE_TAGLIB_H # ifdef HAVE_TAGLIB_H
return isMPDMusicDirSet() && currentSong(myScreen); return currentSong(myScreen)
&& isMPDMusicDirSet();
# else # else
return false; return false;
# endif // HAVE_TAGLIB_H # endif // HAVE_TAGLIB_H

Loading…
Cancel
Save