From 30ca123626822b3d9ca552353306659464457c2d Mon Sep 17 00:00:00 2001 From: dorian Date: Fri, 28 Dec 2018 11:43:57 +0100 Subject: [PATCH] fixed bug that made old filters without role undeletable --- android-sources/AndroidManifest.xml | 2 +- sources/appsettings.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/android-sources/AndroidManifest.xml b/android-sources/AndroidManifest.xml index dad75a1..62ae84b 100644 --- a/android-sources/AndroidManifest.xml +++ b/android-sources/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/sources/appsettings.cpp b/sources/appsettings.cpp index 84159d3..42911d1 100644 --- a/sources/appsettings.cpp +++ b/sources/appsettings.cpp @@ -77,6 +77,14 @@ QList AppSettings::readFilters() { filtersList.append(tmpFilterList); } + for(int i = 0; i < filtersList.length(); i++){ + QStringList filterList = filtersList[i]; + if( filterList[2] == "" ){ + filtersList.removeAt(i); + i = i-1; + } + } + return(filtersList); } @@ -86,6 +94,14 @@ void AppSettings::writeFilters(QList list) { QString jsonString; QJsonArray filtersArray; + for(int i = 0; i < list.length(); i++){ + QStringList filterList = list[i]; + if( filterList[2] == "" ){ + list.removeAt(i); + i = i-1; + } + } + foreach(QStringList filter, list){ QJsonArray filterArray;