diff options
author | vdrfan <vdrfan@svn> | 2010-10-06 10:08:15 +0000 |
---|---|---|
committer | vdrfan <vdrfan@svn> | 2010-10-06 10:08:15 +0000 |
commit | 5f24de02ac4fa263daf42bbdfa2cf7eb88b16a0b (patch) | |
tree | b6c8e747770d64b02f6413c79f429204d84abb24 | |
parent | bfdf740120896982344f6d9e06b891645f9da740 (diff) |
fixed: #10441 - sort movies by time added (thanks ventech)
(cherry picked from commit 4435cafa6d9cae4b988e93cd003289fe86cb7808)
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@34500 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r-- | xbmc/FileItem.cpp | 3 | ||||
-rw-r--r-- | xbmc/GUIViewStateVideo.cpp | 1 | ||||
-rw-r--r-- | xbmc/SortFileItem.cpp | 9 | ||||
-rw-r--r-- | xbmc/SortFileItem.h | 2 |
4 files changed, 15 insertions, 0 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index b469cea638..d479aefc82 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -1488,6 +1488,9 @@ void CFileItemList::Sort(SORT_METHOD sortMethod, SORT_ORDER sortOrder) case SORT_METHOD_COUNTRY: FillSortFields(SSortFileItem::ByCountry); break; + case SORT_METHOD_DATEADDED: + FillSortFields(SSortFileItem::ByDateAdded); + break; case SORT_METHOD_FILE: FillSortFields(SSortFileItem::ByFile); break; diff --git a/xbmc/GUIViewStateVideo.cpp b/xbmc/GUIViewStateVideo.cpp index 93b6ad7027..5249028833 100644 --- a/xbmc/GUIViewStateVideo.cpp +++ b/xbmc/GUIViewStateVideo.cpp @@ -263,6 +263,7 @@ CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& it AddSortMethod(SORT_METHOD_YEAR,562, LABEL_MASKS("%T", "%Y")); } AddSortMethod(SORT_METHOD_VIDEO_RUNTIME,2050, LABEL_MASKS("%T", "%D")); + AddSortMethod(SORT_METHOD_DATEADDED, 570, LABEL_MASKS("%T", "%R")); SetSortMethod(g_settings.m_viewStateVideoNavTitles.m_sortMethod); diff --git a/xbmc/SortFileItem.cpp b/xbmc/SortFileItem.cpp index 0e5d625137..0ebe08552d 100644 --- a/xbmc/SortFileItem.cpp +++ b/xbmc/SortFileItem.cpp @@ -157,6 +157,15 @@ void SSortFileItem::ByDate(CFileItemPtr &item) item->SetSortLabel(label); } +void SSortFileItem::ByDateAdded(CFileItemPtr &item) +{ + if (!item) return; + + CStdString label; + label.Format("%d", item->GetVideoInfoTag()->m_iFileId); + item->SetSortLabel(label); +} + void SSortFileItem::BySize(CFileItemPtr &item) { if (!item) return; diff --git a/xbmc/SortFileItem.h b/xbmc/SortFileItem.h index 48dda5cbe0..f03c14fe3a 100644 --- a/xbmc/SortFileItem.h +++ b/xbmc/SortFileItem.h @@ -45,6 +45,7 @@ struct SSortFileItem static void ByFile(CFileItemPtr &item); static void ByFullPath(CFileItemPtr &item); static void ByDate(CFileItemPtr &item); + static void ByDateAdded(CFileItemPtr &item); static void BySize(CFileItemPtr &item); static void ByDriveType(CFileItemPtr &item); static void BySongTitle(CFileItemPtr &item); @@ -98,6 +99,7 @@ typedef enum { SORT_METHOD_COUNTRY, SORT_METHOD_YEAR, SORT_METHOD_VIDEO_RATING, + SORT_METHOD_DATEADDED, SORT_METHOD_PROGRAM_COUNT, SORT_METHOD_PLAYLIST_ORDER, SORT_METHOD_EPISODE, |