aboutsummaryrefslogtreecommitdiff
path: root/src/ui/playlistitem.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-05-27 19:14:16 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2008-05-27 19:14:16 +0000
commit1e663731dba61097a922380b2c2c937bb7b79c13 (patch)
treec51b719d6ef36f40cdcf746f911197ca86774f22 /src/ui/playlistitem.cpp
parent0ded49767b9cb8a9b870f10bde72c434453ea43b (diff)
downloadqmmp-1e663731dba61097a922380b2c2c937bb7b79c13.tar.gz
qmmp-1e663731dba61097a922380b2c2c937bb7b79c13.tar.bz2
qmmp-1e663731dba61097a922380b2c2c937bb7b79c13.zip
more playlist options
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@390 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/playlistitem.cpp')
-rw-r--r--src/ui/playlistitem.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/ui/playlistitem.cpp b/src/ui/playlistitem.cpp
index ed92e4268..c7f600c8e 100644
--- a/src/ui/playlistitem.cpp
+++ b/src/ui/playlistitem.cpp
@@ -40,14 +40,20 @@ PlayListItem::PlayListItem(const QString& path) : SongInfo(), m_flag(FREE)
m_use_meta = settings.value ("PlayList/load_metadata", TRUE).toBool();
//format
m_format = settings.value("PlayList/title_format", "%p - %t").toString();
+ //other properties
+ m_convertUnderscore = settings.value ("PlayList/convert_underscore", TRUE).toBool();
+ m_convertTwenty = settings.value ("PlayList/convert_twenty", TRUE).toBool();
+ m_fullStreamPath = settings.value ("PlayList/full_stream_path", FALSE).toBool();
+
if (m_use_meta && !path.startsWith("http://"))
{
m_tag = Decoder::createTag(path);
readMetadata();
}
+ else if (path.startsWith("http://") && m_fullStreamPath)
+ m_title = path;
else
- m_title = path.startsWith("http://") ? path: path.section('/',-1);
-
+ m_title = path.split('/',QString::SkipEmptyParts).takeLast ();
}
PlayListItem::~PlayListItem()
@@ -123,7 +129,7 @@ void PlayListItem::readMetadata()
{
//clear();
m_title.clear();
- if(m_tag) //read length first
+ if (m_tag) //read length first
setValue(SongInfo::LENGTH, m_tag->length());
if (m_use_meta && m_tag && !m_tag->isEmpty())
{
@@ -147,10 +153,19 @@ void PlayListItem::readMetadata()
m_title = printTag(m_title, "%y", QString("%1").arg(year ()));
}
if (m_title.isEmpty())
- m_title = path().startsWith("http://") ? path(): path().section('/',-1);
- if(m_tag)
+ {
+ if (path().startsWith("http://") && m_fullStreamPath)
+ m_title = path();
+ else
+ m_title = path().split('/',QString::SkipEmptyParts).takeLast ();
+ }
+ if (m_tag)
delete m_tag;
m_tag = 0;
+ if (m_convertUnderscore)
+ m_title.replace("_", " ");
+ if (m_convertTwenty)
+ m_title.replace("%20", " ");
}
QString PlayListItem::printTag(QString str, QString regExp, QString tagStr)