Skip to content

Commit

Permalink
Merge pull request xbmc#6350 from Montellese/slideshow_fix_video_exte…
Browse files Browse the repository at this point in the history
…nsions
  • Loading branch information
jenkins4kodi committed Feb 6, 2015
2 parents d33740f + 2f114ef commit 9b727df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions xbmc/pictures/GUIViewStatePictures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@ std::string CGUIViewStateWindowPictures::GetLockType()

std::string CGUIViewStateWindowPictures::GetExtensions()
{
std::string extensions = g_advancedSettings.m_pictureExtensions;
if (CSettings::Get().GetBool("pictures.showvideos"))
return g_advancedSettings.m_pictureExtensions+"|"+g_advancedSettings.m_videoExtensions;
extensions += "|" + g_advancedSettings.m_videoExtensions;

return g_advancedSettings.m_pictureExtensions;
return extensions;
}

VECSOURCES& CGUIViewStateWindowPictures::GetSources()
Expand Down
5 changes: 3 additions & 2 deletions xbmc/pictures/GUIViewStatePictures.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ class CGUIViewStateWindowPictures : public CGUIViewState
public:
CGUIViewStateWindowPictures(const CFileItemList& items);

protected:
virtual void SaveViewState();
virtual std::string GetLockType();
virtual std::string GetExtensions();
virtual VECSOURCES& GetSources();

protected:
virtual void SaveViewState();
};

7 changes: 5 additions & 2 deletions xbmc/pictures/GUIWindowSlideShow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "utils/log.h"
#include "utils/TimeUtils.h"
#include "interfaces/AnnouncementManager.h"
#include "pictures/GUIViewStatePictures.h"
#include "pictures/PictureInfoTag.h"
#include "pictures/PictureThumbLoader.h"

Expand Down Expand Up @@ -1261,9 +1262,11 @@ void CGUIWindowSlideShow::AddItems(const std::string &strPath, path_set *recursi
recursivePaths->insert(path);
}

// fetch directory and sort accordingly
CFileItemList items;
if (!CDirectory::GetDirectory(strPath, items, m_strExtensions.empty()?g_advancedSettings.m_pictureExtensions:m_strExtensions,DIR_FLAG_NO_FILE_DIRS,true))
CGUIViewStateWindowPictures viewState(items);

// fetch directory and sort accordingly
if (!CDirectory::GetDirectory(strPath, items, viewState.GetExtensions(), DIR_FLAG_NO_FILE_DIRS, true))
return;

items.Sort(method, order, sortAttributes);
Expand Down

0 comments on commit 9b727df

Please sign in to comment.