[gnote] Make add_app_action return the created action
- From: Aurimas Černius <aurimasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnote] Make add_app_action return the created action
- Date: Sun, 24 Feb 2013 17:00:01 +0000 (UTC)
commit 46d5607ffc6f24250a9a2bd13ba42e8c7d04615b
Author: Aurimas Černius <aurisc4 gmail com>
Date: Sun Feb 24 17:13:59 2013 +0200
Make add_app_action return the created action
src/actionmanager.cpp | 6 ++++--
src/actionmanager.hpp | 2 +-
src/iactionmanager.hpp | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp
index c36b543..fd8fd08 100644
--- a/src/actionmanager.cpp
+++ b/src/actionmanager.cpp
@@ -239,9 +239,11 @@ namespace gnote {
return Glib::RefPtr<Gio::SimpleAction>();
}
- void ActionManager::add_app_action(const std::string & name)
+ Glib::RefPtr<Gio::SimpleAction> ActionManager::add_app_action(const std::string & name)
{
- m_app_actions.push_back(Gio::SimpleAction::create(name));
+ Glib::RefPtr<Gio::SimpleAction> action = Gio::SimpleAction::create(name);
+ m_app_actions.push_back(action);
+ return action;
}
void ActionManager::add_app_menu_item(int section, int order, const std::string & label,
diff --git a/src/actionmanager.hpp b/src/actionmanager.hpp
index 4f67437..de35e14 100644
--- a/src/actionmanager.hpp
+++ b/src/actionmanager.hpp
@@ -63,7 +63,7 @@ public:
{
return m_app_actions;
}
- virtual void add_app_action(const std::string & name);
+ virtual Glib::RefPtr<Gio::SimpleAction> add_app_action(const std::string & name);
virtual void add_app_menu_item(int section, int order, const std::string & label,
const std::string & action_def);
Glib::RefPtr<Gio::Menu> get_app_menu() const;
diff --git a/src/iactionmanager.hpp b/src/iactionmanager.hpp
index 024d535..772b3bd 100644
--- a/src/iactionmanager.hpp
+++ b/src/iactionmanager.hpp
@@ -43,7 +43,7 @@ public:
virtual Glib::RefPtr<Gtk::Action> operator[](const std::string & n) const = 0;
virtual Glib::RefPtr<Gio::SimpleAction> get_app_action(const std::string & name) const = 0;
- virtual void add_app_action(const std::string & name) = 0;
+ virtual Glib::RefPtr<Gio::SimpleAction> add_app_action(const std::string & name) = 0;
virtual void add_app_menu_item(int section, int order, const std::string & label,
const std::string & action_def) = 0;
virtual const Glib::RefPtr<Gtk::UIManager> & get_ui() = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]