From c3853fb6d5669090d5da21eb8f31ea57526f3456 Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 19 Aug 2013 19:14:19 +0000 Subject: fixed title format updating bug, added group format option git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@3624 90c681e8-e032-0410-971d-27865f9a5e38 --- src/qmmpui/qmmpuisettings.cpp | 21 +++++++++++++++++---- src/qmmpui/qmmpuisettings.h | 16 +++++----------- 2 files changed, 22 insertions(+), 15 deletions(-) (limited to 'src') 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 @@ -41,17 +41,6 @@ public: * Destructor. */ 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). */ @@ -87,6 +76,11 @@ public: * @param format title template. \sa MetaDataFormatter */ 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) -- cgit v1.2.3-13-gbd6f