summaryrefslogtreecommitdiffstats
path: root/tests/quicktestbrowser/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/quicktestbrowser/utils.h')
-rw-r--r--tests/quicktestbrowser/utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/quicktestbrowser/utils.h b/tests/quicktestbrowser/utils.h
index 0f4460dfe..52025b7e4 100644
--- a/tests/quicktestbrowser/utils.h
+++ b/tests/quicktestbrowser/utils.h
@@ -48,6 +48,7 @@ class Utils : public QObject {
Q_OBJECT
public:
Q_INVOKABLE static QUrl fromUserInput(const QString& userInput);
+ Q_INVOKABLE static QString domainFromString(const QString& urlString);
};
inline QUrl Utils::fromUserInput(const QString& userInput)
@@ -58,4 +59,9 @@ inline QUrl Utils::fromUserInput(const QString& userInput)
return QUrl::fromUserInput(userInput);
}
+inline QString Utils::domainFromString(const QString& urlString)
+{
+ return QUrl::fromUserInput(urlString).host();
+}
+
#endif // UTILS_H