diff options
Diffstat (limited to 'core/polkit-tqt-details.cpp')
-rw-r--r-- | core/polkit-tqt-details.cpp | 59 |
1 files changed, 34 insertions, 25 deletions
diff --git a/core/polkit-tqt-details.cpp b/core/polkit-tqt-details.cpp index 8fd8efa14..245ce2577 100644 --- a/core/polkit-tqt-details.cpp +++ b/core/polkit-tqt-details.cpp @@ -38,22 +38,31 @@ class Details::Data : public TQShared { public: Data() : details(NULL) - { - } + { + } Data(const Data &other) : details(other.details) { - g_object_ref(details); + if (details) + { + g_object_ref(details); + } } Data(PolkitDetails *_details) : details(_details) { - g_object_ref(details); + if (details) + { + g_object_ref(details); + } } ~Data() { - g_object_unref(details); + if (details) + { + g_object_unref(details); + } } PolkitDetails *details; @@ -65,7 +74,7 @@ class Details::Data : public TQShared Details::Details() : d(new Data) { - d->details = polkit_details_new(); + d->details = polkit_details_new(); } Details::Details(PolkitDetails *pkDetails) : d(new Data(pkDetails)) @@ -101,33 +110,33 @@ Details::~Details() TQString Details::lookup(const TQString &key) const { - const gchar *result = polkit_details_lookup(d->details, key.utf8().data()); - if (result != NULL) - { - return TQString::fromUtf8(result); - } - else - { - return TQString::null; - } + const gchar *result = polkit_details_lookup(d->details, key.utf8().data()); + if (result != NULL) + { + return TQString::fromUtf8(result); + } + else + { + return TQString::null; + } } void Details::insert(const TQString &key, const TQString &value) { - polkit_details_insert(d->details, key.utf8().data(), value.utf8().data()); + polkit_details_insert(d->details, key.utf8().data(), value.utf8().data()); } TQStringList Details::keys() const { - gchar **result = polkit_details_get_keys(d->details); - TQStringList list; - int len = g_strv_length(result); - for (int i = 0; i < len; i++) - { - list.append(TQString::fromUtf8(result[i])); - } - g_strfreev(result); - return list; + gchar **result = polkit_details_get_keys(d->details); + TQStringList list; + int len = g_strv_length(result); + for (int i = 0; i < len; i++) + { + list.append(TQString::fromUtf8(result[i])); + } + g_strfreev(result); + return list; } } |