diff --git a/debian/control b/debian/control index 16235c2..259b3ad 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,8 @@ Build-Depends: debhelper (>= 9), cmake, pkg-config, - qt5-default, + qtbase5-dev, + qt5-qmake, libglibmm-2.4-dev, doxygen, qttools5-dev-tools @@ -17,15 +18,18 @@ Package: libgio-qt Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libglibmm-2.4-1v5 Description: Gio wrapper for Qt. + A convenient way to bind gio with Qt5. Package: libgio-qt-dev Architecture: any Section: libdevel Depends: libgio-qt, ${misc:Depends}, libglibmm-2.4-dev Description: Development package for libgio-qt. + A convenient way to bind gio with Qt5. Package: libgio-qt-doc Architecture: any Section: doc Depends: ${misc:Depends} Description: Gio wrapper for Qt (documentation) + A convenient way to bind gio with Qt5. diff --git a/gio-qt/source/dgiosettings.cpp b/gio-qt/source/dgiosettings.cpp index 4abee04..13d6e2b 100644 --- a/gio-qt/source/dgiosettings.cpp +++ b/gio-qt/source/dgiosettings.cpp @@ -185,8 +185,33 @@ public: GSettingsSchema* schema; gulong signalHandlerId; + bool strvHasString (gchar **haystack, const gchar *needle) const { + if (needle == nullptr) return false; + + for (guint n = 0; haystack != NULL && haystack[n] != NULL; n++) { + if (g_strcmp0 (haystack[n], needle) == 0) + return true; + } + + return false; + } + + bool inlcudeKey(const gchar* gkey) const { + gchar **allKeys = g_settings_list_keys(settings); + bool ret = strvHasString (allKeys, gkey); + g_strfreev (allKeys); + + return ret; + } + QVariant value(GSettings* gsettings, const QString& key) const { gchar* gkey = DGioPrivate::converToGChar(key.toUtf8()); + + if(!inlcudeKey(gkey)) { + g_free(gkey); + return QVariant(); + } + GVariant* variant = g_settings_get_value(gsettings, gkey); QVariant qvalue = qconf_types_to_qvariant(variant); g_variant_unref(variant); @@ -198,6 +223,9 @@ public: bool trySet(const QString& key, const QVariant& value) { const gchar* gkey = key.toUtf8().constData(); + + if(!inlcudeKey(gkey)) return false; + bool success = false; /* fetch current value to find out the exact type */