From c7b754a36e02c34a291f2f5541ff96784bc5dcfa Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Sat, 24 Sep 2016 19:29:32 +0200 Subject: [PATCH] Swapped branches in if statement caused settings to not be stored in db --- .../kdeconnect/Plugins/NotificationsPlugin/AppDatabase.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/AppDatabase.java b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/AppDatabase.java index 404199c8..40652fde 100644 --- a/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/AppDatabase.java +++ b/src/org/kde/kdeconnect/Plugins/NotificationsPlugin/AppDatabase.java @@ -86,10 +86,10 @@ public class AppDatabase { ContentValues cv = new ContentValues(); cv.put(KEY_IS_ENABLED, isEnabled?"true":"false"); if (res.getCount() > 0) { + ourDatabase.update(DATABASE_TABLE, cv, KEY_PACKAGE_NAME + "=?",new String[]{packageName}); + } else { cv.put(KEY_PACKAGE_NAME, packageName); ourDatabase.insert(DATABASE_TABLE, null, cv); - } else { - ourDatabase.update(DATABASE_TABLE, cv, KEY_PACKAGE_NAME + "=?",new String[]{packageName}); } res.close(); }