1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

Add method to get encodedQuery independent of Qt version

This commit is contained in:
Uwe L. Korn 2014-03-05 17:46:52 +00:00
parent 8c414d7588
commit f5de7e0a3f
2 changed files with 11 additions and 0 deletions

View File

@ -904,4 +904,14 @@ percentEncode( const QUrl& url )
return data;
}
QByteArray
encodedQuery( const QUrl& url )
{
#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 )
return url.query(QUrl::FullyEncoded).toUtf8();
#else
return url.encodedQuery();
#endif
}
} // ns

View File

@ -213,6 +213,7 @@ namespace TomahawkUtils
DLLEXPORT bool urlHasQueryItem( const QUrl& url, const QString& key );
DLLEXPORT QList<QPair<QString, QString> > urlQueryItems( const QUrl& url );
DLLEXPORT void urlSetQuery( QUrl& url, const QString& query );
DLLEXPORT QByteArray encodedQuery( const QUrl& url );
}