mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
Add method to get encodedQuery independent of Qt version
This commit is contained in:
@@ -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
|
||||
|
@@ -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 );
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user