diff -Nru qmenumodel-0.9.0/AUTHORS qmenumodel-0.9.1/AUTHORS --- qmenumodel-0.9.0/AUTHORS 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/AUTHORS 2022-02-08 15:54:02.000000000 +0000 @@ -7,6 +7,7 @@ Charles Kerr CI Train Bot <${CITRAIN_USER}@canonical.com> CI Train Bot +Dalton Durst Florian Boucault Florian Leeber Gustavo Pichorim Boiko diff -Nru qmenumodel-0.9.0/.build.yml qmenumodel-0.9.1/.build.yml --- qmenumodel-0.9.0/.build.yml 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/.build.yml 2022-02-08 15:54:02.000000000 +0000 @@ -79,7 +79,6 @@ build_scripts: - if [ ${DISTRO_NAME} == "debian" ];then - - export CFLAGS+=" -Wsign-compare -Wunused-parameter" - cppcheck --enable=warning,style,performance,portability,information,missingInclude . - fi - @@ -88,9 +87,9 @@ - scan-build $CHECKERS ./configure --prefix=/usr --enable-gtk-doc --enable-compile-warnings=maximum - elif [ -e ./CMakeLists.txt ]; then - if [ ${DISTRO_NAME} == "debian" ];then - - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTS=ON + - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_WERROR=ON -DENABLE_TESTS=ON - else - - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON + - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_WERROR=ON - fi - else - exit 1 diff -Nru qmenumodel-0.9.0/ChangeLog qmenumodel-0.9.1/ChangeLog --- qmenumodel-0.9.0/ChangeLog 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/ChangeLog 2022-02-08 15:54:02.000000000 +0000 @@ -1,6 +1,45 @@ +2022-02-08 Mike Gabriel + + * release 0.9.1 (HEAD -> main, tag: 0.9.1) + +2022-02-08 Robert Tari + + * .travis.yml: Run CI builds on Travis CI's Ubuntu focal base system + + disable ppc64el builds (5e46aa7) + +2022-02-01 Mike Gabriel + + * Merge branch 'tari01-pr/cleanup-compile-flags' (45da057) + +2022-01-13 Robert Tari + + * .build.yml: Drop extra compilation flags and build with -Werror + (f441fab) + * CMakeLists.txt: Clean up compilation flags (59283b0) + * Fix all build warnings (d23a290) + +2022-02-01 Mike Gabriel + + * Merge branch 'correct-1-0' (7f5119f) + +2021-12-23 Dalton Durst + + * Make the qmltests test imports, at least (03a23b0) + * Fix build warning regarding qchar (fbb94cd) + * Fix naming of AyatanaMenuModel qml type (0333149) + * Fix versioning in examples and tests (02c973a) + +2022-02-01 Mike Gabriel + + * Merge branch 'tari01-pr/ayatana-style-cmake' (cc2c2d9) + +2021-12-15 Robert Tari + + * CMakeLists.txt: Rewrite and enable Ayatana-style options (8e228ca) + 2021-12-14 Mike Gabriel - * release 0.9.0 (HEAD -> main, tag: 0.9.0) + * release 0.9.0 (4c27ec6) (tag: 0.9.0) * Merge branch 'tari01-pr/qml-1-0' (0924c28) 2021-12-08 Mike Gabriel diff -Nru qmenumodel-0.9.0/CMakeLists.txt qmenumodel-0.9.1/CMakeLists.txt --- qmenumodel-0.9.0/CMakeLists.txt 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/CMakeLists.txt 2022-02-08 15:54:02.000000000 +0000 @@ -1,12 +1,41 @@ project(qmenumodel) +cmake_minimum_required(VERSION 3.13) +set (PROJECT_VERSION "0.9.1") -set (PROJECT_VERSION "0.9.0") +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + SET(CMAKE_INSTALL_PREFIX "/usr" CACHE PATH "..." FORCE) +endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + +# Options +option(ENABLE_TESTS "Enable all tests and checks" OFF) +option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF) +option(ENABLE_WERROR "Treat all build warnings as errors" OFF) +option(TEST_XML_OUTPUT "Print test results to xml files" OFF) +option(GENERATE_DOC "Enable qdoc generation" OFF) + +if(ENABLE_COVERAGE) + set(ENABLE_TESTS ON) + set(CMAKE_BUILD_TYPE "Coverage") +else() + set(CMAKE_BUILD_TYPE "Release") +endif() -cmake_minimum_required(VERSION 3.13) +if(ENABLE_TESTS) + set(TEST_XML_OUTPUT ON) +endif() + +if(ENABLE_WERROR) + add_definitions("-Werror") +endif() + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + add_definitions("-Weverything") +else() + add_definitions("-Wall") +endif() # Standard install paths include(GNUInstallDirs) - find_package(Qt5Core REQUIRED) find_package(Qt5Qml REQUIRED) find_package(Qt5Gui REQUIRED) @@ -16,45 +45,34 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) add_definitions(-DQT_NO_KEYWORDS) - -find_program(DBUS_RUNNER dbus-test-runner) - add_subdirectory(libqmenumodel) -# Tests Tools -OPTION(TEST_XML_OUTPUT "Print test results on xml files" ON) -if(NOT DBUS_RUNNER) - message(STATUS "dbus-test-runner not found tests disabled.") -else() - # We need to enable test to create the 'make check' target mandatory on jenkins +# Tests +if (ENABLE_TESTS) + find_program(DBUS_RUNNER dbus-test-runner REQUIRED) enable_testing() if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l") message(STATUS "Current version of qemu crashes during the tests. We will skip it for now.") + set(ENABLE_TESTS OFF) + set(ENABLE_COVERAGE OFF) + set(TEST_XML_OUTPUT OFF) else() - message(STATUS "Tests enabled for arch: ${CMAKE_SYSTEM_PROCESSOR}") add_subdirectory(tests) + if (ENABLE_COVERAGE) + find_package(CoverageReport) + endif() endif() endif() # Doc -OPTION(GENERATE_DOC "Enable qdoc generation" OFF) if(GENERATE_DOC) - message(STATUS "QDoc enabled.") - find_program(QDOC_BIN qdoc) - if(NOT QDOC_BIN) - message(FATAL_ERROR "qdoc command not found") - else() - add_subdirectory(doc) - endif() + find_program(QDOC_BIN qdoc REQUIRED) + add_subdirectory(doc) endif() -# Coverage -##################################################################### -# Enable code coverage calculation with gcov/gcovr/lcov -# Usage: -# * Switch build type to coverage (use ccmake or cmake-gui) -# * Invoke make, make test, make coverage (or ninja if you use that backend) -# * Find html report in subdir coveragereport -# * Find xml report feasible for jenkins in coverage.xml -##################################################################### -find_package(CoverageReport) +# Display config info +message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") +message(STATUS "Unit tests: ${ENABLE_TESTS}") +message(STATUS "Build with -Werror: ${ENABLE_WERROR}") +message(STATUS "Print test results to xml files: ${TEST_XML_OUTPUT}") +message(STATUS "QDoc generation: ${GENERATE_DOC}") diff -Nru qmenumodel-0.9.0/debian/changelog qmenumodel-0.9.1/debian/changelog --- qmenumodel-0.9.0/debian/changelog 2021-12-15 22:11:42.000000000 +0000 +++ qmenumodel-0.9.1/debian/changelog 2022-02-08 20:40:32.000000000 +0000 @@ -1,3 +1,12 @@ +qmenumodel (0.9.1-1) unstable; urgency=medium + + * New upstream release. + * debian/copyright: + + Update auto-generated copyright.in template file. + + Update copyright attributions. + + -- Mike Gabriel Tue, 08 Feb 2022 21:40:32 +0100 + qmenumodel (0.9.0-1) unstable; urgency=medium * New upstream release. diff -Nru qmenumodel-0.9.0/debian/copyright qmenumodel-0.9.1/debian/copyright --- qmenumodel-0.9.0/debian/copyright 2021-12-15 22:11:42.000000000 +0000 +++ qmenumodel-0.9.1/debian/copyright 2022-02-08 20:40:32.000000000 +0000 @@ -11,18 +11,13 @@ libqmenumodel/QMenuModel/plugin.h libqmenumodel/src/actionstateparser.cpp libqmenumodel/src/actionstateparser.h - libqmenumodel/src/ayatanamenuaction.cpp libqmenumodel/src/ayatanamenuaction.h libqmenumodel/src/ayatanamenuactionevents.cpp libqmenumodel/src/ayatanamenuactionevents.h - libqmenumodel/src/ayatanamenumodel.cpp libqmenumodel/src/ayatanamenumodel.h - libqmenumodel/src/ayatanamenumodelevents.cpp libqmenumodel/src/ayatanamenumodelevents.h - libqmenumodel/src/converter.cpp libqmenumodel/src/converter.h libqmenumodel/src/dbus-enums.h - libqmenumodel/src/logging.h libqmenumodel/src/menunode.cpp libqmenumodel/src/menunode.h libqmenumodel/src/qdbusactiongroup.cpp @@ -37,16 +32,12 @@ libqmenumodel/src/qmenumodelevents.h libqmenumodel/src/qstateaction.cpp libqmenumodel/src/qstateaction.h - tests/client/actiongrouptest.cpp tests/client/ayatanamenuactiontest.cpp tests/client/cachetest.cpp tests/client/convertertest.cpp - tests/client/loadmodel.qml - tests/client/loadmodel2.qml tests/client/menuchangestest.cpp tests/client/modelsignalstest.cpp tests/client/modeltest.cpp - tests/client/qmltest.cpp tests/client/script_actiongrouptest.py tests/client/script_menuchangestest.py tests/client/script_modeltest.py @@ -55,18 +46,11 @@ tests/client/servicetest.cpp tests/client/treetest.cpp tests/script/dbusmenuscript.cpp - tests/script/dbusmenuscript.h tests/script/menuscript.py Copyright: 2012, Canonical Ltd. 2012-2016, Canonical Ltd. 2013, Canonical Ltd. 2014, Canonical Ltd. - 2016, Canonical, Ltd. -License: LGPL-3 - -Files: libqmenumodel/QMenuModel/plugin.cpp -Copyright: 2012, Canonical Ltd. - 2021, Robert Tari License: LGPL-3 Files: .build.yml @@ -86,13 +70,15 @@ libqmenumodel/QMenuModel/CMakeLists.txt libqmenumodel/QMenuModel/qmldir libqmenumodel/src/CMakeLists.txt - libqmenumodel/src/qmenumodel.pc.in libqmenumodel/src/gtk/config.h + libqmenumodel/src/qmenumodel.pc.in tests/CMakeLists.txt tests/client/CMakeLists.txt tests/client/qmlfiles.h.in tests/script/CMakeLists.txt Copyright: 2012-2016, Canonical Ltd. + 2021, UBports Foundation + 2021-2022, Robert Tari License: LGPL-3 Comment: Assuming same copyright holders and license as found @@ -115,6 +101,30 @@ 2013, Canonical Limited License: LGPL-2+ +Files: libqmenumodel/QMenuModel/plugin.cpp + libqmenumodel/src/ayatanamenuaction.cpp + libqmenumodel/src/ayatanamenumodel.cpp + libqmenumodel/src/ayatanamenumodelevents.cpp + libqmenumodel/src/converter.cpp + tests/client/actiongrouptest.cpp + tests/script/dbusmenuscript.h +Copyright: 2012, Canonical Ltd. + 2012-2016, Canonical Ltd. + 2013, Canonical Ltd. + 2021, Robert Tari + 2022, Robert Tari +License: LGPL-3 + +Files: tests/client/importtest.qml + tests/client/qmltest.cpp +Copyright: 2012, Canonical Ltd. + 2021, UBports Foundation +License: LGPL-3 + +Files: libqmenumodel/src/logging.h +Copyright: 2016, Canonical, Ltd. +License: LGPL-3 + Files: debian/* Copyright: 2012-2016, Canonical Ltd. 2020, Mike Gabriel diff -Nru qmenumodel-0.9.0/debian/copyright.in qmenumodel-0.9.1/debian/copyright.in --- qmenumodel-0.9.0/debian/copyright.in 2021-12-15 22:11:42.000000000 +0000 +++ qmenumodel-0.9.1/debian/copyright.in 2022-02-08 20:35:36.000000000 +0000 @@ -12,15 +12,11 @@ libqmenumodel/QMenuModel/plugin.h libqmenumodel/src/actionstateparser.cpp libqmenumodel/src/actionstateparser.h - libqmenumodel/src/ayatanamenuaction.cpp libqmenumodel/src/ayatanamenuaction.h libqmenumodel/src/ayatanamenuactionevents.cpp libqmenumodel/src/ayatanamenuactionevents.h - libqmenumodel/src/ayatanamenumodel.cpp libqmenumodel/src/ayatanamenumodel.h - libqmenumodel/src/ayatanamenumodelevents.cpp libqmenumodel/src/ayatanamenumodelevents.h - libqmenumodel/src/converter.cpp libqmenumodel/src/converter.h libqmenumodel/src/dbus-enums.h libqmenumodel/src/menunode.cpp @@ -37,16 +33,12 @@ libqmenumodel/src/qmenumodelevents.h libqmenumodel/src/qstateaction.cpp libqmenumodel/src/qstateaction.h - tests/client/actiongrouptest.cpp tests/client/ayatanamenuactiontest.cpp tests/client/cachetest.cpp tests/client/convertertest.cpp - tests/client/loadmodel.qml - tests/client/loadmodel2.qml tests/client/menuchangestest.cpp tests/client/modelsignalstest.cpp tests/client/modeltest.cpp - tests/client/qmltest.cpp tests/client/script_actiongrouptest.py tests/client/script_menuchangestest.py tests/client/script_modeltest.py @@ -55,7 +47,6 @@ tests/client/servicetest.cpp tests/client/treetest.cpp tests/script/dbusmenuscript.cpp - tests/script/dbusmenuscript.h tests/script/menuscript.py Copyright: 2012, Canonical Ltd. 2012-2016, Canonical Ltd. @@ -118,8 +109,24 @@ FIXME Files: libqmenumodel/QMenuModel/plugin.cpp + libqmenumodel/src/ayatanamenuaction.cpp + libqmenumodel/src/ayatanamenumodel.cpp + libqmenumodel/src/ayatanamenumodelevents.cpp + libqmenumodel/src/converter.cpp + tests/client/actiongrouptest.cpp + tests/script/dbusmenuscript.h Copyright: 2012, Canonical Ltd. + 2012-2016, Canonical Ltd. + 2013, Canonical Ltd. 2021, Robert Tari + 2022, Robert Tari +License: GNU Lesser General Public License, Version 3 + FIXME + +Files: tests/client/importtest.qml + tests/client/qmltest.cpp +Copyright: 2012, Canonical Ltd. + 2021, UBports Foundation License: GNU Lesser General Public License, Version 3 FIXME diff -Nru qmenumodel-0.9.0/examples/ayatanaqmlmenumodel.qml qmenumodel-0.9.1/examples/ayatanaqmlmenumodel.qml --- qmenumodel-0.9.0/examples/ayatanaqmlmenumodel.qml 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/examples/ayatanaqmlmenumodel.qml 2022-02-08 15:54:02.000000000 +0000 @@ -17,7 +17,7 @@ */ import QtQuick 2.0 -import QMenuModel 0.1 +import QMenuModel 1.0 Item { width: 400; diff -Nru qmenumodel-0.9.0/examples/render-menumodel.qml qmenumodel-0.9.1/examples/render-menumodel.qml --- qmenumodel-0.9.0/examples/render-menumodel.qml 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/examples/render-menumodel.qml 2022-02-08 15:54:02.000000000 +0000 @@ -22,7 +22,7 @@ // /org/ayatana/testmenu. import QtQuick 2.0 -import QMenuModel 0.1 +import QMenuModel 1.0 Item { id: container @@ -162,4 +162,3 @@ Component.onCompleted: menuModel.start() } - diff -Nru qmenumodel-0.9.0/libqmenumodel/QMenuModel/plugin.cpp qmenumodel-0.9.1/libqmenumodel/QMenuModel/plugin.cpp --- qmenumodel-0.9.0/libqmenumodel/QMenuModel/plugin.cpp 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/libqmenumodel/QMenuModel/plugin.cpp 2022-02-08 15:54:02.000000000 +0000 @@ -44,6 +44,6 @@ qmlRegisterType(uri, 1, 0, "QDBusMenuModel"); qmlRegisterType(uri, 1, 0, "QDBusActionGroup"); - qmlRegisterType(uri, 1, 0, "AyatanaMenuAction"); + qmlRegisterType(uri, 1, 0, "AyatanaMenuModel"); qmlRegisterType(uri, 1, 0, "AyatanaMenuAction"); } diff -Nru qmenumodel-0.9.0/libqmenumodel/src/ayatanamenuaction.cpp qmenumodel-0.9.1/libqmenumodel/src/ayatanamenuaction.cpp --- qmenumodel-0.9.0/libqmenumodel/src/ayatanamenuaction.cpp 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/libqmenumodel/src/ayatanamenuaction.cpp 2022-02-08 15:54:02.000000000 +0000 @@ -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 . * - * Authors: Nick Dedekind + * Authors: + * Nick Dedekind + * Robert Tari */ #include "ayatanamenuaction.h" @@ -148,8 +151,6 @@ setState(umasce->state); return true; } else if (e->type() == AyatanaMenuActionRemoveEvent::eventType) { - AyatanaMenuActionRemoveEvent *umare = static_cast(e); - setValid(false); return true; } diff -Nru qmenumodel-0.9.0/libqmenumodel/src/ayatanamenumodel.cpp qmenumodel-0.9.1/libqmenumodel/src/ayatanamenumodel.cpp --- qmenumodel-0.9.0/libqmenumodel/src/ayatanamenumodel.cpp 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/libqmenumodel/src/ayatanamenumodel.cpp 2022-02-08 15:54:02.000000000 +0000 @@ -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 . * - * Authors: Lars Uebernickel + * Authors: + * Lars Uebernickel + * Robert Tari */ #include "ayatanamenumodel.h" @@ -270,12 +273,10 @@ { 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); @@ -682,7 +683,7 @@ extendedAttrs->insert(qtify_name (name.toUtf8()), qvalue); else qCWarning(ayatanamenumodel, "loadExtendedAttributes: key '%s' is of type '%s' (expected '%s')", - name.toUtf8().constData(), g_variant_get_type_string(value), type.constData()); + name.toUtf8().constData(), g_variant_get_type_string(value), type.toUtf8().constData()); g_variant_unref (value); } @@ -928,7 +929,6 @@ GSequenceIter *iter; QByteArray bytes; const gchar *name; - gchar *full_name = NULL; bytes = action->name().toUtf8(); name = bytes.constData(); diff -Nru qmenumodel-0.9.0/libqmenumodel/src/ayatanamenumodelevents.cpp qmenumodel-0.9.1/libqmenumodel/src/ayatanamenumodelevents.cpp --- qmenumodel-0.9.0/libqmenumodel/src/ayatanamenumodelevents.cpp 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/libqmenumodel/src/ayatanamenumodelevents.cpp 2022-02-08 15:54:02.000000000 +0000 @@ -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 */ #include @@ -39,7 +41,7 @@ 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() { 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 -Nru qmenumodel-0.9.0/libqmenumodel/src/converter.cpp qmenumodel-0.9.1/libqmenumodel/src/converter.cpp --- qmenumodel-0.9.0/libqmenumodel/src/converter.cpp 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/libqmenumodel/src/converter.cpp 2022-02-08 15:54:02.000000000 +0000 @@ -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 * Marco Trevisan + * Robert Tari */ #include @@ -164,29 +166,29 @@ 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 @@ case QMetaType::ULong: result = g_variant_new_uint64(value.value()); break; - case QVariant::Map: + case QMetaType::QVariantMap: { GVariantBuilder *b; - GVariant *dict; b = g_variant_builder_new(G_VARIANT_TYPE_VARDICT); QMapIterator i(value.toMap()); @@ -231,7 +232,7 @@ 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 @@ g_variant_builder_unref(b); break; } - case QVariant::StringList: + case QMetaType::QStringList: { GVariantBuilder *b = g_variant_builder_new(G_VARIANT_TYPE_STRING_ARRAY); diff -Nru qmenumodel-0.9.0/NEWS qmenumodel-0.9.1/NEWS --- qmenumodel-0.9.0/NEWS 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/NEWS 2022-02-08 15:54:02.000000000 +0000 @@ -1,3 +1,12 @@ +Overview of changes in ayatana-indicator-session 0.9.1 + + * CMakeLists.txt: Rewrite and enable Ayatana-style options. + * Fix naming of AyatanaMenuModel qml type. + * Fix versioning in examples and tests. + * Make the qmltests test imports, at least. + * Fix all build warnings. + * CMakeLists.txt: Clean up compilation flags. + Overview of changes in ayatana-indicator-session 0.9.0 * Rename Unity* symbols. diff -Nru qmenumodel-0.9.0/tests/client/actiongrouptest.cpp qmenumodel-0.9.1/tests/client/actiongrouptest.cpp --- qmenumodel-0.9.0/tests/client/actiongrouptest.cpp 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/tests/client/actiongrouptest.cpp 2022-02-08 15:54:02.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright 2012 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: * Renato Araujo Oliveira Filho + * Robert Tari */ #include "qdbusmenumodel.h" @@ -138,7 +140,7 @@ void testActionName() { - QStateAction *act; + QStateAction *act = nullptr; getMenuAction(&act, 1); QCOMPARE(act->property("name").toString(), QString("Menu1Act")); } @@ -148,7 +150,7 @@ */ void testStringActionActivation() { - QStateAction *act; + QStateAction *act = nullptr; getMenuAction(&act, 1); act->activate(QVariant("42")); @@ -162,7 +164,7 @@ void testStringActionActivationByVariantString() { - QStateAction *act; + QStateAction *act = nullptr; getMenuAction(&act, 1); act->activateByVariantString("\"53\""); diff -Nru qmenumodel-0.9.0/tests/client/importtest.qml qmenumodel-0.9.1/tests/client/importtest.qml --- qmenumodel-0.9.0/tests/client/importtest.qml 1970-01-01 00:00:00.000000000 +0000 +++ qmenumodel-0.9.1/tests/client/importtest.qml 2022-02-08 15:54:02.000000000 +0000 @@ -0,0 +1,26 @@ +/* + * Copyright 2012 Canonical Ltd. + * Copyright 2021 UBports Foundation + * + * 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 + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + * Authors: + * Renato Araujo Oliveira Filho + * Dalton Durst + */ + +import QtQuick 2.0 +import QMenuModel 1.0 + +Item { +} diff -Nru qmenumodel-0.9.0/tests/client/loadmodel2.qml qmenumodel-0.9.1/tests/client/loadmodel2.qml --- qmenumodel-0.9.0/tests/client/loadmodel2.qml 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/tests/client/loadmodel2.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright 2012 Canonical Ltd. - * - * 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 - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Authors: - * Renato Araujo Oliveira Filho - */ - -import QtQuick 2.0 -import QMenuModel 0.1 - -Item { - width: 100 - height: 100 - - QDBusMenuModel { - id: menuModel - busType: globalBusType - busName: globalBusName - objectPath: globalObjectPath - } - - ListView { - model: menuModel - delegate: Item {} - } - - Component.onCompleted: menuModel.start() -} - diff -Nru qmenumodel-0.9.0/tests/client/loadmodel.qml qmenumodel-0.9.1/tests/client/loadmodel.qml --- qmenumodel-0.9.0/tests/client/loadmodel.qml 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/tests/client/loadmodel.qml 1970-01-01 00:00:00.000000000 +0000 @@ -1,52 +0,0 @@ -/* - * Copyright 2012 Canonical Ltd. - * - * 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 - * the Free Software Foundation; version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Authors: - * Renato Araujo Oliveira Filho - */ - -import QtQuick 2.0 -import QMenuModel 0.1 - -Item { - id: root - width: 100 - height: 100 - - property bool reset: resetModel - - onResetChanged: { - if (reset) { - // destroy the current model and check if it will not crash the QML engine - view.model.destroy(); - } - } - - ListView { - id: view - anchors.fill: parent - delegate: Text { - text: label - } - } - - Component.onCompleted: { - // dynamically create the model to destroy it later - var model = Qt.createQmlObject("import QMenuModel 0.1; QDBusMenuModel { id: menuModel; busType: globalBusType; busName: globalBusName; objectPath: globalObjectPath; }", view, ""); - model.start(); - view.model = model; - } -} - diff -Nru qmenumodel-0.9.0/tests/client/qmlfiles.h.in qmenumodel-0.9.1/tests/client/qmlfiles.h.in --- qmenumodel-0.9.0/tests/client/qmlfiles.h.in 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/tests/client/qmlfiles.h.in 2022-02-08 15:54:02.000000000 +0000 @@ -1,3 +1,4 @@ -const char* QML_BASE_DIR = "@libqmenumodel_BINARY_DIR@"; -const char* LOADMODEL_QML = "@CMAKE_CURRENT_SOURCE_DIR@/loadmodel.qml"; -const char* LOADMODEL2_QML = "@CMAKE_CURRENT_SOURCE_DIR@/loadmodel2.qml"; +#include + +const QString QML_BASE_DIR = QStringLiteral("@libqmenumodel_BINARY_DIR@"); +const QString IMPORTTEST_QML = QStringLiteral("@CMAKE_CURRENT_SOURCE_DIR@/importtest.qml"); diff -Nru qmenumodel-0.9.0/tests/client/qmltest.cpp qmenumodel-0.9.1/tests/client/qmltest.cpp --- qmenumodel-0.9.0/tests/client/qmltest.cpp 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/tests/client/qmltest.cpp 2022-02-08 15:54:02.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright 2012 Canonical Ltd. + * Copyright 2021 UBports Foundation * * 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,8 +16,11 @@ * * Authors: * Renato Araujo Oliveira Filho + * Dalton Durst */ +#include + #include #include "qdbusmenumodel.h" @@ -27,6 +31,7 @@ #include #include #include +#include #include #include @@ -38,6 +43,13 @@ Q_OBJECT private: DBusMenuScript m_script; + std::shared_ptr loadView(const QString baseDir, const QString fileLocation) + { + std::shared_ptr view = std::make_shared(); + view->engine()->addImportPath(baseDir); + view->setSource(QUrl::fromLocalFile(fileLocation)); + return view; + } private Q_SLOTS: void initTestCase() @@ -60,53 +72,12 @@ } /* - * Test if model is destroyed without crash - */ - void destroyModel() - { - m_script.publishMenu(); - m_script.run(); - QTest::qWait(500); - - QQuickView *view = new QQuickView; - view->engine()->addImportPath(QML_BASE_DIR); - view->engine()->rootContext()->setContextProperty("resetModel", QVariant(false)); - view->engine()->rootContext()->setContextProperty("globalBusType", DBusEnums::SessionBus); - view->engine()->rootContext()->setContextProperty("globalBusName", MENU_SERVICE_NAME); - view->engine()->rootContext()->setContextProperty("globalObjectPath", MENU_OBJECT_PATH); - view->setSource(QUrl::fromLocalFile(LOADMODEL_QML)); - QTest::qWait(500); - view->engine()->rootContext()->setContextProperty("resetModel", true); - QTest::qWait(500); - } - - /* - * Test the menu model disappearing from the bus and reappearing - * while the QML application is running. + * Test if importtest.qml can be loaded successfully */ - void testServiceDisappear() + void importtest() { - m_script.publishMenu(); - m_script.run(); - QTest::qWait(500); - - QQuickView *view = new QQuickView; - view->engine()->addImportPath(QML_BASE_DIR); - view->engine()->rootContext()->setContextProperty("globalBusType", DBusEnums::SessionBus); - view->engine()->rootContext()->setContextProperty("globalBusName", MENU_SERVICE_NAME); - view->engine()->rootContext()->setContextProperty("globalObjectPath", MENU_OBJECT_PATH); - view->setSource(QUrl::fromLocalFile(LOADMODEL2_QML)); - QTest::qWait(500); - - m_script.unpublishMenu(); - QTest::qWait(500); - - m_script.publishMenu(); - m_script.run(); - QTest::qWait(500); - - delete view; - QTest::qWait(1000); + std::shared_ptr view = loadView(QML_BASE_DIR, IMPORTTEST_QML); + QTRY_VERIFY2((view->status() == QQuickView::Ready), "loadmodel.qml view never became ready"); } }; diff -Nru qmenumodel-0.9.0/tests/script/dbusmenuscript.h qmenumodel-0.9.1/tests/script/dbusmenuscript.h --- qmenumodel-0.9.0/tests/script/dbusmenuscript.h 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/tests/script/dbusmenuscript.h 2022-02-08 15:54:02.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright 2012 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,10 +16,11 @@ * * Authors: * Renato Araujo Oliveira Filho + * Robert Tari */ #ifndef DBUSMENUSCRIPT_H -#define DBUSMENUSCRITP_H +#define DBUSMENUSCRIPT_H #include #include diff -Nru qmenumodel-0.9.0/.travis.yml qmenumodel-0.9.1/.travis.yml --- qmenumodel-0.9.0/.travis.yml 2021-12-14 20:42:14.000000000 +0000 +++ qmenumodel-0.9.1/.travis.yml 2022-02-08 15:54:02.000000000 +0000 @@ -1,11 +1,11 @@ # vim: set ts=2 sts=2 sw=2 expandtab : -dist: bionic +dist: focal language: shell os: linux arch: - amd64 - - ppc64le +# - ppc64le services: - docker