Commit 0841f98e authored by Martin Straka's avatar Martin Straka

Final refactoring

parent a266d5f1
......@@ -233,7 +233,7 @@ void FileListModel::setQuery(QSqlQuery &query)
void FileListModel::setQueryWithFileContent(QSqlQuery &query)
{
if (query.record().count() != 4) {
if (query.record().count() != 3) {
return;
}
......@@ -244,8 +244,8 @@ void FileListModel::setQueryWithFileContent(QSqlQuery &query)
query.first();
while (query.isActive() && query.isValid()) {
m_files.append(Entry(query.value(0).toInt(),
query.value(1).toString(), query.value(2).toString(), QString(),
QByteArray::fromBase64(query.value(3).toByteArray()).size(),
query.value(1).toString(), QString(), QString(),
QByteArray::fromBase64(query.value(2).toByteArray()).size(),
QString()));
query.next();
}
......
......@@ -152,8 +152,8 @@ void FileDb::setFileModelFromDbWithFileContent(FileListModel &model,
{
QSqlQuery query(m_db);
QString queryStr = "SELECT id, dmFileDescr, _dmFileSize, "
"dmEncodedContent FROM files WHERE dmID = :dmID";
QString queryStr = "SELECT id, dmFileDescr, dmEncodedContent "
"FROM files WHERE dmID = :dmID";
if (!query.prepare(queryStr)) {
logErrorNL("Cannot prepare SQL query: %s",
query.lastError().text().toUtf8().constData());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment