Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3137 from jmbreuer/upstream-sortby

Differentiate between "unsorted" and "unsortable"
  • Loading branch information...
commit 6db5a2cb6f2a6aa6f0a976b104a092abb149f961 2 parents 4dfbc05 + a29abf1
jmarshallnz jmarshallnz authored
7 xbmc/view/GUIViewState.cpp
View
@@ -220,6 +220,11 @@ SortDescription CGUIViewState::GetSortMethod() const
return sorting;
}
+bool CGUIViewState::HasMultipleSortMethods() const
+{
+ return m_sortMethods.size() > 1;
+}
+
int CGUIViewState::GetSortMethodLabel() const
{
if (m_currentSortMethod>=0 && m_currentSortMethod<(int)m_sortMethods.size())
@@ -293,6 +298,7 @@ void CGUIViewState::SetSortMethod(SortBy sortBy, SortAttribute sortAttributes /*
break;
}
}
+ SetSortOrder(m_sortOrder);
}
void CGUIViewState::SetSortMethod(SortDescription sortDescription)
@@ -308,6 +314,7 @@ SortDescription CGUIViewState::SetNextSortMethod(int direction /* = 1 */)
m_currentSortMethod = 0;
if (m_currentSortMethod < 0)
m_currentSortMethod = m_sortMethods.size() ? (int)m_sortMethods.size() - 1 : 0;
+ SetSortOrder(m_sortOrder);
SaveViewState();
1  xbmc/view/GUIViewState.h
View
@@ -40,6 +40,7 @@ class CGUIViewState
SortDescription SetNextSortMethod(int direction = 1);
void SetCurrentSortMethod(int method);
SortDescription GetSortMethod() const;
+ bool HasMultipleSortMethods() const;
int GetSortMethodLabel() const;
void GetSortMethodLabelMasks(LABEL_MASKS& masks) const;
2  xbmc/windows/GUIMediaWindow.cpp
View
@@ -544,7 +544,7 @@ void CGUIMediaWindow::UpdateButtons()
m_viewControl.SetCurrentView(m_guiState->GetViewAsControl());
// Update sort by button
- if (m_guiState->GetSortMethod().sortBy == SortByNone)
+ if (!m_guiState->HasMultipleSortMethods())
CONTROL_DISABLE(CONTROL_BTNSORTBY);
else
CONTROL_ENABLE(CONTROL_BTNSORTBY);
Please sign in to comment.
Something went wrong with that request. Please try again.