[gnote] Refactor to use struct from new files



commit f037c69ba6fcd5f70d4c315fa284497b7e334556
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Mar 30 19:00:54 2019 +0200

    Refactor to use struct from new files

 src/iactionmanager.hpp    | 30 +-----------------------------
 src/searchnoteswidget.cpp |  2 +-
 2 files changed, 2 insertions(+), 30 deletions(-)
---
diff --git a/src/iactionmanager.hpp b/src/iactionmanager.hpp
index 35832351..0c50090a 100644
--- a/src/iactionmanager.hpp
+++ b/src/iactionmanager.hpp
@@ -26,6 +26,7 @@
 #include <gtkmm/uimanager.h>
 
 #include "base/singleton.hpp"
+#include "popoverwidgets.hpp"
 
 namespace gnote {
 
@@ -54,35 +55,6 @@ public:
   static const int APP_ACTION_LAST;
   static const int APP_CUSTOM_SECTION;
 
-  struct PopoverWidget
-  {
-    Gtk::Widget *widget;
-    int section;
-    int order;
-    int secondary_order;
-
-    PopoverWidget(int ord, Gtk::Widget *w)
-      : widget(w)
-      , section(APP_ACTION_MANAGE)
-      , order(ord)
-      {}
-
-    PopoverWidget(int sec, int ord, Gtk::Widget *w)
-      : widget(w)
-      , section(sec)
-      , order(ord)
-      {}
-
-    bool operator< (const PopoverWidget & other)
-      {
-        if(section != other.section)
-          return section < other.section;
-        if(order != other.order)
-          return order < other.order;
-        return secondary_order < other.secondary_order;
-      }
-  };
-
   virtual ~IActionManager();
 
   virtual Glib::RefPtr<Gio::SimpleAction> get_app_action(const Glib::ustring & name) const = 0;
diff --git a/src/searchnoteswidget.cpp b/src/searchnoteswidget.cpp
index bf00931b..ced9d848 100644
--- a/src/searchnoteswidget.cpp
+++ b/src/searchnoteswidget.cpp
@@ -1435,7 +1435,7 @@ void SearchNotesWidget::size_internals()
 
 std::vector<Gtk::Widget*> SearchNotesWidget::get_popover_widgets()
 {
-  std::vector<IActionManager::PopoverWidget> popover_widgets;
+  std::vector<PopoverWidget> popover_widgets;
   popover_widgets.reserve(20);
   IActionManager::obj().signal_build_main_window_search_popover(popover_widgets);
   for(unsigned i = 0; i < popover_widgets.size(); ++i) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]