goldendict-ng/utils.cc

16 lines
382 B
C++
Raw Normal View History

2022-10-07 09:08:10 +00:00
#include "utils.hh"
#include <QDir>
QString Utils::Path::combine(const QString& path1, const QString& path2)
{
return QDir::cleanPath(path1 + QDir::separator() + path2);
}
2022-10-15 05:58:24 +00:00
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);
}