[glom] ShowProgressMessage: Minor Cleanup.



commit 5772d758b3ed75973e40d13993a194ca2ad0c858
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 24 09:22:15 2011 +0200

    ShowProgressMessage: Minor Cleanup.
    
    * glom/application.[h|cc]: Move implementation into .cc file. Correct the code
    style. Make the constructor explicit.

 ChangeLog           |    7 +++++++
 glom/application.cc |   22 ++++++++++++++++++++++
 glom/application.h  |   26 ++++++++------------------
 3 files changed, 37 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8d77f79..f39ea82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-24  Murray Cumming  <murrayc murrayc com>
+
+	ShowProgressMessage: Minor Cleanup.
+
+	* glom/application.[h|cc]: Move implementation into .cc file. Correct the code
+	style. Make the constructor explicit.
+
 2011-10-24  David King  <davidk openismus com>
 
   Replace progress dialog with infobar.
diff --git a/glom/application.cc b/glom/application.cc
index 464238f..5e62c2f 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -2938,4 +2938,26 @@ void Application::clear_progress_message()
   m_infobar_progress->hide();
 }
 
+
+ShowProgressMessage::ShowProgressMessage(const Glib::ustring& message)
+: m_app(dynamic_cast<Application*>(Application::get_application())),
+  m_message(message)
+{
+  g_return_if_fail(m_app);
+  m_app->set_progress_message(message);
+};
+
+ShowProgressMessage::~ShowProgressMessage()
+{
+  g_return_if_fail(m_app);
+  m_app->clear_progress_message();
+};
+
+void ShowProgressMessage::pulse()
+{
+  g_return_if_fail(m_app);
+  m_app->set_progress_message(m_message);
+};
+
+
 } //namespace Glom
diff --git a/glom/application.h b/glom/application.h
index 12bc72c..a99cead 100644
--- a/glom/application.h
+++ b/glom/application.h
@@ -41,7 +41,6 @@ namespace Glom
 {
 
 class Window_Translations;
-class ShowProgressMessage;
 
 class Application : public GlomBakery::App_WithDoc_Gtk
 {
@@ -274,29 +273,20 @@ private:
   bool m_show_sql_debug;
 };
 
-/* Use this class to ensure that the progress message is cleared upon exiting a
- * method with multiple return points. */
+/** Use this class to ensure that the progress message is cleared upon exiting a
+ * method with multiple return points.
+ */
 class ShowProgressMessage
 {
 public:
-  ShowProgressMessage(const Glib::ustring &message)
-  : app(dynamic_cast<Application*>(Application::get_application())),
-    message(message)
-  {
-    g_return_if_fail(app);
-    app->set_progress_message(message);
-  };
-
-  ~ShowProgressMessage()
-  {
-    app->clear_progress_message();
-  };
+  explicit ShowProgressMessage(const Glib::ustring &message);
+  ~ShowProgressMessage();
 
-  void pulse() { app->set_progress_message(message); };
+  void pulse();
 
 private:
-  Application * const app;
-  const Glib::ustring &message;
+  Application* const m_app;
+  Glib::ustring m_message;
 };
 
 } //namespace Glom



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