-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrited usage of QSqlRecord. #48
Conversation
Avoided multiple creation of QSqlRecord (on calls query-
@@ -93,9 +93,10 @@ Cue* CueDAO::getCue(const int cueId) { | |||
query.prepare("SELECT * FROM " CUE_TABLE " WHERE track_id = :id"); | |||
query.bindValue(":id", trackId); | |||
if (query.exec()) { | |||
const int idColumn = query.record().indexOf("id"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do this before the exec()
? QSqlRecord copies all the values if you call query.record()
after exec()
'ing the query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind! If the record()
call comes before next()
then it doesn't point to a valid row so there's no data to copy. It's fine as is.
@rryan take a look at new commit, please. |
Looks good! Thank you @troyane |
Fix use of QSqlQuery::record() to reduce excessive copying of result rows. Fixes Bug #1201991.
merge master, adapt to LateNight redesign
Replace Master by Main in the Shade main mixing region
Update beta link to RC.
Avoided multiple creation of QSqlRecord and pulled out record->indexOf's from cycles.