Generator
::Generator(const QString &databasePath
){
name = name.replace("\\","/");
database.setDatabaseName(name);
if(database.open())
{
Logger::info("Database " + databasePath + " opened successfuly.");
}
else
{
Logger::error("Couldn't open database " + databasePath + "! Error: " + database.lastError().text() + ". Application aborted.");
exit(-2);
}
}
Generator::~Generator()
{
if (database.isOpen())
{
database.close();
}
}
void Generator::generateDictionaryFile()
{
query.exec("select distinct ulica from AdresyKody_mid_mif");
Logger::info("Last error: " + query.lastError().text());
while(query.next())
{
Logger::info("Got from database: " + query.value(0).toString());//national characters here
}
}
Generator::Generator(const QString &databasePath)
{
QString name = databasePath;
name = name.replace("\\","/");
database = QSqlDatabase::addDatabase("QSQLITE");
database.setDatabaseName(name);
if(database.open())
{
Logger::info("Database " + databasePath + " opened successfuly.");
}
else
{
Logger::error("Couldn't open database " + databasePath + "! Error: " + database.lastError().text() + ". Application aborted.");
exit(-2);
}
}
Generator::~Generator()
{
if (database.isOpen())
{
database.close();
}
}
void Generator::generateDictionaryFile()
{
QSqlQuery query(database);
query.exec("select distinct ulica from AdresyKody_mid_mif");
Logger::info("Last error: " + query.lastError().text());
while(query.next())
{
Logger::info("Got from database: " + query.value(0).toString());//national characters here
}
}
To copy to clipboard, switch view to plain text mode
But the issue is solved already.In other place I had code in Logger
logFile.write(logText.toLatin1());
logFile.write(logText.toLatin1());
To copy to clipboard, switch view to plain text mode
and as it turned out that was the source of my issues.After change to:
logFile.write(logText.toUtf8());
logFile.write(logText.toUtf8());
To copy to clipboard, switch view to plain text mode
all works fine.
Sorry mates for bothering you for nothing.
Bookmarks