Skip to content

Commit acbc540

Browse files
committed
WBackendUniversal: Add URL_ENCODE function
1 parent 238bd37 commit acbc540

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

dist/changes/1.7.0.md

+2
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@
264264

265265
- WBackendUniversal: Add current time / date support.
266266

267+
- WBackendUniversal: Add URL_ENCODE function.
268+
267269
- WBackendUniversal: Fix the 'WBackendNetQuery::Type' support.
268270

269271

src/SkBackend/src/media/WBackendUniversal.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static const QString BACKENDUNIVERSAL_FUNCTIONS = \
129129
"EXTENSION_IS_AUDIO|"
130130
"EXTENSION_IS_SUBTITLE|"
131131
"URL_GENERATE|"
132+
"URL_ENCODE|"
132133
"URL_DECODE|"
133134
"URL_NAME|"
134135
"URL_VALUE|"
@@ -1655,6 +1656,18 @@ inline QVariant urlGenerate(const WBackendUniversalNode * node,
16551656
node->getString(parameters, 1));
16561657
}
16571658

1659+
inline QVariant urlEncode(const WBackendUniversalNode * node,
1660+
WBackendUniversalParameters * parameters)
1661+
{
1662+
#ifdef SK_BACKEND_LOG
1663+
qDebug("URL_ENCODE");
1664+
#endif
1665+
1666+
if (node->nodes.count() < 1) return QString();
1667+
1668+
return WControllerNetwork::encodeUrl(node->getString(parameters, 0));
1669+
}
1670+
16581671
inline QVariant urlDecode(const WBackendUniversalNode * node,
16591672
WBackendUniversalParameters * parameters)
16601673
{
@@ -3784,6 +3797,7 @@ void WBackendUniversalPrivate::populateHash() const
37843797
hash.insert("EXTENSION_IS_AUDIO", extensionIsAudio);
37853798
hash.insert("EXTENSION_IS_SUBTITLE", extensionIsSubtitle);
37863799
hash.insert("URL_GENERATE", urlGenerate);
3800+
hash.insert("URL_ENCODE", urlEncode);
37873801
hash.insert("URL_DECODE", urlDecode);
37883802
hash.insert("URL_NAME", urlName);
37893803
hash.insert("URL_VALUE", urlValue);

0 commit comments

Comments
 (0)