diff options
author | Benjamin Jemlich <pcgod@users.sourceforge.net> | 2012-02-26 11:36:19 +0400 |
---|---|---|
committer | Benjamin Jemlich <pcgod@users.sourceforge.net> | 2012-02-26 11:36:19 +0400 |
commit | 491cd1eb44f041b6e4bb0dc98cadf717537e36bc (patch) | |
tree | 145ab30ad1c0a0918e491085aecd103b8b126ed4 /src/murmur/ServerDB.cpp | |
parent | 0bba55bf29304b0085e3d1a9575d3cf07d799070 (diff) |
Misc fixes
Diffstat (limited to 'src/murmur/ServerDB.cpp')
-rw-r--r-- | src/murmur/ServerDB.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/src/murmur/ServerDB.cpp b/src/murmur/ServerDB.cpp index 4badd32e4..7310300c5 100644 --- a/src/murmur/ServerDB.cpp +++ b/src/murmur/ServerDB.cpp @@ -1134,24 +1134,16 @@ void Server::removeLink(Channel *c, Channel *l) { QSqlQuery &query = *th.qsqQuery; - if (l) { - SQLPREP("DELETE FROM `%1channel_links` WHERE `server_id` = ? AND `channel_id` = ? AND `link_id` = ?"); - query.addBindValue(iServerNum); - query.addBindValue(c->iId); - query.addBindValue(l->iId); - SQLEXEC(); + SQLPREP("DELETE FROM `%1channel_links` WHERE `server_id` = ? AND `channel_id` = ? AND `link_id` = ?"); + query.addBindValue(iServerNum); + query.addBindValue(c->iId); + query.addBindValue(l->iId); + SQLEXEC(); - query.addBindValue(iServerNum); - query.addBindValue(l->iId); - query.addBindValue(c->iId); - SQLEXEC(); - } else { - SQLPREP("DELETE FROM `%1channel_links` WHERE `server_id` = ? AND (`channel_id` = ? OR `link_id` = ?)"); - query.addBindValue(iServerNum); - query.addBindValue(c->iId); - query.addBindValue(c->iId); - SQLEXEC(); - } + query.addBindValue(iServerNum); + query.addBindValue(l->iId); + query.addBindValue(c->iId); + SQLEXEC(); } Channel *Server::addChannel(Channel *p, const QString &name, bool temporary, int position) { @@ -1185,6 +1177,7 @@ Channel *Server::addChannel(Channel *p, const QString &name, bool temporary, int query.addBindValue(id); query.addBindValue(ServerDB::Channel_Position); query.addBindValue(QVariant(position).toString()); + SQLEXEC(); Channel *c = new Channel(id, name, p); c->bTemporary = temporary; |