[gnote] Move semantic for register_main_window_action
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Move semantic for register_main_window_action
- Date: Sun, 20 Feb 2022 16:37:29 +0000 (UTC)
commit 30f93de83a737539fbf582951043b80b2561d503
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Feb 20 18:30:47 2022 +0200
Move semantic for register_main_window_action
src/actionmanager.cpp | 4 ++--
src/actionmanager.hpp | 3 +--
src/addinmanager.cpp | 4 ++--
src/iactionmanager.hpp | 3 +--
4 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index 54819a3f..8c457a9d 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -132,13 +132,13 @@ namespace gnote {
add_app_menu_item(APP_SECTION_LAST, 200, _("_About Gnote"), "app.about");
}
- void ActionManager::register_main_window_action(const Glib::ustring & action, const Glib::VariantType
*state_type, bool modifying)
+ void ActionManager::register_main_window_action(Glib::ustring && action, const Glib::VariantType
*state_type, bool modifying)
{
if(m_main_window_actions.find(action) == m_main_window_actions.end()) {
- m_main_window_actions[action] = state_type;
if(!modifying) {
m_non_modifying_actions.push_back(action);
}
+ m_main_window_actions.insert(std::make_pair(std::move(action), state_type));
}
else {
if(m_main_window_actions[action] != state_type) {
diff --git a/src/actionmanager.hpp b/src/actionmanager.hpp
index 4f6a2912..f12a9cd2 100644
--- a/src/actionmanager.hpp
+++ b/src/actionmanager.hpp
@@ -45,8 +45,7 @@ public:
}
virtual Glib::RefPtr<Gio::SimpleAction> add_app_action(const Glib::ustring & name) override;
virtual void add_app_menu_item(int section, int order, Glib::ustring && label, Glib::ustring &&
action_def) override;
- virtual void register_main_window_action(const Glib::ustring & action, const Glib::VariantType *state_type,
- bool modifying = true) override;
+ virtual void register_main_window_action(Glib::ustring && action, const Glib::VariantType *state_type,
bool modifying = true) override;
virtual std::map<Glib::ustring, const Glib::VariantType*> get_main_window_actions() const override;
virtual bool is_modifying_main_window_action(const Glib::ustring & action) const override;
diff --git a/src/addinmanager.cpp b/src/addinmanager.cpp
index 48fa0eb4..b75b686c 100644
--- a/src/addinmanager.cpp
+++ b/src/addinmanager.cpp
@@ -1,7 +1,7 @@
/*
* gnote
*
- * Copyright (C) 2010-2017,2019-2021 Aurimas Cernius
+ * Copyright (C) 2010-2017,2019-2022 Aurimas Cernius
* Copyright (C) 2009, 2010 Debarshi Ray
* Copyright (C) 2009 Hubert Figuiere
*
@@ -593,7 +593,7 @@ namespace {
for(auto & info : m_addin_infos) {
auto & non_modifying = info.second.non_modifying_actions();
for(auto & action : info.second.actions()) {
- manager.register_main_window_action(action.first, action.second,
+ manager.register_main_window_action(Glib::ustring(action.first), action.second,
std::find(non_modifying.begin(), non_modifying.end(), action.first) == non_modifying.end());
}
}
diff --git a/src/iactionmanager.hpp b/src/iactionmanager.hpp
index f93f618f..0cf02d73 100644
--- a/src/iactionmanager.hpp
+++ b/src/iactionmanager.hpp
@@ -36,8 +36,7 @@ public:
virtual Glib::RefPtr<Gio::SimpleAction> get_app_action(const Glib::ustring & name) const = 0;
virtual Glib::RefPtr<Gio::SimpleAction> add_app_action(const Glib::ustring & name) = 0;
virtual void add_app_menu_item(int section, int order, Glib::ustring && label, Glib::ustring &&
action_def) = 0;
- virtual void register_main_window_action(const Glib::ustring & action, const Glib::VariantType *state_type,
- bool modifying = true) = 0;
+ virtual void register_main_window_action(Glib::ustring && action, const Glib::VariantType *state_type,
bool modifying = true) = 0;
virtual std::map<Glib::ustring, const Glib::VariantType*> get_main_window_actions() const = 0;
virtual bool is_modifying_main_window_action(const Glib::ustring & action) const = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]