diff --git a/src/playlist/playlistview.cpp b/src/playlist/playlistview.cpp index 68697ff4a..9d593cc07 100644 --- a/src/playlist/playlistview.cpp +++ b/src/playlist/playlistview.cpp @@ -111,6 +111,7 @@ PlaylistView::PlaylistView(QWidget *parent) connect(header_, SIGNAL(sectionResized(int,int,int)), SLOT(SaveGeometry())); connect(header_, SIGNAL(sectionMoved(int,int,int)), SLOT(SaveGeometry())); + connect(header_, SIGNAL(sortIndicatorChanged(int,Qt::SortOrder)), SLOT(SaveGeometry())); connect(header_, SIGNAL(SectionVisibilityChanged(int,bool)), SLOT(SaveGeometry())); connect(header_, SIGNAL(sectionResized(int,int,int)), SLOT(InvalidateCachedCurrentPixmap())); connect(header_, SIGNAL(sectionMoved(int,int,int)), SLOT(InvalidateCachedCurrentPixmap())); @@ -166,7 +167,7 @@ void PlaylistView::SetItemDelegates(LibraryBackend* backend) { setItemDelegateForColumn(Playlist::Column_LastPlayed, new LastPlayedItemDelegate(this)); } -void PlaylistView::SetPlaylist(Playlist *playlist) { +void PlaylistView::SetPlaylist(Playlist* playlist) { if (playlist_) { disconnect(playlist_, SIGNAL(CurrentSongChanged(Song)), this, SLOT(MaybeAutoscroll())); diff --git a/src/widgets/stretchheaderview.cpp b/src/widgets/stretchheaderview.cpp index 87af43716..7bc379d65 100644 --- a/src/widgets/stretchheaderview.cpp +++ b/src/widgets/stretchheaderview.cpp @@ -245,11 +245,17 @@ bool StretchHeaderView::RestoreState(const QByteArray& data) { QList pixel_widths; QList visual_indices; + int sort_indicator_order = Qt::AscendingOrder; + int sort_indicator_section = 0; s >> stretch_enabled_; s >> pixel_widths; s >> visual_indices; s >> column_widths_; + s >> sort_indicator_order; + s >> sort_indicator_section; + + setSortIndicator(sort_indicator_section, Qt::SortOrder(sort_indicator_order)); const int persisted_column_count = qMin(qMin(visual_indices.count(), pixel_widths.count()), column_widths_.count()); @@ -295,6 +301,8 @@ QByteArray StretchHeaderView::SaveState() const { s << pixel_widths; s << visual_indices; s << column_widths_; + s << int(sortIndicatorOrder()); + s << sortIndicatorSection(); return ret; }