mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 00:47:21 -06:00
@@ -34,6 +34,7 @@
|
||||
#include <QString>
|
||||
|
||||
#include "base/exceptions.h"
|
||||
#include "base/global.h"
|
||||
|
||||
namespace Utils
|
||||
{
|
||||
@@ -63,7 +64,7 @@ namespace Utils
|
||||
* @throws RuntimeError if parsing fails
|
||||
*/
|
||||
Version(const QString &version)
|
||||
: Version {version.split(QLatin1Char('.'))}
|
||||
: Version {version.split(u'.')}
|
||||
{
|
||||
}
|
||||
|
||||
@@ -119,7 +120,7 @@ namespace Utils
|
||||
|
||||
QString res = QString::number((*this)[0]);
|
||||
for (std::size_t i = 1; i <= lastSignificantIndex; ++i)
|
||||
res += QLatin1Char('.') + QString::number((*this)[i]);
|
||||
res += (u'.' + QString::number((*this)[i]));
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -162,7 +163,7 @@ namespace Utils
|
||||
if ((static_cast<std::size_t>(versionParts.size()) > N)
|
||||
|| (static_cast<std::size_t>(versionParts.size()) < Mandatory))
|
||||
{
|
||||
throw RuntimeError(QLatin1String("Incorrect number of version components"));
|
||||
throw RuntimeError(u"Incorrect number of version components"_qs);
|
||||
}
|
||||
|
||||
bool ok = false;
|
||||
@@ -171,7 +172,7 @@ namespace Utils
|
||||
{
|
||||
res[i] = static_cast<T>(versionParts[static_cast<typename StringsList::size_type>(i)].toInt(&ok));
|
||||
if (!ok)
|
||||
throw RuntimeError(QLatin1String("Can not parse version component"));
|
||||
throw RuntimeError(u"Can not parse version component"_qs);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user