Merge msvc fixes from stable branch

This commit is contained in:
Christophe Dumez 2010-06-05 18:59:05 +00:00
parent 682377ff66
commit 8ec1621334
13 changed files with 87 additions and 51 deletions

View file

@ -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;
}