From: APTX Date: Sat, 13 Apr 2013 15:10:52 +0000 (+0200) Subject: Fix setFileLocation typo/null values. X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=9db21037adb340c9ebbed75c3434b1e973f37423;p=localmylist.git Fix setFileLocation typo/null values. --- 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); }