[gnote] Make window parameter required not NULL in show_help



commit dea5ac399f69323a356577ed3add11350101b458
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun Jul 23 13:13:18 2017 +0300

    Make window parameter required not NULL in show_help

 .../tableofcontents/tableofcontentsnoteaddin.cpp   |    2 +-
 src/gnote.cpp                                      |    2 +-
 src/notewindow.cpp                                 |    2 +-
 src/recentchanges.cpp                              |    2 +-
 src/utils.cpp                                      |    6 +++---
 src/utils.hpp                                      |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp 
b/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp
index d970061..cf8e053 100644
--- a/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp
+++ b/src/addins/tableofcontents/tableofcontentsnoteaddin.cpp
@@ -381,7 +381,7 @@ void TableofcontentsNoteAddin::on_toc_help_activated()
 {
   gnote::NoteWindow* window = get_window();
   gnote::utils::show_help("gnote", "addin-tableofcontents",
-    dynamic_cast<Gtk::Window*>(window->host()));
+    *dynamic_cast<Gtk::Window*>(window->host()));
 }
 
 
diff --git a/src/gnote.cpp b/src/gnote.cpp
index 9921455..234f7a7 100644
--- a/src/gnote.cpp
+++ b/src/gnote.cpp
@@ -260,7 +260,7 @@ namespace gnote {
 
   void Gnote::on_show_help_action(const Glib::VariantBase&)
   {
-    utils::show_help("gnote", "", &get_main_window());
+    utils::show_help("gnote", "", get_main_window());
   }
 
   void Gnote::on_show_help_shortcust_action(const Glib::VariantBase&)
diff --git a/src/notewindow.cpp b/src/notewindow.cpp
index 2e117b0..7b71135 100644
--- a/src/notewindow.cpp
+++ b/src/notewindow.cpp
@@ -556,7 +556,7 @@ namespace gnote {
 
   void NoteWindow::open_help_activate()
   {
-    utils::show_help("gnote", "editing-notes", dynamic_cast<Gtk::Window*>(host()));
+    utils::show_help("gnote", "editing-notes", *dynamic_cast<Gtk::Window*>(host()));
   }
 
   void NoteWindow::change_depth_right_handler()
diff --git a/src/recentchanges.cpp b/src/recentchanges.cpp
index 0de45b6..acb2dcc 100644
--- a/src/recentchanges.cpp
+++ b/src/recentchanges.cpp
@@ -432,7 +432,7 @@ namespace gnote {
       }
       break;
     case GDK_KEY_F1:
-      utils::show_help("gnote", "", this);
+      utils::show_help("gnote", "", *this);
       break;
     default:
       break;
diff --git a/src/utils.cpp b/src/utils.cpp
index fceba0f..5206cf5 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -152,7 +152,7 @@ namespace gnote {
     }
 
 
-    void show_help(const Glib::ustring & filename, const Glib::ustring & link_id, Gtk::Window *parent)
+    void show_help(const Glib::ustring & filename, const Glib::ustring & link_id, Gtk::Window & parent)
     {
       // "help:" URIs are "help:document[/page][?query][#frag]"
       // See resolve_help_uri () at,
@@ -163,13 +163,13 @@ namespace gnote {
       }
       GError *error = NULL;
 
-      if(!gtk_show_uri_on_window(parent->gobj(), uri.c_str(), gtk_get_current_event_time (), &error)) {
+      if(!gtk_show_uri_on_window(parent.gobj(), uri.c_str(), gtk_get_current_event_time (), &error)) {
         
         Glib::ustring message = _("The \"Gnote Manual\" could "
                                   "not be found.  Please verify "
                                   "that your installation has been "
                                   "completed successfully.");
-        HIGMessageDialog dialog(parent,
+        HIGMessageDialog dialog(&parent,
                                 GTK_DIALOG_DESTROY_WITH_PARENT,
                                 Gtk::MESSAGE_ERROR,
                                 Gtk::BUTTONS_OK,
diff --git a/src/utils.hpp b/src/utils.hpp
index f69da54..617aeed 100644
--- a/src/utils.hpp
+++ b/src/utils.hpp
@@ -51,7 +51,7 @@ namespace gnote {
 
     void popup_menu(Gtk::Menu &menu, const GdkEventButton *);
 
-    void show_help(const Glib::ustring & filename, const Glib::ustring & link_id, Gtk::Window *parent);
+    void show_help(const Glib::ustring & filename, const Glib::ustring & link_id, Gtk::Window & parent);
     void open_url(Gtk::Window & parent, const Glib::ustring & url);
     void show_opening_location_error(Gtk::Window * parent,
                                      const Glib::ustring & url,


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