From 9db21037adb340c9ebbed75c3434b1e973f37423 Mon Sep 17 00:00:00 2001 From: APTX Date: Sat, 13 Apr 2013 17:10:52 +0200 Subject: [PATCH] Fix setFileLocation typo/null values. --- localmylist/database.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/localmylist/database.cpp b/localmylist/database.cpp index 80ca8b8..63f0532 100644 --- a/localmylist/database.cpp +++ b/localmylist/database.cpp @@ -322,9 +322,9 @@ bool Database::addFileLocation(const FileLocation &fileLocation) " :renameDisabled, :originalName, DEFAULT, DEFAULT, DEFAULT, DEFAULT)"); q.bindValue(":fid", fileLocation.fid); q.bindValue(":hostId", fileLocation.hostId); - q.bindValue(":path", fileLocation.path); + q.bindValue(":path", fileLocation.path.isNull() ? "" : fileLocation.path); q.bindValue(":renameDisabled", false); - q.bindValue(":originalName", fileLocation.originalName); + q.bindValue(":originalName", fileLocation.originalName.isNull() ? "" : fileLocation.originalName); return exec(q); } @@ -336,7 +336,7 @@ bool Database::setFileLocation(const FileLocation &fileLocation) "UPDATE file_location SET fid = :fid, host_id = :hostId, path = :path, " " rename_disabled = :renameDisabled, renamed = :renamed, " " rename_path = :renamePath, failed_rename = :failedRename, " - " rename_error = :renameRrror " + " rename_error = :renameError " " WHERE location_id = :locationId"); q.bindValue(":locationId", fileLocation.locationId); @@ -345,9 +345,9 @@ bool Database::setFileLocation(const FileLocation &fileLocation) q.bindValue(":path", fileLocation.path); q.bindValue(":renameDisabled", fileLocation.renameDisabled); q.bindValue(":renamed", fileLocation.renamed); - q.bindValue(":renamePath", fileLocation.renamePath); + q.bindValue(":renamePath", fileLocation.renamePath.isNull() ? "" : fileLocation.renamePath); q.bindValue(":failedRename", fileLocation.failedRename); - q.bindValue(":renameError", fileLocation.renameError); + q.bindValue(":renameError", fileLocation.renameError.isNull() ? "" : fileLocation.renameError); return exec(q); } -- 2.52.0