aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramet <amet.nospam@gmail.com>2013-01-14 21:16:41 +0400
committerS. Davilla <davilla@4pi.com>2013-01-18 10:22:20 -0500
commit20856b2d2432a423c83cf45332ff2f1f117604eb (patch)
tree94a1afc5cdb44da12e922d0f058a9cab99d662c1
parent0a20a1d48d44aa154e7f4c05c8ae37584c80abbf (diff)
remove duplicate code in "CAddonDatabase::DisableAddon()"
-rw-r--r--xbmc/addons/AddonDatabase.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/xbmc/addons/AddonDatabase.cpp b/xbmc/addons/AddonDatabase.cpp
index 92e90bf992..cb382aa774 100644
--- a/xbmc/addons/AddonDatabase.cpp
+++ b/xbmc/addons/AddonDatabase.cpp
@@ -566,12 +566,9 @@ bool CAddonDatabase::DisableAddon(const CStdString &addonID, bool disable /* = t
if (disable)
{
- CStdString sql = PrepareSQL("select id from disabled where addonID='%s'", addonID.c_str());
- m_pDS->query(sql.c_str());
- if (m_pDS->eof()) // not found
+ if (!IsAddonDisabled(addonID)) // Enabled
{
- m_pDS->close();
- sql = PrepareSQL("insert into disabled(id, addonID) values(NULL, '%s')", addonID.c_str());
+ CStdString sql = PrepareSQL("insert into disabled(id, addonID) values(NULL, '%s')", addonID.c_str());
m_pDS->exec(sql);
AddonPtr addon;