[glom] C++11: BusyCursor: Delegate a constructor instead of sharing init().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glom] C++11: BusyCursor: Delegate a constructor instead of sharing init().
- Date: Wed, 6 Jan 2016 15:58:56 +0000 (UTC)
commit 20a49cfbaa6a542174bb6528975000fc9c6b71ee
Author: Murray Cumming <murrayc murrayc com>
Date: Wed Jan 6 14:32:31 2016 +0100
C++11: BusyCursor: Delegate a constructor instead of sharing init().
glom/bakery/busy_cursor.cc | 18 +++++-------------
glom/bakery/busy_cursor.h | 1 -
2 files changed, 5 insertions(+), 14 deletions(-)
---
diff --git a/glom/bakery/busy_cursor.cc b/glom/bakery/busy_cursor.cc
index 713ea0c..116095a 100644
--- a/glom/bakery/busy_cursor.cc
+++ b/glom/bakery/busy_cursor.cc
@@ -9,26 +9,18 @@ namespace Glom
BusyCursor::type_map_cursors BusyCursor::m_map_cursors;
BusyCursor::BusyCursor(Gtk::Window& window, Gdk::CursorType cursor_type)
-: m_Cursor( Gdk::Cursor::create(window.get_display(), cursor_type) ),
- m_pWindow(&window) //If this is a nested cursor then remember the previously-set cursor, so we can restore
it.
+: BusyCursor(&window, cursor_type)
{
- init();
}
BusyCursor::BusyCursor(Gtk::Window* window, Gdk::CursorType cursor_type)
-: m_pWindow(window) //If this is a nested cursor then remember the previously-set cursor, so we can restore
it.
+: m_pWindow(window) //If this is a nested cursor then remember the previously-set cursor, so we can restore
it.
{
- if(m_pWindow) {
- m_Cursor = Gdk::Cursor::create(m_pWindow->get_display(), cursor_type);
- init();
- }
-}
-
-void BusyCursor::init()
-{
- if(!m_pWindow)
+ if(m_pWindow)
return;
+ m_Cursor = Gdk::Cursor::create(m_pWindow->get_display(), cursor_type);
+
m_refWindow = m_pWindow->get_window();
if(!m_refWindow)
return;
diff --git a/glom/bakery/busy_cursor.h b/glom/bakery/busy_cursor.h
index b21e4c4..2e2536a 100644
--- a/glom/bakery/busy_cursor.h
+++ b/glom/bakery/busy_cursor.h
@@ -44,7 +44,6 @@ public:
private:
- void init();
void force_gui_update();
Glib::RefPtr<Gdk::Cursor> m_Cursor;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]