Problem using QSettings after searching file with QTextstream
Hey,
I want to open a INI file, standard the file name is the hostname of the pc .ini. But must somebody change this I want to look in every INI file and examine the first line. No problems there. The problems start when I founded the file with the string I'm looking for and I want to use this with QSettings. Must I close the QTrxtstream or release it ? Can somebody give me some help ? Thanks a lot, this is the code I'm using :
Code:
char name[256];
gethostname(name, 256);
path.append(name);
path.append(".ini");
if(!licenseFile.exists())
{
std::cout << "file doesn't exist" << std::endl;
path.clear();
for (int i = 0; i < files.size(); i++)
{
QFile file(directory.
absoluteFilePath(files
[i
]));
std::cout << files[i].toStdString() << std::endl;
line = in.readLine();
if (!line.
compare(QString(";3a0795c35a1afa904bc611b193376d33").
trimmed())) { path = files[i];
std::cout << "This is the file >>>>>>>>>>>>>>>>>>>>>" << files[i].toStdString() << endl;
file.close();
break;
}
file.close();
}
}
}
cout << iniFile.value("machine/Name").toString().toStdString() << endl;