aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/Input/gme/decodergmefactory.cpp10
-rw-r--r--src/plugins/Input/gme/gmehelper.cpp16
2 files changed, 8 insertions, 18 deletions
diff --git a/src/plugins/Input/gme/decodergmefactory.cpp b/src/plugins/Input/gme/decodergmefactory.cpp
index 0615a5b24..0858b35ec 100644
--- a/src/plugins/Input/gme/decodergmefactory.cpp
+++ b/src/plugins/Input/gme/decodergmefactory.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2010-2012 by Ilya Kotov *
+ * Copyright (C) 2010-2013 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -71,11 +71,9 @@ QList<FileInfo *> DecoderGmeFactory::createPlayList(const QString &fileName, boo
//is it one track?
if(fileName.contains("://"))
{
- QString path = QUrl(fileName).path();
- path.replace(QString(QUrl::toPercentEncoding("#")), "#");
- path.replace(QString(QUrl::toPercentEncoding("?")), "?");
- path.replace(QString(QUrl::toPercentEncoding("%")), "%");
- path.replace(QString(QUrl::toPercentEncoding(":")), ":");
+ QString path = fileName;
+ path.remove("gme://");
+ path.remove(QRegExp("#\\d+$"));
int track = fileName.section("#", -1).toInt();
list = createPlayList(path, true);
if (list.isEmpty() || track <= 0 || track > list.count())
diff --git a/src/plugins/Input/gme/gmehelper.cpp b/src/plugins/Input/gme/gmehelper.cpp
index 35635b5f0..20fc843bc 100644
--- a/src/plugins/Input/gme/gmehelper.cpp
+++ b/src/plugins/Input/gme/gmehelper.cpp
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2010-2012 by Ilya Kotov *
+ * Copyright (C) 2010-2013 by Ilya Kotov *
* forkotov02@hotmail.ru *
* *
* This program is free software; you can redistribute it and/or modify *
@@ -42,11 +42,8 @@ Music_Emu *GmeHelper::load(const QString &url, int sample_rate)
QString path = url;
if(url.contains("://"))
{
- path = QUrl(url).path();
- path.replace(QString(QUrl::toPercentEncoding("#")), "#");
- path.replace(QString(QUrl::toPercentEncoding("?")), "?");
- path.replace(QString(QUrl::toPercentEncoding("%")), "%");
- path.replace(QString(QUrl::toPercentEncoding(":")), ":");
+ path.remove("gme://");
+ path.remove(QRegExp("#\\d+$"));
}
const char *err = 0;
gme_type_t file_type;
@@ -103,12 +100,7 @@ QList <FileInfo*> GmeHelper::createPlayList(bool meta)
info->setMetaData(Qmmp::COMMENT, track_info->comment);
info->setMetaData(Qmmp::TRACK, i+1);
}
- QString path = m_path;
- path.replace("%", QString(QUrl::toPercentEncoding("%"))); //replace special symbols
- path.replace("#", QString(QUrl::toPercentEncoding("#")));
- path.replace("?", QString(QUrl::toPercentEncoding("?")));
- path.replace(":", QString(QUrl::toPercentEncoding(":")));
- info->setPath("gme://"+path+QString("#%1").arg(i+1));
+ info->setPath("gme://" + m_path + QString("#%1").arg(i+1));
info->setLength(track_info->length/1000);
gme_free_info(track_info);
list << info;