on xenial help sign in
Build without any warnings

Approved by: Andrea Cimitan

commitc959e368020249a484eb64c2ccd9cbeffcfaf8e9 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateThu 18 Sep 2014, 09:43 (12 years ago) parent06e0a2e00cb699
4 files changed+33−3
plugins/Lights/Lights.cpp+1−2 plugins/Lights/android-hardware.h+23 plugins/Utils/windowkeysfilter.cpp+1 tests/mocks/HudClient/fake_libhud_client.cpp+8−1
plugins/Lights/Lights.cpp+1−2
@@ -20,8 +20,7 @@
2020#include <QtCore/QDebug>
2121
2222extern "C" {
23−#include <hardware/hardware.h>
24−#include <hardware/lights.h>
23+#include "android-hardware.h"
2524#include <string.h>
2625}
2726
plugins/Lights/android-hardware.hnew file+23
@@ -0,0 +1,23 @@
1+/*
2+ * Copyright (C) 2014 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ *
16+ */
17+
18+// The purpose of this header wrapper is just to avoid having warnings being reported on
19+// code from external header files, as we can't do anything about them.
20+#pragma GCC system_header
21+
22+#include <hardware/hardware.h>
23+#include <hardware/lights.h>
plugins/Utils/windowkeysfilter.cpp+1
@@ -31,6 +31,7 @@ bool WindowKeysFilter::eventFilter(QObject *watched, QEvent *event)
3131{
3232 Q_ASSERT(!m_filteredWindow.isNull());
3333 Q_ASSERT(watched == static_cast<QObject*>(m_filteredWindow.data()));
34+ Q_UNUSED(watched);
3435
3536 if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
3637 // Let QML see this event and decide if it does not want it
tests/mocks/HudClient/fake_libhud_client.cpp+8−1
@@ -63,6 +63,7 @@ HudClientQuery *hud_client_query_new(const gchar *query)
6363DeeModel *hud_client_query_get_results_model(HudClientQuery *cquery)
6464{
6565 Q_ASSERT(cquery == HudClientStub::m_query);
66+ Q_UNUSED(cquery);
6667 if (!resultsModel) {
6768 resultsModel = dee_sequence_model_new();
6869 dee_model_set_schema_full(resultsModel, results_model_schema, G_N_ELEMENTS(results_model_schema));
@@ -113,18 +114,21 @@ void hud_client_query_execute_toolbar_item(HudClientQuery *cquery, HudClientQuer
113114{
114115 Q_ASSERT(cquery == HudClientStub::m_query);
115116 Q_UNUSED(timestamp);
117+ Q_UNUSED(cquery);
116118 HudClientStub::m_lastExecutedToolbarItem = item;
117119}
118120
119121void hud_client_query_set_query(HudClientQuery *cquery, const char *query)
120122{
121123 Q_ASSERT(cquery == HudClientStub::m_query);
124+ Q_UNUSED(cquery);
122125 HudClientStub::m_lastSetQuery = QString::fromUtf8(query);
123126}
124127
125128void hud_client_query_execute_command(HudClientQuery *cquery, GVariant *command_key, guint timestamp)
126129{
127130 Q_ASSERT(cquery == HudClientStub::m_query);
131+ Q_UNUSED(cquery);
128132 Q_UNUSED(timestamp);
129133 for (uint i = 0; i < dee_model_get_n_rows(resultsModel); ++i) {
130134 DeeModelIter *iter = dee_model_get_iter_at_row(resultsModel, i);
@@ -144,6 +148,7 @@ void hud_client_query_execute_command(HudClientQuery *cquery, GVariant *command_
144148HudClientParam *hud_client_query_execute_param_command(HudClientQuery *cquery, GVariant *command_key, guint timestamp)
145149{
146150 Q_ASSERT(cquery == HudClientStub::m_query);
151+ Q_UNUSED(cquery);
147152 Q_UNUSED(timestamp);
148153 for (uint i = 0; i < dee_model_get_n_rows(resultsModel); ++i) {
149154 DeeModelIter *iter = dee_model_get_iter_at_row(resultsModel, i);
@@ -165,12 +170,14 @@ HudClientParam *hud_client_query_execute_param_command(HudClientQuery *cquery, G
165170void hud_client_query_voice_query(HudClientQuery *cquery)
166171{
167172 Q_ASSERT(cquery == HudClientStub::m_query);
173+ Q_UNUSED(cquery);
168174 // TODO We are not testing voice queries yet
169175}
170176
171177gboolean hud_client_query_toolbar_item_active(HudClientQuery *cquery, HudClientQueryToolbarItems item)
172178{
173179 Q_ASSERT(cquery == HudClientStub::m_query);
180+ Q_UNUSED(cquery);
174181 if (item == HUD_CLIENT_QUERY_TOOLBAR_HELP)
175182 return HudClientStub::m_helpToolbarItemEnabled;
176183
@@ -218,7 +225,7 @@ GActionGroup *hud_client_param_get_actions(HudClientParam *param)
218225 if (!parametrizedActionGroup) {
219226 GSimpleActionGroup *actionGroup = g_simple_action_group_new();
220227 GSimpleAction *action = g_simple_action_new("costAction", G_VARIANT_TYPE_DOUBLE);
221− g_simple_action_group_insert(actionGroup, G_ACTION(action));
228+ g_action_map_add_action(G_ACTION_MAP(actionGroup), G_ACTION(action));
222229
223230 g_signal_connect (action, "activate", G_CALLBACK (on_signal_activated), nullptr);
224231