summaryrefslogtreecommitdiffstats
path: root/pica-client/settings.cpp
diff options
context:
space:
mode:
authorAnton <anton@picapica>2016-09-15 19:50:24 +0400
committerAnton <anton@picapica>2016-09-15 19:50:24 +0400
commit57075f0806f1fcdeef1b5dad8ac4cf61ec7da6e7 (patch)
tree9a8b5fd047a64c94f689951ed957effa41fee8ac /pica-client/settings.cpp
parentaa169097397a8a168ca9309b3602932865a65be4 (diff)
downloadpica-pica-57075f0806f1fcdeef1b5dad8ac4cf61ec7da6e7.tar.gz
pica-pica-57075f0806f1fcdeef1b5dad8ac4cf61ec7da6e7.zip
show settings dialog on first start
Diffstat (limited to 'pica-client/settings.cpp')
-rw-r--r--pica-client/settings.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/pica-client/settings.cpp b/pica-client/settings.cpp
index 160e402..4b5485d 100644
--- a/pica-client/settings.cpp
+++ b/pica-client/settings.cpp
@@ -18,6 +18,24 @@ QString Settings::GetLastError()
return lasterr.text();
}
+bool Settings::isEmpty()
+{
+ QSqlQuery query;
+
+ query.exec("select count(*) from settings");
+
+ lasterr = query.lastError();
+
+ query.next();
+
+ if (query.isValid() && query.value(0).toInt() == 0)
+ {
+ return true;
+ }
+
+ return false;
+}
+
QVariant Settings::loadValue(QString name, QVariant defval)
{
QSqlQuery query;