@@ -1310,9 +1310,9 @@ void Song::BindToQuery(SqlQuery *query) const {
|
||||
query->BindNotNullIntValue(":directory_id", d->directory_id_);
|
||||
query->BindUrlValue(":url", d->url_);
|
||||
query->BindValue(":filetype", d->filetype_);
|
||||
query->BindNotNullLongLongValue(":filesize", d->filesize_);
|
||||
query->BindNotNullLongLongValue(":mtime", d->mtime_);
|
||||
query->BindNotNullLongLongValue(":ctime", d->ctime_);
|
||||
query->BindLongLongValueOrZero(":filesize", d->filesize_);
|
||||
query->BindLongLongValueOrZero(":mtime", d->mtime_);
|
||||
query->BindLongLongValueOrZero(":ctime", d->ctime_);
|
||||
query->BindBoolValue(":unavailable", d->unavailable_);
|
||||
|
||||
query->BindStringValue(":fingerprint", d->fingerprint_);
|
||||
|
||||
@@ -62,6 +62,12 @@ void SqlQuery::BindLongLongValue(const QString &placeholder, const qint64 value)
|
||||
|
||||
}
|
||||
|
||||
void SqlQuery::BindLongLongValueOrZero(const QString &placeholder, const qint64 value) {
|
||||
|
||||
BindValue(placeholder, value <= 0 ? 0 : value);
|
||||
|
||||
}
|
||||
|
||||
void SqlQuery::BindFloatValue(const QString &placeholder, const float value) {
|
||||
|
||||
BindValue(placeholder, value <= 0 ? -1 : value);
|
||||
@@ -80,12 +86,6 @@ void SqlQuery::BindNotNullIntValue(const QString &placeholder, const int value)
|
||||
|
||||
}
|
||||
|
||||
void SqlQuery::BindNotNullLongLongValue(const QString &placeholder, const qint64 value) {
|
||||
|
||||
BindValue(placeholder, value == -1 ? QVariant() : value);
|
||||
|
||||
}
|
||||
|
||||
bool SqlQuery::Exec() {
|
||||
|
||||
bool success = exec();
|
||||
|
||||
@@ -38,10 +38,10 @@ class SqlQuery : public QSqlQuery {
|
||||
void BindUrlValue(const QString &placeholder, const QUrl &value);
|
||||
void BindIntValue(const QString &placeholder, const int value);
|
||||
void BindLongLongValue(const QString &placeholder, const qint64 value);
|
||||
void BindLongLongValueOrZero(const QString &placeholder, const qint64 value);
|
||||
void BindFloatValue(const QString &placeholder, const float value);
|
||||
void BindBoolValue(const QString &placeholder, const bool value);
|
||||
void BindNotNullIntValue(const QString &placeholder, const int value);
|
||||
void BindNotNullLongLongValue(const QString &placeholder, const qint64 value);
|
||||
|
||||
bool Exec();
|
||||
QString LastQuery() const;
|
||||
|
||||
Reference in New Issue
Block a user