mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-12 16:23:07 -07:00
Merge msvc fixes from stable branch
This commit is contained in:
parent
682377ff66
commit
8ec1621334
13 changed files with 87 additions and 51 deletions
32
src/misc.cpp
32
src/misc.cpp
|
@ -75,7 +75,7 @@ QString misc::QDesktopServicesDataLocation() {
|
|||
if (!QCoreApplication::applicationName().isEmpty())
|
||||
result = result + QLatin1String("\\") + qApp->applicationName();
|
||||
if(!result.endsWith("\\"))
|
||||
result += "\\";
|
||||
result += "\\";
|
||||
return result;
|
||||
#else
|
||||
#ifdef Q_WS_MAC
|
||||
|
@ -544,3 +544,33 @@ QString misc::userFriendlyDuration(qlonglong seconds) {
|
|||
}
|
||||
return QString::fromUtf8("∞");
|
||||
}
|
||||
|
||||
QStringList misc::toStringList(const QList<bool> &l) {
|
||||
QStringList ret;
|
||||
foreach(const bool &b, l) {
|
||||
if(b)
|
||||
ret << "1";
|
||||
else
|
||||
ret << "0";
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<int> misc::intListfromStringList(const QStringList &l) {
|
||||
QList<int> ret;
|
||||
foreach(const QString &s, l) {
|
||||
ret << s.toInt();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<bool> misc::boolListfromStringList(const QStringList &l) {
|
||||
QList<bool> ret;
|
||||
foreach(const QString &s, l) {
|
||||
if(s == "1")
|
||||
ret << true;
|
||||
else
|
||||
ret << false;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue