Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Datovka projects
mobile Datovka
Commits
0841f98e
Commit
0841f98e
authored
Nov 26, 2018
by
Martin Straka
Browse files
Final refactoring
parent
a266d5f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/models/filemodel.cpp
View file @
0841f98e
...
...
@@ -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
).
to
String
(),
QString
(),
QByteArray
::
fromBase64
(
query
.
value
(
3
).
toByteArray
()).
size
(),
query
.
value
(
1
).
toString
(),
Q
String
(),
QString
(),
QByteArray
::
fromBase64
(
query
.
value
(
2
).
toByteArray
()).
size
(),
QString
()));
query
.
next
();
}
...
...
src/sqlite/file_db.cpp
View file @
0841f98e
...
...
@@ -152,8 +152,8 @@ void FileDb::setFileModelFromDbWithFileContent(FileListModel &model,
{
QSqlQuery
query
(
m_db
);
QString
queryStr
=
"SELECT id, dmFileDescr,
_
dm
FileSize,
"
"
dmEncodedContent
FROM files WHERE dmID = :dmID"
;
QString
queryStr
=
"SELECT id, dmFileDescr, dm
EncodedContent
"
"FROM files WHERE dmID = :dmID"
;
if
(
!
query
.
prepare
(
queryStr
))
{
logErrorNL
(
"Cannot prepare SQL query: %s"
,
query
.
lastError
().
text
().
toUtf8
().
constData
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment