Settings: fix file check in "-S" option for Windows

In Windows the file has to be opened in text mode to get line ending
conversion so the check for the first line works.

See issue #2791
This commit is contained in:
mgrojo
2021-08-09 21:57:55 +02:00
parent 128babb602
commit dc8557110d
+2 -2
View File
@@ -40,10 +40,10 @@ bool Settings::isVaildSettingsFile(const QString& userSettingsFile)
QFile *file = new QFile;
file->setFileName(userSettingsFile);
if(file->open(QIODevice::ReadOnly))
if(file->open(QIODevice::ReadOnly | QIODevice::Text))
{
if(file->exists() &&
QString::compare(QString::fromStdString("[%General]\n"), file->readLine(), Qt::CaseInsensitive) != 0)
QString::compare(QString("[%General]\n"), file->readLine(), Qt::CaseInsensitive) != 0)
isNormalUserSettingsFile = false;
}