mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-14 15:59:18 -05:00
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:
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user