mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 13:24:05 +00:00
16 lines
382 B
C++
16 lines
382 B
C++
#include "utils.hh"
|
|
#include <QDir>
|
|
|
|
QString Utils::Path::combine(const QString& path1, const QString& path2)
|
|
{
|
|
return QDir::cleanPath(path1 + QDir::separator() + path2);
|
|
}
|
|
|
|
QString Utils::Url::getSchemeAndHost( QUrl const & url )
|
|
{
|
|
auto _url = url.url();
|
|
auto index = _url.indexOf("://");
|
|
auto hostEndIndex = _url.indexOf("/",index+3);
|
|
return _url.mid(0,hostEndIndex);
|
|
}
|