aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2022-01-13 12:51:32 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-01 07:58:22 +0100
commitd23a290dae52eec26bb4fd772168f38bd6e59f4e (patch)
tree3535261eaa585b4d19f8b22b8b07ba6d766d529b /libqmenumodel
parent7f5119f81fdfa2cc97df91785dcce4798b0700cf (diff)
downloadqmenumodel-d23a290dae52eec26bb4fd772168f38bd6e59f4e.tar.gz
qmenumodel-d23a290dae52eec26bb4fd772168f38bd6e59f4e.tar.bz2
qmenumodel-d23a290dae52eec26bb4fd772168f38bd6e59f4e.zip
Fix all build warnings
Diffstat (limited to 'libqmenumodel')
-rw-r--r--libqmenumodel/src/ayatanamenuaction.cpp7
-rw-r--r--libqmenumodel/src/ayatanamenumodel.cpp8
-rw-r--r--libqmenumodel/src/ayatanamenumodelevents.cpp6
-rw-r--r--libqmenumodel/src/converter.cpp27
4 files changed, 26 insertions, 22 deletions
diff --git a/libqmenumodel/src/ayatanamenuaction.cpp b/libqmenumodel/src/ayatanamenuaction.cpp
index 7e13b35..72d65af 100644
--- a/libqmenumodel/src/ayatanamenuaction.cpp
+++ b/libqmenumodel/src/ayatanamenuaction.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2013 Canonical Ltd.
+ * Copyright 2022 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -13,7 +14,9 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * Authors: Nick Dedekind <nick.dedekind@canonical.com>
+ * Authors:
+ * Nick Dedekind <nick.dedekind@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
#include "ayatanamenuaction.h"
@@ -148,8 +151,6 @@ bool AyatanaMenuAction::event(QEvent* e)
setState(umasce->state);
return true;
} else if (e->type() == AyatanaMenuActionRemoveEvent::eventType) {
- AyatanaMenuActionRemoveEvent *umare = static_cast<AyatanaMenuActionRemoveEvent*>(e);
-
setValid(false);
return true;
}
diff --git a/libqmenumodel/src/ayatanamenumodel.cpp b/libqmenumodel/src/ayatanamenumodel.cpp
index 2c735e6..39ce0bc 100644
--- a/libqmenumodel/src/ayatanamenumodel.cpp
+++ b/libqmenumodel/src/ayatanamenumodel.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2013 Canonical Ltd.
+ * Copyright 2022 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -13,7 +14,9 @@
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
- * Authors: Lars Uebernickel <lars.uebernickel@canonical.com>
+ * Authors:
+ * Lars Uebernickel <lars.uebernickel@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
#include "ayatanamenumodel.h"
@@ -270,12 +273,10 @@ void AyatanaMenuModelPrivate::menuItemChanged(GObject *object, GParamSpec *pspec
{
GSequenceIter *it = (GSequenceIter *) user_data;
GtkMenuTrackerItem *item;
- GtkActionObservable *muxer;
AyatanaMenuModel *model;
gint position;
item = (GtkMenuTrackerItem *) g_sequence_get (it);
- muxer = _gtk_menu_tracker_item_get_observable (item);
model = (AyatanaMenuModel *) g_object_get_qdata (G_OBJECT (item), ayatana_menu_model_quark ());
position = g_sequence_iter_get_position (it);
@@ -928,7 +929,6 @@ char * AyatanaMenuModelPrivate::fullActionName(AyatanaMenuAction *action)
GSequenceIter *iter;
QByteArray bytes;
const gchar *name;
- gchar *full_name = NULL;
bytes = action->name().toUtf8();
name = bytes.constData();
diff --git a/libqmenumodel/src/ayatanamenumodelevents.cpp b/libqmenumodel/src/ayatanamenumodelevents.cpp
index 357b6be..70f2cfc 100644
--- a/libqmenumodel/src/ayatanamenumodelevents.cpp
+++ b/libqmenumodel/src/ayatanamenumodelevents.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2013 Canonical Ltd.
+ * Copyright 2022 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -15,6 +16,7 @@
*
* Authors:
* Nicholas Dedekind <nick.dedekind@canonical.com
+ * Robert Tari <robert@tari.in>
*/
#include <glib-object.h>
@@ -39,7 +41,7 @@ AyatanaMenuModelAddRowEvent::AyatanaMenuModelAddRowEvent(GPtrArray *_items, int
position(_position)
{
if (items) {
- for (gint i = 0; i < items->len; ++i)
+ for (guint i = 0; i < items->len; ++i)
g_object_ref(g_ptr_array_index(items, i));
g_ptr_array_ref(items);
}
@@ -48,7 +50,7 @@ AyatanaMenuModelAddRowEvent::AyatanaMenuModelAddRowEvent(GPtrArray *_items, int
AyatanaMenuModelAddRowEvent::~AyatanaMenuModelAddRowEvent()
{
if (items) {
- for (gint i = 0; i < items->len; ++i)
+ for (guint i = 0; i < items->len; ++i)
g_object_unref(g_ptr_array_index(items, i));
g_ptr_array_unref(items);
}
diff --git a/libqmenumodel/src/converter.cpp b/libqmenumodel/src/converter.cpp
index 49ced63..98757da 100644
--- a/libqmenumodel/src/converter.cpp
+++ b/libqmenumodel/src/converter.cpp
@@ -1,5 +1,6 @@
/*
* Copyright 2012-2016 Canonical Ltd.
+ * Copyright 2022 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -16,6 +17,7 @@
* Authors:
* Renato Araujo Oliveira Filho <renato@canonical.com>
* Marco Trevisan <marco.trevisan@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
#include <glib.h>
@@ -164,29 +166,29 @@ GVariant* Converter::toGVariant(const QVariant &value)
if (value.isNull() || !value.isValid())
return result;
- switch(value.type()) {
- case QVariant::Bool:
+ switch((QMetaType::Type)value.type()) {
+ case QMetaType::Bool:
result = g_variant_new_boolean(value.toBool());
break;
- case QVariant::ByteArray:
+ case QMetaType::QByteArray:
result = g_variant_new_bytestring(value.toByteArray());
break;
- case QVariant::Double:
+ case QMetaType::Double:
result = g_variant_new_double(value.toDouble());
break;
- case QVariant::Int:
+ case QMetaType::Int:
result = g_variant_new_int32(value.toInt());
break;
- case QVariant::LongLong:
+ case QMetaType::LongLong:
result = g_variant_new_int64(value.toLongLong());
break;
- case QVariant::String:
+ case QMetaType::QString:
result = g_variant_new_string(qUtf8Printable(value.toString()));
break;
- case QVariant::UInt:
+ case QMetaType::UInt:
result = g_variant_new_uint32(value.toUInt());
break;
- case QVariant::ULongLong:
+ case QMetaType::ULongLong:
result = g_variant_new_uint64(value.toULongLong());
break;
case QMetaType::UChar:
@@ -204,10 +206,9 @@ GVariant* Converter::toGVariant(const QVariant &value)
case QMetaType::ULong:
result = g_variant_new_uint64(value.value<ulong>());
break;
- case QVariant::Map:
+ case QMetaType::QVariantMap:
{
GVariantBuilder *b;
- GVariant *dict;
b = g_variant_builder_new(G_VARIANT_TYPE_VARDICT);
QMapIterator<QString, QVariant> i(value.toMap());
@@ -231,7 +232,7 @@ GVariant* Converter::toGVariant(const QVariant &value)
g_variant_builder_unref(b);
break;
}
- case QVariant::List:
+ case QMetaType::QVariantList:
{
GVariantBuilder *b = g_variant_builder_new(G_VARIANT_TYPE_TUPLE);
@@ -242,7 +243,7 @@ GVariant* Converter::toGVariant(const QVariant &value)
g_variant_builder_unref(b);
break;
}
- case QVariant::StringList:
+ case QMetaType::QStringList:
{
GVariantBuilder *b = g_variant_builder_new(G_VARIANT_TYPE_STRING_ARRAY);