diff options
| author | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-05-31 10:46:49 +0000 |
|---|---|---|
| committer | trialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38> | 2015-05-31 10:46:49 +0000 |
| commit | b8332b6352e06b7849e8d8212f9e76004611efe9 (patch) | |
| tree | 157004849072b01536da95c3ad507584dd9a0a39 /src/qmmpui/playlistheadermodel.cpp | |
| parent | c1e6d3b147265d004a5a72d8eccbc470f199a372 (diff) | |
| download | qmmp-b8332b6352e06b7849e8d8212f9e76004611efe9.tar.gz qmmp-b8332b6352e06b7849e8d8212f9e76004611efe9.tar.bz2 qmmp-b8332b6352e06b7849e8d8212f9e76004611efe9.zip | |
api changes
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@5058 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/qmmpui/playlistheadermodel.cpp')
| -rw-r--r-- | src/qmmpui/playlistheadermodel.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/qmmpui/playlistheadermodel.cpp b/src/qmmpui/playlistheadermodel.cpp index c121d53a4..1e85b1c43 100644 --- a/src/qmmpui/playlistheadermodel.cpp +++ b/src/qmmpui/playlistheadermodel.cpp @@ -61,7 +61,7 @@ void PlayListHeaderModel::restoreSettings(QSettings *settings) m_columns.clear(); for(int i = 0; i < names.count(); ++i) { - ColumnHeader h = {names.at(i), patterns.at(i)}; + ColumnHeader h = {names.at(i), patterns.at(i), QHash<int, QVariant>()}; m_columns.append(h); } m_helper->setTitleFormats(patterns); @@ -206,6 +206,26 @@ const QString PlayListHeaderModel::pattern(int index) const return m_columns[index].pattern; } +void PlayListHeaderModel::setData(int index, int key, const QVariant &data) +{ + if(index < 0 || index >= m_columns.size()) + { + qWarning("ColumnManager: index is out of range"); + return; + } + m_columns[index].data.insert(key, data); +} + +const QVariant PlayListHeaderModel::data(int index, int key) const +{ + if(index < 0 || index >= m_columns.size()) + { + qWarning("ColumnManager: index is out of range"); + return QString(); + } + return m_columns[index].data.value(key); +} + void PlayListHeaderModel::updatePlayLists() { QStringList patterns; |
