diff options
| -rw-r--r-- | src/qmmpui/qmmpuisettings.cpp | 21 | ||||
| -rw-r--r-- | src/qmmpui/qmmpuisettings.h | 16 |
2 files changed, 22 insertions, 15 deletions
diff --git a/src/qmmpui/qmmpuisettings.cpp b/src/qmmpui/qmmpuisettings.cpp index cab477ad7..581266242 100644 --- a/src/qmmpui/qmmpuisettings.cpp +++ b/src/qmmpui/qmmpuisettings.cpp @@ -85,12 +85,11 @@ void QmmpUiSettings::setConvertTwenty(bool yes) m_convertTwenty = yes; } -void QmmpUiSettings::setTitleFormat(const QString &format) +void QmmpUiSettings::setTitleFormat(const QString &titleFormat) { - m_title_format = format; - if(format != m_title_format) + if(titleFormat != m_title_format) { - m_title_format = format; + m_title_format = titleFormat; foreach(PlayListModel *model, PlayListManager::instance()->playLists()) { model->doCurrentVisibleRequest(); @@ -98,6 +97,20 @@ void QmmpUiSettings::setTitleFormat(const QString &format) } } +void QmmpUiSettings::setGroupFormat(const QString &groupFormat) +{ + if(groupFormat != m_group_format) + { + m_group_format = groupFormat; + if(!PlayListManager::instance()->isGroupsEnabled()) + return; + foreach(PlayListModel *model, PlayListManager::instance()->playLists()) + { + model->prepareGroups(true); + } + } +} + void QmmpUiSettings::setUseMetadata(bool yes) { m_useMetadata = yes; diff --git a/src/qmmpui/qmmpuisettings.h b/src/qmmpui/qmmpuisettings.h index 1e87e6702..1c8915224 100644 --- a/src/qmmpui/qmmpuisettings.h +++ b/src/qmmpui/qmmpuisettings.h @@ -42,17 +42,6 @@ public: */ virtual ~QmmpUiSettings(); /*! - * Enum of the available group formats - */ - enum GroupFormat - { - NONE = 0, /*!< disable groups */ - ARTIST_ALBUM, /*!< by artist/album */ - ARTIST_DATE_ALBUM, /*!< by artist/date/album */ - ARTIST, /*!< by artist */ - CUSTOM /*!< by user defined formar */ - }; - /*! * Returns state of the "Convert underscores to blanks" option (\b true - enabled, \b false - disabled). */ bool convertUnderscore() const; @@ -88,6 +77,11 @@ public: */ void setTitleFormat(const QString &titleFormat); /*! + * Sets group format. + * \param groupFormat group format. \sa MetaDataFormatter + */ + void setGroupFormat(const QString &groupFormat); + /*! * Sets metadata usage option state to \b enabled * @param enabled Option state (\b true - enabled, \b false - disabled) */ |
