diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-12-22 13:11:32 +0000 |
---|---|---|
committer | Robert Tari <robert@tari.in> | 2021-01-12 14:19:54 +0100 |
commit | d0a386078f471633250a760cdcd1a21a63d0dd06 (patch) | |
tree | 24ac3f4a5bdf4ce6a67be4bf45da6bf5cb576cd6 | |
parent | 26073182645da0a7ba7214b331c725fab1506253 (diff) | |
download | ayatana-indicator-sound-d0a386078f471633250a760cdcd1a21a63d0dd06.tar.gz ayatana-indicator-sound-d0a386078f471633250a760cdcd1a21a63d0dd06.tar.bz2 ayatana-indicator-sound-d0a386078f471633250a760cdcd1a21a63d0dd06.zip |
Port from Unity8 to Lomiri (URL Dispatcher and API).
18 files changed, 57 insertions, 57 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 424e44e..76512a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,11 +30,11 @@ pkg_check_modules( ) include_directories(${PULSEAUDIO_INCLUDE_DIRS}) -set(URL_DISPATCHER_1_REQUIRED_VERSION 1) +set(URL_DISPATCHER_REQUIRED_VERSION 0) pkg_check_modules( URLDISPATCHER - url-dispatcher-1>=${URL_DISPATCHER_1_REQUIRED_VERSION} + lomiri-url-dispatcher>=${URL_DISPATCHER_REQUIRED_VERSION} ) include_directories(${URLDISPATCHER_INCLUDE_DIRS}) @@ -50,7 +50,7 @@ pkg_check_modules( ) include_directories(${SOUNDSERVICE_INCLUDE_DIRS}) -pkg_check_modules(UNITY_API libunity-api>=0.1.3) +pkg_check_modules(UNITY_API liblomiri-api>=0.1.1) include_directories(${TEST_INCLUDE_DIRS}) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index b70ae87..9947766 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -1,3 +1,3 @@ -if(UNITY_API_FOUND) -add_subdirectory(unity) -endif()
\ No newline at end of file +if(LOMIRI_API_FOUND) +add_subdirectory(lomiri) +endif() diff --git a/include/unity/CMakeLists.txt b/include/lomiri/CMakeLists.txt index ef57b9e..ef57b9e 100644 --- a/include/unity/CMakeLists.txt +++ b/include/lomiri/CMakeLists.txt diff --git a/include/unity/gmenuharness/MatchResult.h b/include/lomiri/gmenuharness/MatchResult.h index 8503a98..c545dbf 100644 --- a/include/unity/gmenuharness/MatchResult.h +++ b/include/lomiri/gmenuharness/MatchResult.h @@ -22,7 +22,7 @@ #include <memory> #include <string> -namespace unity +namespace lomiri { namespace gmenuharness @@ -63,4 +63,4 @@ protected: } // namespace gmenuharness -} // namespace unity +} // namespace lomiri diff --git a/include/unity/gmenuharness/MatchUtils.h b/include/lomiri/gmenuharness/MatchUtils.h index 899e506..3b20ab7 100644 --- a/include/unity/gmenuharness/MatchUtils.h +++ b/include/lomiri/gmenuharness/MatchUtils.h @@ -23,7 +23,7 @@ #include <gio/gio.h> -namespace unity +namespace lomiri { namespace gmenuharness @@ -39,4 +39,4 @@ void gvariant_deleter(GVariant* varptr); } //namespace gmenuharness -} // namespace unity +} // namespace lomiri diff --git a/include/unity/gmenuharness/MenuItemMatcher.h b/include/lomiri/gmenuharness/MenuItemMatcher.h index 38a5187..312f657 100644 --- a/include/unity/gmenuharness/MenuItemMatcher.h +++ b/include/lomiri/gmenuharness/MenuItemMatcher.h @@ -24,7 +24,7 @@ #include <gio/gio.h> -namespace unity +namespace lomiri { namespace gmenuharness @@ -140,4 +140,4 @@ protected: } // namespace gmenuharness -} // namespace unity +} // namespace lomiri diff --git a/include/unity/gmenuharness/MenuMatcher.h b/include/lomiri/gmenuharness/MenuMatcher.h index c2eb65e..023ca42 100644 --- a/include/unity/gmenuharness/MenuMatcher.h +++ b/include/lomiri/gmenuharness/MenuMatcher.h @@ -25,13 +25,13 @@ do {\ GTEST_NONFATAL_FAILURE_) << result.concat_failures().c_str(); \ } while (0) -#include <unity/gmenuharness/MatchResult.h> -#include <unity/gmenuharness/MenuItemMatcher.h> +#include <lomiri/gmenuharness/MatchResult.h> +#include <lomiri/gmenuharness/MenuItemMatcher.h> #include <memory> #include <vector> -namespace unity +namespace lomiri { namespace gmenuharness @@ -92,4 +92,4 @@ protected: } // gmenuharness -} // unity +} // lomiri diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2a06187..3630753 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,7 @@ set(VAPI_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.vapi") if(URLDISPATCHER_FOUND) set (VALA_DEFINE_URLDISPATCHER "--define=HAS_URLDISPATCHER") - set (VALA_PKG_URLDISPATCHER "url-dispatcher") + set (VALA_PKG_URLDISPATCHER "lomiri-url-dispatcher") endif() if(EXISTS "/usr/share/glib-2.0/schemas/com.ubuntu.sound.gschema.xml") diff --git a/src/gmenuharness/MatchResult.cpp b/src/gmenuharness/MatchResult.cpp index 40629aa..4543ce9 100644 --- a/src/gmenuharness/MatchResult.cpp +++ b/src/gmenuharness/MatchResult.cpp @@ -16,7 +16,7 @@ * Authored by: Pete Woods <pete.woods@canonical.com> */ -#include <unity/gmenuharness/MatchResult.h> +#include <lomiri/gmenuharness/MatchResult.h> #include <chrono> #include <map> @@ -25,7 +25,7 @@ using namespace std; -namespace unity +namespace lomiri { namespace gmenuharness @@ -184,4 +184,4 @@ string MatchResult::concat_failures() const } // namespace gmenuharness -} // namespace unity +} // namespace lomiri diff --git a/src/gmenuharness/MatchUtils.cpp b/src/gmenuharness/MatchUtils.cpp index c6b2ae3..89c7798 100644 --- a/src/gmenuharness/MatchUtils.cpp +++ b/src/gmenuharness/MatchUtils.cpp @@ -16,16 +16,16 @@ * Authored by: Pete Woods <pete.woods@canonical.com> */ -#include <unity/gmenuharness/MatchUtils.h> +#include <lomiri/gmenuharness/MatchUtils.h> #include <functional> -#include <unity/util/ResourcePtr.h> +#include <lomiri/util/ResourcePtr.h> using namespace std; -namespace util = unity::util; +namespace util = lomiri::util; -namespace unity +namespace lomiri { namespace gmenuharness @@ -76,4 +76,4 @@ void gvariant_deleter(GVariant* varptr) } // namespace gmenuharness -} // namespace unity +} // namespace lomiri diff --git a/src/gmenuharness/MenuItemMatcher.cpp b/src/gmenuharness/MenuItemMatcher.cpp index f2d5fe8..8048556 100644 --- a/src/gmenuharness/MenuItemMatcher.cpp +++ b/src/gmenuharness/MenuItemMatcher.cpp @@ -16,9 +16,9 @@ * Authored by: Pete Woods <pete.woods@canonical.com> */ -#include <unity/gmenuharness/MatchResult.h> -#include <unity/gmenuharness/MatchUtils.h> -#include <unity/gmenuharness/MenuItemMatcher.h> +#include <lomiri/gmenuharness/MatchResult.h> +#include <lomiri/gmenuharness/MatchUtils.h> +#include <lomiri/gmenuharness/MenuItemMatcher.h> #include <iostream> #include <vector> @@ -26,7 +26,7 @@ using namespace std; -namespace unity +namespace lomiri { namespace gmenuharness @@ -1005,4 +1005,4 @@ void MenuItemMatcher::match( } // namepsace gmenuharness -} // namespace unity +} // namespace lomiri diff --git a/src/gmenuharness/MenuMatcher.cpp b/src/gmenuharness/MenuMatcher.cpp index 5bb4fbd..7fd257d 100644 --- a/src/gmenuharness/MenuMatcher.cpp +++ b/src/gmenuharness/MenuMatcher.cpp @@ -16,8 +16,8 @@ * Authored by: Pete Woods <pete.woods@canonical.com> */ -#include <unity/gmenuharness/MenuMatcher.h> -#include <unity/gmenuharness/MatchUtils.h> +#include <lomiri/gmenuharness/MenuMatcher.h> +#include <lomiri/gmenuharness/MatchUtils.h> #include <iostream> @@ -25,7 +25,7 @@ using namespace std; -namespace unity +namespace lomiri { namespace gmenuharness @@ -205,4 +205,4 @@ MatchResult MenuMatcher::match() const } // namespace gmenuharness -} // namespace unity +} // namespace lomiri diff --git a/src/service.vala b/src/service.vala index 4c9579a..cf79666 100644 --- a/src/service.vala +++ b/src/service.vala @@ -259,7 +259,7 @@ public class IndicatorSound.Service: Object { #if HAS_URLDISPATCHER if (Environment.get_variable ("MIR_SOCKET") != null) { - UrlDispatch.send ("settings:///system/sound"); + LomiriURLDispatch.send ("settings:///system/sound"); return; } #endif @@ -282,7 +282,7 @@ public class IndicatorSound.Service: Object { #if HAS_URLDISPATCHER void activate_phone_settings (SimpleAction action, Variant? param) { - UrlDispatch.send ("settings:///system/sound"); + LomiriURLDispatch.send ("settings:///system/sound"); } #endif diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp index b7a0a77..e8eeefc 100644 --- a/tests/integration/indicator-sound-test-base.cpp +++ b/tests/integration/indicator-sound-test-base.cpp @@ -36,7 +36,7 @@ using namespace QtDBusTest; using namespace QtDBusMock; using namespace std; using namespace testing; -namespace mh = unity::gmenuharness; +namespace mh = lomiri::gmenuharness; namespace { @@ -410,7 +410,7 @@ mh::MenuMatcher::Parameters IndicatorSoundTestBase::phoneParameters() "/org/ayatana/indicator/sound/phone"); } -unity::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::volumeSlider(double volume, QString const &label) +lomiri::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::volumeSlider(double volume, QString const &label) { return mh::MenuItemMatcher().radio() .label(label.toStdString()) @@ -425,7 +425,7 @@ unity::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::volumeSlider(double .pass_through_double_attribute("action", volume); } -unity::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::micSlider(double volume, QString const &label) +lomiri::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::micSlider(double volume, QString const &label) { return mh::MenuItemMatcher() .label(label.toStdString()) @@ -439,7 +439,7 @@ unity::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::micSlider(double vo .pass_through_double_attribute("action", volume); } -unity::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::silentModeSwitch(bool toggled) +lomiri::gmenuharness::MenuItemMatcher IndicatorSoundTestBase::silentModeSwitch(bool toggled) { return mh::MenuItemMatcher::checkbox() .label("Silent Mode") diff --git a/tests/integration/indicator-sound-test-base.h b/tests/integration/indicator-sound-test-base.h index 7942bd5..4e0d2dd 100644 --- a/tests/integration/indicator-sound-test-base.h +++ b/tests/integration/indicator-sound-test-base.h @@ -22,8 +22,8 @@ #include <libqtdbustest/QProcessDBusService.h> #include <libqtdbusmock/DBusMock.h> -#include <unity/gmenuharness/MatchUtils.h> -#include <unity/gmenuharness/MenuMatcher.h> +#include <lomiri/gmenuharness/MatchUtils.h> +#include <lomiri/gmenuharness/MenuMatcher.h> #include <gmock/gmock.h> #include <gtest/gtest.h> @@ -96,15 +96,15 @@ protected: static std::shared_ptr<GVariant> volume_variant(double volume); - static unity::gmenuharness::MenuMatcher::Parameters desktopParameters(); + static lomiri::gmenuharness::MenuMatcher::Parameters desktopParameters(); - static unity::gmenuharness::MenuMatcher::Parameters phoneParameters(); + static lomiri::gmenuharness::MenuMatcher::Parameters phoneParameters(); - static unity::gmenuharness::MenuItemMatcher volumeSlider(double volume, QString const &label); + static lomiri::gmenuharness::MenuItemMatcher volumeSlider(double volume, QString const &label); - static unity::gmenuharness::MenuItemMatcher micSlider(double volume, QString const &label); + static lomiri::gmenuharness::MenuItemMatcher micSlider(double volume, QString const &label); - static unity::gmenuharness::MenuItemMatcher silentModeSwitch(bool toggled); + static lomiri::gmenuharness::MenuItemMatcher silentModeSwitch(bool toggled); bool waitMenuChange(); diff --git a/tests/integration/test-indicator.cpp b/tests/integration/test-indicator.cpp index 36b299e..43ed2b9 100644 --- a/tests/integration/test-indicator.cpp +++ b/tests/integration/test-indicator.cpp @@ -24,7 +24,7 @@ using namespace std; using namespace testing; -namespace mh = unity::gmenuharness; +namespace mh = lomiri::gmenuharness; namespace { diff --git a/vapi/lomiri-url-dispatcher.vapi b/vapi/lomiri-url-dispatcher.vapi new file mode 100644 index 0000000..1285b12 --- /dev/null +++ b/vapi/lomiri-url-dispatcher.vapi @@ -0,0 +1,9 @@ +[CCode (cprefix="", lower_case_cprefix="", cheader_filename="liblomiri-url-dispatcher/lomiri-url-dispatcher.h")] + +namespace LomiriURLDispatch +{ + public delegate void LomiriURLDispatchCallback (); + + [CCode (cname = "lomiri_url_dispatch_send")] + public static void send (string url, LomiriURLDispatchCallback? func = null); +} diff --git a/vapi/url-dispatcher.vapi b/vapi/url-dispatcher.vapi deleted file mode 100644 index 88f7740..0000000 --- a/vapi/url-dispatcher.vapi +++ /dev/null @@ -1,9 +0,0 @@ -[CCode (cprefix="", lower_case_cprefix="", cheader_filename="liburl-dispatcher-1/url-dispatcher.h")] - -namespace UrlDispatch -{ - public delegate void DispatchCallback (); - - [CCode (cname = "url_dispatch_send")] - public static void send (string url, DispatchCallback? func = null); -} |