[glom/feature_backup2] Fixed warnings, even with the latest gtkmm-2.24.



commit 05b16e1beb7752e4d5bbd1bc713a514ef9f9ea69
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Jul 13 12:19:02 2010 +0200

    Fixed warnings, even with the latest gtkmm-2.24.
    
    Many files: Try to include box.h or dialog.h before other treemodel.h.
        Sometimes just add a gtkmm.h to simplify things. This will not be necessary
        with gtkmm-3.0 (in glom's master branch).

 ChangeLog                                          |    8 ++
 glom/application.cc                                |    8 ++-
 glom/application.h                                 |    3 +-
 glom/bakery/app_withdoc_gtk.h                      |    6 +-
 glom/bakery/dialog_offersave.cc                    |    2 +-
 glom/dialog_progress_creating.cc                   |    2 +-
 glom/frame_glom.h                                  |    4 +-
 glom/libglom/connectionpool.cc                     |   20 +++---
 .../connectionpool_backends/postgres_central.cc    |   16 ----
 glom/libglom/connectionpool_backends/sqlite.cc     |   32 +++++----
 glom/main.cc                                       |   57 +++++++--------
 glom/mode_design/box_db_table_relationships.cc     |    9 ++-
 glom/mode_design/box_db_table_relationships.h      |    5 +-
 glom/mode_design/dialog_add_related_table.h        |    3 +-
 glom/mode_design/dialog_database_preferences.h     |    3 +-
 glom/mode_design/dialog_initial_password.h         |    3 +-
 glom/mode_design/fields/combo_fieldtype.cc         |   11 ++--
 glom/mode_design/layout/treestore_layout.cc        |    4 +-
 .../print_layouts/print_layout_toolbar.cc          |   14 ++--
 .../print_layouts/print_layout_toolbar.h           |    2 +-
 .../print_layouts/window_print_layout_edit.h       |    2 +-
 .../dialog_relationships_overview.cc               |   76 ++++++++++----------
 .../report_layout/treestore_report_layout.cc       |    1 +
 .../mode_design/script_library/dialog_new_script.h |    3 +-
 .../translation/dialog_change_language.cc          |    1 +
 .../translation/dialog_change_language.h           |    2 +-
 .../translation/dialog_copy_translation.h          |    3 +-
 .../translation/dialog_identify_original.h         |    3 +-
 glom/mode_design/users/dialog_choose_user.h        |    3 +-
 glom/mode_design/users/dialog_new_group.h          |    2 +-
 glom/print_layout/canvas_layout_item.cc            |   49 ++++++-------
 glom/utility_widgets/canvas/canvas_editable.cc     |    4 +-
 glom/utility_widgets/canvas/canvas_item_movable.h  |   12 ++--
 .../cellrendererlist/cellrendererlist.h            |    7 +-
 glom/utility_widgets/db_adddel/glom_db_treemodel.h |    8 +-
 glom/utility_widgets/dialog_properties.cc          |    6 +-
 .../utility_widgets/filechooserdialog_saveextras.h |    2 +-
 glom/utility_widgets/layouttoolbar.h               |    3 +-
 glom/utility_widgets/layouttoolbarbutton.cc        |    7 +-
 glom/utility_widgets/layoutwidgetbase.h            |    8 +-
 glom/utility_widgets/sidebar.h                     |   10 ++--
 glom/utils_ui.h                                    |   15 ++--
 tests/test_selfhosting_new_empty.cc                |   30 ++++----
 43 files changed, 229 insertions(+), 240 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 86a96d7..1677ff8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-07-13  Murray Cumming  <murrayc murrayc-desktop>
+
+	Fixed warnings, even with the latest gtkmm-2.24.
+
+	Many files: Try to include box.h or dialog.h before other treemodel.h.
+    Sometimes just add a gtkmm.h to simplify things. This will not be necessary
+    with gtkmm-3.0 (in glom's master branch).
+
 2010-07-07  Murray Cumming  <murrayc murrayc-desktop>
 
 	PostgresQL backups: Suggest a dated name.
diff --git a/glom/application.cc b/glom/application.cc
index e13377f..44d98de 100644
--- a/glom/application.cc
+++ b/glom/application.cc
@@ -54,7 +54,7 @@
 #include <libsoup/soup-status.h>
 #endif // !G_OS_WIN32
 
-#include <gtk/gtk.h>
+//#include <gtk/gtk.h>
 
 #ifndef G_OS_WIN32
 # include <netdb.h> //For gethostbyname().
@@ -1276,6 +1276,12 @@ bool Application::on_document_load()
           delete m_dialog_progess_convert_backup;
           m_dialog_progess_convert_backup = 0;
         }
+
+        if(!restored)
+        {
+          std::cerr << G_STRFUNC << ": Restore failed." << std::endl;
+          return false;
+        }
       }
 #endif // !GLOM_ENABLE_CLIENT_ONLY
 
diff --git a/glom/application.h b/glom/application.h
index 40710a6..f61f524 100644
--- a/glom/application.h
+++ b/glom/application.h
@@ -23,6 +23,8 @@
 
 #include "config.h" // For GLOM_ENABLE_CLIENT_ONLY
 
+#include <glom/bakery/app_withdoc_gtk.h>
+
 //TODO: Remove this when maemomm's gtkmm has been updated. 7th September 2009.
 #ifdef GLOM_ENABLE_MAEMO
 //Because earlier versions of gtkmm/enums.h did not include this, so
@@ -35,7 +37,6 @@
 #include <glom/navigation/maemo/pickerbutton_table.h>
 #endif //GLOM_ENABLE_MAEMO
 
-#include <glom/bakery/app_withdoc_gtk.h>
 #include <glom/frame_glom.h>
 
 
diff --git a/glom/bakery/app_withdoc_gtk.h b/glom/bakery/app_withdoc_gtk.h
index 316a7a3..f03fedf 100644
--- a/glom/bakery/app_withdoc_gtk.h
+++ b/glom/bakery/app_withdoc_gtk.h
@@ -27,11 +27,11 @@
 #include <hildonmm/stackable-window.h>
 #endif
 
+#include <gtkmm/dialog.h>
 #include <gtkmm/menubar.h>
 #include <gtkmm/menu.h>
 #include <gtkmm/toolbar.h>
 #include <gtkmm/handlebox.h>
-#include <gtkmm/dialog.h>
 #include <gtkmm/uimanager.h>
 #include <gtkmm/builder.h>
 
@@ -48,7 +48,7 @@ namespace GlomBakery
  *
  * Your application's installation should register your document's MIME-type in GNOME's (freedesktop's) MIME-type system,
  * and register your application as capable of opening documents of that MIME-type.
- * 
+ *
  *
  */
 class App_WithDoc_Gtk
@@ -89,7 +89,7 @@ protected:
   virtual void init_menus(); //Override this to add more or different menus.
   virtual void init_menus_file(); //Call this from init_menus() to add the standard file menu.
   virtual void init_menus_edit(); //Call this from init_menus() to add the standard edit menu
-  virtual void init_menus_help(); //Call this from init_menus() to add the standard help menu.	
+  virtual void init_menus_help(); //Call this from init_menus() to add the standard help menu.
   virtual void init_toolbars();
 
   void add_ui_from_string(const Glib::ustring& ui_description); //Convenience function
diff --git a/glom/bakery/dialog_offersave.cc b/glom/bakery/dialog_offersave.cc
index 7f8e101..86e51fc 100644
--- a/glom/bakery/dialog_offersave.cc
+++ b/glom/bakery/dialog_offersave.cc
@@ -17,9 +17,9 @@
  */
 
 #include <config.h>
+#include <gtkmm/box.h>
 #include <glom/bakery/dialog_offersave.h>
 #include <glom/bakery/app_withdoc_gtk.h>
-#include <gtkmm/box.h>
 #include <gtkmm/stock.h>
 #include <glibmm/i18n-lib.h>
 
diff --git a/glom/dialog_progress_creating.cc b/glom/dialog_progress_creating.cc
index 4ad31f2..15a2ae6 100644
--- a/glom/dialog_progress_creating.cc
+++ b/glom/dialog_progress_creating.cc
@@ -18,9 +18,9 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <gtkmm/dialog.h>
 #include <glom/dialog_progress_creating.h>
 #include <gtkmm/main.h>
-#include <gtkmm/dialog.h>
 #include <glibmm/i18n.h>
 
 namespace Glom
diff --git a/glom/frame_glom.h b/glom/frame_glom.h
index 94fec74..65d965e 100644
--- a/glom/frame_glom.h
+++ b/glom/frame_glom.h
@@ -23,13 +23,13 @@
 
 #include "config.h" // For GLOM_ENABLE_CLIENT_ONLY
 
+#include "window_boxholder.h"
+
 #include <gtkmm/frame.h>
 #include <gtkmm/toggleaction.h>
 #include <libglom/document/bakery/view/view_composite.h>
 #include <libglom/document/document.h>
 
-#include "window_boxholder.h"
-
 #ifndef GLOM_ENABLE_MAEMO
 #include "navigation/box_tables.h"
 #endif
diff --git a/glom/libglom/connectionpool.cc b/glom/libglom/connectionpool.cc
index f7bb540..ade26a5 100644
--- a/glom/libglom/connectionpool.cc
+++ b/glom/libglom/connectionpool.cc
@@ -170,7 +170,7 @@ void ConnectionPool::setup_from_document(const Document* document)
 
   set_ready_to_connect();
 }
-  
+
 void ConnectionPool::delete_instance()
 {
   if(m_instance)
@@ -420,12 +420,12 @@ bool ConnectionPool::save_backup(const SlotProgress& slot_progress, const std::s
   g_assert(m_backend.get());
 
   const std::string old_uri = m_backend->get_database_directory_uri();
-  
+
   std::string uri;
   try
   {
     //TODO: Avoid the copy/paste of glom_postgres_data and make it work for sqlite too.
-    const std::string subdir = Glib::build_filename(path_dir, "glom_postgres_data"); 
+    const std::string subdir = Glib::build_filename(path_dir, "glom_postgres_data");
     uri = Glib::filename_to_uri(subdir);
   }
   catch(const Glib::Error& ex)
@@ -433,7 +433,7 @@ bool ConnectionPool::save_backup(const SlotProgress& slot_progress, const std::s
     std::cerr << G_STRFUNC << ": exception from Glib::build_filename(): " << ex.what() << std::endl;
     return false;
   }
-  
+
   m_backend->set_database_directory_uri(uri);
   const bool result = m_backend->save_backup(slot_progress, m_user, m_password, m_database);
   m_backend->set_database_directory_uri(old_uri);
@@ -443,17 +443,17 @@ bool ConnectionPool::save_backup(const SlotProgress& slot_progress, const std::s
 bool ConnectionPool::convert_backup(const SlotProgress& slot_progress, const std::string& path_dir)
 {
   g_assert(m_backend.get());
-  
+
   //TODO: Avoid this copy/paste of the directory name:
   std::string path_dir_to_use = path_dir;
   if(!path_dir_to_use.empty())
   {
-    path_dir_to_use = Glib::build_filename(path_dir, "glom_postgres_data"); 
+    path_dir_to_use = Glib::build_filename(path_dir, "glom_postgres_data");
   }
 
   return m_backend->convert_backup(slot_progress, path_dir_to_use, m_user, m_password);
 }
-  
+
 void ConnectionPool::set_password(const Glib::ustring& value)
 {
   m_password = value;
@@ -623,7 +623,7 @@ ConnectionPool::StartupErrors ConnectionPool::startup(const SlotProgress& slot_p
 
   //If we crash while running (unlikely, hopefully), then try to cleanup.
   //Comment this out if you want to see the backtrace in a debugger.
-  //previous_sig_handler = signal(SIGSEGV, &on_linux_signal);
+  previous_sig_handler = signal(SIGSEGV, &on_linux_signal);
 
   return started;
 }
@@ -640,7 +640,7 @@ bool ConnectionPool::cleanup(const SlotProgress& slot_progress)
   set_ready_to_connect(false);
 
   bool result = false;
-  
+
   if(m_backend.get())
     result = m_backend->cleanup(slot_progress);
 
@@ -656,7 +656,7 @@ bool ConnectionPool::cleanup(const SlotProgress& slot_progress)
   //We don't need the segfault handler anymore:
   signal(SIGSEGV, previous_sig_handler);
   previous_sig_handler = SIG_DFL; /* Arbitrary default */
-  
+
   return result;
 }
 
diff --git a/glom/libglom/connectionpool_backends/postgres_central.cc b/glom/libglom/connectionpool_backends/postgres_central.cc
index ce77631..2666f78 100644
--- a/glom/libglom/connectionpool_backends/postgres_central.cc
+++ b/glom/libglom/connectionpool_backends/postgres_central.cc
@@ -26,22 +26,6 @@
 // Uncomment to see debug messages
 //#define GLOM_CONNECTION_DEBUG
 
-namespace
-{
-
-static Glib::ustring port_as_string(int port_num)
-{
-  Glib::ustring result;
-  char* cresult = g_strdup_printf("%d", port_num);
-  if(cresult)
-    result = cresult;
-  g_free(cresult);
-
-  return result;
-}
-
-}
-
 namespace Glom
 {
 
diff --git a/glom/libglom/connectionpool_backends/sqlite.cc b/glom/libglom/connectionpool_backends/sqlite.cc
index 712b9be..dc2bad4 100644
--- a/glom/libglom/connectionpool_backends/sqlite.cc
+++ b/glom/libglom/connectionpool_backends/sqlite.cc
@@ -54,11 +54,11 @@ Glib::RefPtr<Gnome::Gda::Connection> Sqlite::connect(const Glib::ustring& databa
 
     const Glib::ustring cnc_string = "DB_DIR=" + database_directory + ";DB_NAME=" + database;
     const Glib::ustring auth_string = Glib::ustring::compose("USERNAME=%1;PASSWORD=%2", username, password);
-    
+
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
     try
     {
-      connection = Gnome::Gda::Connection::open_from_string("SQLite", 
+      connection = Gnome::Gda::Connection::open_from_string("SQLite",
         cnc_string, auth_string,
         Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
     }
@@ -66,8 +66,8 @@ Glib::RefPtr<Gnome::Gda::Connection> Sqlite::connect(const Glib::ustring& databa
     {
 #else
     std::auto_ptr<Glib::Error> error;
-    connection = Gnome::Gda::Connection::open_from_string("SQLite", 
-      cnc_string, auth_string, 
+    connection = Gnome::Gda::Connection::open_from_string("SQLite",
+      cnc_string, auth_string,
       Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE, error);
     if(error.get())
     {
@@ -95,14 +95,14 @@ bool Sqlite::create_database(const Glib::ustring& database_name, const Glib::ust
     return false;
 
   Glib::RefPtr<Gio::File> file = Gio::File::create_for_uri(m_database_directory_uri);
-  const std::string database_directory = file->get_path(); 
+  const std::string database_directory = file->get_path();
   const Glib::ustring cnc_string = Glib::ustring::compose("DB_DIR=%1;DB_NAME=%2", database_directory, database_name);
 
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
   {
-    Glib::RefPtr<Gnome::Gda::Connection> cnc = 
-      Gnome::Gda::Connection::open_from_string("SQLite", 
+    Glib::RefPtr<Gnome::Gda::Connection> cnc =
+      Gnome::Gda::Connection::open_from_string("SQLite",
         cnc_string, "",
         Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE);
   }
@@ -112,9 +112,9 @@ bool Sqlite::create_database(const Glib::ustring& database_name, const Glib::ust
     return false;
   }
 #else
-  Glib::RefPtr<Gnome::Gda::Connection> cnc = 
-    Gnome::Gda::Connection::open_from_string("SQLite", 
-      cnc_string, "", 
+  Glib::RefPtr<Gnome::Gda::Connection> cnc =
+    Gnome::Gda::Connection::open_from_string("SQLite",
+      cnc_string, "",
       Gnome::Gda::CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE, error);
   if(error.get() != 0)
     return false;
@@ -144,7 +144,7 @@ bool Sqlite::add_column_to_server_operation(const Glib::RefPtr<Gnome::Gda::Serve
     if(!set_server_operation_value(operation, default_path, column->default_value, error))
       return false;
   }
-  
+
   return true;
 }
 
@@ -172,12 +172,12 @@ bool Sqlite::recreate_table(const Glib::RefPtr<Gnome::Gda::Connection>& connecti
 
   Glib::RefPtr<Gnome::Gda::MetaStore> store = connection->get_meta_store();
   Glib::RefPtr<Gnome::Gda::MetaStruct> metastruct = Gnome::Gda::MetaStruct::create(store, Gnome::Gda::META_STRUCT_FEATURE_NONE);
-#ifdef GLIBMM_EXCEPTIONS_ENABLED  
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   GdaMetaDbObject* object = metastruct->complement(Gnome::Gda::META_DB_TABLE, Gnome::Gda::Value(), Gnome::Gda::Value(), Gnome::Gda::Value(table_name));
 #else
   GdaMetaDbObject* object = metastruct->complement(Gnome::Gda::META_DB_TABLE, Gnome::Gda::Value(), Gnome::Gda::Value(), Gnome::Gda::Value(table_name), error);
 #endif
-  
+
   if(!object)
     return false;
 
@@ -387,16 +387,18 @@ bool Sqlite::change_columns(const Glib::RefPtr<Gnome::Gda::Connection>& connecti
   return recreate_table(connection, table_name, type_vec_strings(), type_vec_const_fields(), fields_changed, error);
 }
 
-bool Sqlite::save_backup(const SlotProgress& slot_progress, const Glib::ustring& username, const Glib::ustring& password, const Glib::ustring& database_name)
+bool Sqlite::save_backup(const SlotProgress& /* slot_progress */, const Glib::ustring& /* username */, const Glib::ustring& /* password */, const Glib::ustring& /* database_name */)
 {
   //TODO:
   std::cerr << G_STRFUNC << ": Not implemented.";
+  return false;
 }
 
-bool Sqlite::convert_backup(const SlotProgress& slot_progress, const std::string& base_directory, const Glib::ustring& username, const Glib::ustring& password)
+bool Sqlite::convert_backup(const SlotProgress& /* slot_progress */, const std::string& /* base_directory */, const Glib::ustring& /* username */, const Glib::ustring& /* password */)
 {
   //TODO:
   std::cerr << G_STRFUNC << ": Not implemented.";
+  return false;
 }
 
 
diff --git a/glom/main.cc b/glom/main.cc
index 45e983e..4535539 100644
--- a/glom/main.cc
+++ b/glom/main.cc
@@ -25,10 +25,11 @@
 #include <boost/python.hpp>
 
 //#include <gnome.h>
+#include <gtkmm/messagedialog.h>
 #include <glom/libglom/init.h>
 #include <glom/glade_utils.h>
 #include <gtkmm/main.h>
-#include <gtkmm/messagedialog.h>
+
 #include <giomm.h>
 
 // For postgres availability checks:
@@ -179,11 +180,11 @@ namespace Glom
 {
 
 class OptionGroup : public Glib::OptionGroup
-{ 
+{
 public:
   OptionGroup();
 
-  //These int instances should live as long as the OptionGroup to which they are added, 
+  //These int instances should live as long as the OptionGroup to which they are added,
   //and as long as the OptionContext to which those OptionGroups are added.
   std::string m_arg_filename;
   bool m_arg_version;
@@ -213,7 +214,7 @@ OptionGroup::OptionGroup()
   entry_debug_sql.set_long_name("debug_sql");
   entry_debug_sql.set_description(_("Show the generated SQL queries on stdout, for debugging."));
   add_entry(entry_debug_sql, m_arg_debug_sql);
-  
+
   Glib::OptionEntry entry_debug_date_check;
   entry_debug_date_check.set_long_name("debug-date-check");
   entry_debug_date_check.set_description(_("Show how Glom outputs a date in this locale, then stop."));
@@ -266,10 +267,10 @@ bool check_user_is_not_root_with_warning()
 
 #ifndef GLOM_ENABLE_CLIENT_ONLY
 // Message to packagers:
-// If your Glom package does not depend on PostgreSQL, for some reason, 
+// If your Glom package does not depend on PostgreSQL, for some reason,
 // then your distro-specific patch should uncomment this #define.
 // and implement ConnectionPool::install_posgres().
-// But please, just make your Glom package depend on PostgreSQL instead, 
+// But please, just make your Glom package depend on PostgreSQL instead,
 // because this is silly.
 //
 //#define DISTRO_SPECIFIC_POSTGRES_INSTALL_IMPLEMENTED 1
@@ -328,7 +329,7 @@ bool check_pyglom_is_available_with_warning()
 
    /* The python module could not be imported by Glom, so warn the user: */
    const Glib::ustring message = _("Your installation of Glom is not complete, because the Glom Python module is not available on your system.\n\nPlease report this bug to your vendor, or your system administrator so it can be corrected.");
-      
+
 #ifndef GLOM_ENABLE_MAEMO
   Gtk::MessageDialog dialog(Utils::bold_message(_("Glom Python Module Not Installed")), true /* use_markup */, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true /* modal */);
   dialog.set_secondary_text(message);
@@ -348,7 +349,7 @@ bool check_pygda_is_available_with_warning()
 
    /* The python module could not be imported by Glom, so warn the user: */
    const Glib::ustring message = _("Your installation of Glom is not complete, because the gda Python module is not available on your system.\n\nPlease report this bug to your vendor, or your system administrator so it can be corrected.");
-      
+
 #ifndef GLOM_ENABLE_MAEMO
   Gtk::MessageDialog dialog(Utils::bold_message(_("gda Python Module Not Installed")), true /* use_markup */, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true /* modal */);
   dialog.set_secondary_text(message);
@@ -367,7 +368,7 @@ bool check_pygda_is_available_with_warning()
 extern "C" void __libc_freeres(void);
 #endif
 
-int 
+int
 main(int argc, char* argv[])
 {
 #ifndef G_OS_WIN32
@@ -390,7 +391,7 @@ main(int argc, char* argv[])
 
   // TODO: I am not sure why, but this does not work. PYTHONPATH is set
   // correctly according to getenv(), but python still does not look in it.
-  // For now, the installer installs all the python stuff directly into the 
+  // For now, the installer installs all the python stuff directly into the
   // application directory, although I would like to move this to a python/
   // subdirectory.
 #if 0
@@ -425,13 +426,13 @@ main(int argc, char* argv[])
   textdomain(GETTEXT_PACKAGE);
 
   // Set the locale for any streams to the user's current locale,
-  // We should not rely on the default locale of 
-  // any streams (we should always do an explicit imbue()), 
+  // We should not rely on the default locale of
+  // any streams (we should always do an explicit imbue()),
   // but this is maybe a good default in case we forget.
   std::locale::global(std::locale(""));
 
   Glom::libglom_init(); //Also initializes python.
-   
+
 #ifdef GLOM_ENABLE_MAEMO
   if(!(Osso::initialize("org.maemo.glom", PACKAGE_NAME)))
   {
@@ -450,13 +451,13 @@ main(int argc, char* argv[])
   PySys_SetArgv(argc, argv);
 
   std::auto_ptr<Gtk::Main> mainInstance;
-#ifdef GLIBMM_EXCEPTIONS_ENABLED  
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
-#endif  
+#endif
   {
     mainInstance = std::auto_ptr<Gtk::Main>( new Gtk::Main(argc, argv, context) );
   }
-#ifdef GLIBMM_EXCEPTIONS_ENABLED  
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
   catch(const Glib::Error& ex)
   {
     std::cerr << "Glom: Error while initializing gtkmm: " << ex.what() << std::endl;
@@ -468,7 +469,7 @@ main(int argc, char* argv[])
     std::cerr << "Glom: Error while initializing gtkmm" << std::endl;
     return 0;
   }
-#endif      
+#endif
 
 #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
@@ -541,24 +542,24 @@ main(int argc, char* argv[])
     {
       //Get a URI (file://something) from the filepath:
       Glib::RefPtr<Gio::File> file = Gio::File::create_for_commandline_arg(input_uri);
-      
+
       if(!file->query_exists())
       {
         std::cerr << _("Glom: The file does not exist.") << std::endl;
-        
+
         std::cerr << std::endl << context.get_help() << std::endl;
         return -1;
       }
-      
+
       const Gio::FileType file_type = file->query_file_type();
       if(file_type == Gio::FILE_TYPE_DIRECTORY)
       {
         std::cerr << _("Glom: The file path is a directory instead of a file.") << std::endl;
-        
+
         std::cerr << std::endl << context.get_help() << std::endl;
         return -1;
       }
-      
+
       input_uri = file->get_uri();
 
       //std::cout << "URI = " << input_uri << std::endl;
@@ -575,7 +576,7 @@ main(int argc, char* argv[])
     {
       /* The Postgres provider was not found, so warn the user: */
       const Glib::ustring message = _("Your installation of Glom is not complete, because the PostgreSQL libgda provider is not available on your system. This provider is needed to access Postgres database servers.\n\nPlease report this bug to your vendor, or your system administrator so it can be corrected.");
-      
+
       #ifndef GLOM_ENABLE_MAEMO
       Gtk::MessageDialog dialog(Glom::Utils::bold_message(_("Incomplete Glom Installation")), true /* use_markup */, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true /* modal */);
       dialog.set_secondary_text(message);
@@ -584,7 +585,7 @@ main(int argc, char* argv[])
       Hildon::Note note(Hildon::NOTE_TYPE_INFORMATION, message);
       note.run();
       #endif
-      
+
       return -1; //There is no point in going further because Glom would not be able to connect to any Postgres servers.
     }
 
@@ -593,7 +594,7 @@ main(int argc, char* argv[])
     if(!Glom::check_postgres_is_available_with_warning())
       return -1; //There is no point in going further because the most useful Glom functionality will not work without Postgres. Only a very cut-down Glom client would be useful without self-hosting.
     #endif // !GLOM_ENABLE_CLIENT_ONLY
-      
+
     // Postgres can't be started as root. initdb complains.
     // So just prevent this in general. It is safer anyway.
     if(!Glom::check_user_is_not_root_with_warning())
@@ -610,14 +611,14 @@ main(int argc, char* argv[])
     // Some more sanity checking:
     // These print errors to the stdout if they fail.
     // In future we might refuse to start if they fail.
-    const bool test1 = 
+    const bool test1 =
       Glom::Conversions::sanity_check_date_text_representation_uses_4_digit_years(group.m_arg_debug_date_check);
     const bool test2 = Glom::Conversions::sanity_check_date_parsing();
     if(!test1 || !test2)
     {
       std::cerr << "Glom: ERROR: Date parsing sanity checks failed. Glom will not display dates correctly or interperet entered dates correctly. This needs attention from a translator. Please file a bug. See http://www.glom.org."; << std::endl;
     }
-    
+
     if(group.m_arg_debug_date_check)
       return 0; //This command-line option is documented as stopping afterwards.
 
@@ -666,5 +667,3 @@ main(int argc, char* argv[])
 
   return 0;
 }
-
-
diff --git a/glom/mode_design/box_db_table_relationships.cc b/glom/mode_design/box_db_table_relationships.cc
index 055c4e1..d1c2aef 100644
--- a/glom/mode_design/box_db_table_relationships.cc
+++ b/glom/mode_design/box_db_table_relationships.cc
@@ -18,7 +18,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include <gtkmm/builder.h>
+#include <gtkmm.h>
+//#include <gtkmm/builder.h>
 #include "box_db_table_relationships.h"
 #include <algorithm>
 #include <glibmm/i18n.h>
@@ -52,9 +53,9 @@ void Box_DB_Table_Relationships::init()
   m_colToField = m_AddDel.add_column(_("To Field"), AddDelColumnInfo::STYLE_Choices);
   m_colAllowEdit = m_AddDel.add_column(_("Allow Editing"),  AddDelColumnInfo::STYLE_Boolean);
   m_colAutoCreate = m_AddDel.add_column(_("Automatic Creation"),  AddDelColumnInfo::STYLE_Boolean);
-  
+
   m_colTitleSingular = m_AddDel.add_column(_("Title (Singular Form)"));
-  
+
 
   //Connect signals:
   m_AddDel.signal_user_activated().connect(sigc::mem_fun(*this, &Box_DB_Table_Relationships::on_adddel_user_activated));
@@ -132,7 +133,7 @@ bool Box_DB_Table_Relationships::fill_from_database()
 }
 
 void Box_DB_Table_Relationships::save_to_document()
-{ 
+{
   //Build relationships from AddDel:
   Document::type_vec_relationships vecRelationships;
 
diff --git a/glom/mode_design/box_db_table_relationships.h b/glom/mode_design/box_db_table_relationships.h
index 280e347..8f44adf 100644
--- a/glom/mode_design/box_db_table_relationships.h
+++ b/glom/mode_design/box_db_table_relationships.h
@@ -21,7 +21,7 @@
 #ifndef BOX_DB_TABLE_RELATIONSHIPS_H
 #define BOX_DB_TABLE_RELATIONSHIPS_H
 
-#include "../box_db_table.h"
+#include <glom/box_db_table.h>
 #include <glom/utility_widgets/adddel/adddel_withbuttons.h>
 
 namespace Glom
@@ -29,7 +29,7 @@ namespace Glom
 
 class Box_DB_Table_Relationships : public Box_DB_Table
 {
-public: 
+public:
   Box_DB_Table_Relationships();
   Box_DB_Table_Relationships(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& builder);
   virtual ~Box_DB_Table_Relationships();
@@ -56,4 +56,3 @@ private:
 } //namespace Glom
 
 #endif //BOX_DB_TABLE_RELATIONSHIPS_H
-
diff --git a/glom/mode_design/dialog_add_related_table.h b/glom/mode_design/dialog_add_related_table.h
index 09d9cbc..20da37d 100644
--- a/glom/mode_design/dialog_add_related_table.h
+++ b/glom/mode_design/dialog_add_related_table.h
@@ -21,8 +21,8 @@
 #ifndef GLOM_DIALOG_ADDRELATEDTABLE_H
 #define GLOM_DIALOG_ADDRELATEDTABLE_H
 
-#include <gtkmm/builder.h>
 #include <gtkmm/dialog.h>
+#include <gtkmm/builder.h>
 #include <gtkmm/entry.h>
 #include <glom/utility_widgets/combo_textglade.h>
 #include <glom/base_db.h>
@@ -69,4 +69,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_DIALOG_ADDRELATEDTABLE_H
-
diff --git a/glom/mode_design/dialog_database_preferences.h b/glom/mode_design/dialog_database_preferences.h
index d8c77ac..75cb813 100644
--- a/glom/mode_design/dialog_database_preferences.h
+++ b/glom/mode_design/dialog_database_preferences.h
@@ -21,9 +21,9 @@
 #ifndef GLOM_DIALOG_DATABASE_PREFERENCES_H
 #define GLOM_DIALOG_DATABASE_PREFERENCES_H
 
+#include <gtkmm/dialog.h>
 #include <gtkmm/builder.h>
 #include <glom/variablesmap.h>
-#include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/label.h>
 #include <gtksourceviewmm/sourceview.h>
@@ -92,4 +92,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_DIALOG_DATABASE_PREFERENCES_H
-
diff --git a/glom/mode_design/dialog_initial_password.h b/glom/mode_design/dialog_initial_password.h
index 43b89f3..465e6fd 100644
--- a/glom/mode_design/dialog_initial_password.h
+++ b/glom/mode_design/dialog_initial_password.h
@@ -21,8 +21,8 @@
 #ifndef GLOM_DIALOG_NEWSELFHOSTEDCONNECTION_H
 #define GLOM_DIALOG_NEWSELFHOSTEDCONNECTION_H
 
-#include <gtkmm/builder.h>
 #include <gtkmm/dialog.h>
+#include <gtkmm/builder.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/label.h>
 #include <glom/base_db.h>
@@ -60,4 +60,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_DIALOG_NEWSELFHOSTEDCONNECTION_H
-
diff --git a/glom/mode_design/fields/combo_fieldtype.cc b/glom/mode_design/fields/combo_fieldtype.cc
index 7b0f0ae..db26369 100644
--- a/glom/mode_design/fields/combo_fieldtype.cc
+++ b/glom/mode_design/fields/combo_fieldtype.cc
@@ -18,6 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <gtkmm.h>
 #include "combo_fieldtype.h"
 #include "../../box_db_table.h"
 #include <glibmm/i18n.h>
@@ -40,10 +41,10 @@ void Combo_FieldType::init()
 {
   m_refTreeModel = Gtk::ListStore::create(m_Columns);
   set_model(m_refTreeModel);
-    
+
   //Set Type choices:
   Field::type_map_type_names map_names = Field::get_usable_type_names();
-    
+
   for(Field::type_map_type_names::iterator iter = map_names.begin(); iter != map_names.end(); ++iter)
   {
     Gtk::TreeModel::iterator iterModel = m_refTreeModel->append();
@@ -59,14 +60,14 @@ void Combo_FieldType::init()
 
   pack_start(m_Columns.m_col_name);  //Show the name, but hide the ID.
 
-  
+
   //The value must be from the list, and it can't be empty:
   //set_value_in_list(true, false);
 }
 
 Combo_FieldType::~Combo_FieldType()
 {
-  
+
 }
 
 void Combo_FieldType::set_field_type(Field::glom_field_type fieldType)
@@ -92,7 +93,7 @@ Field::glom_field_type Combo_FieldType::get_field_type() const
   //Get the active row:
   Gtk::TreeModel::iterator active_row  = get_active();
   if(active_row)
-  {    
+  {
     Gtk::TreeModel::Row row = *active_row;
     result = row[m_Columns.m_col_type];
 
diff --git a/glom/mode_design/layout/treestore_layout.cc b/glom/mode_design/layout/treestore_layout.cc
index c7a11a4..4bc470f 100644
--- a/glom/mode_design/layout/treestore_layout.cc
+++ b/glom/mode_design/layout/treestore_layout.cc
@@ -18,6 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <gtkmm.h>
 #include <glom/mode_design/layout/treestore_layout.h>
 #include <iostream>
 
@@ -142,6 +143,3 @@ void TreeStore_Layout::fill_sequences(const iterator& iter)
 }
 
 } //namespace Glom
-
-
-
diff --git a/glom/mode_design/print_layouts/print_layout_toolbar.cc b/glom/mode_design/print_layouts/print_layout_toolbar.cc
index f15a6b0..f29d4ad 100644
--- a/glom/mode_design/print_layouts/print_layout_toolbar.cc
+++ b/glom/mode_design/print_layouts/print_layout_toolbar.cc
@@ -18,6 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <gtkmm.h>
 #include "print_layout_toolbar.h"
 #include <gtkmm/stock.h>
 #include <glibmm/i18n.h>
@@ -27,8 +28,8 @@ namespace Glom
 {
 
 PrintLayoutToolbar::PrintLayoutToolbar()
-:  m_group_items(_("Items")), 
-   m_group_lines(_("Lines")), 
+:  m_group_items(_("Items")),
+   m_group_lines(_("Lines")),
    m_group_records(_("Records")),
    m_drag_field("glom-field.png", PrintLayoutToolbarButton::ITEM_FIELD,
      _("Database Field"), _("Drag this to the layout to add a new database field.")),
@@ -45,7 +46,7 @@ PrintLayoutToolbar::PrintLayoutToolbar()
 {
   // Looks ugly otherwise:
   set_size_request(100, 200);
-  
+
   //Note for translators: These are layout items, like widgets in GTK+.
   m_group_items.add(m_drag_field);
   m_group_items.add(m_drag_text);
@@ -54,7 +55,7 @@ PrintLayoutToolbar::PrintLayoutToolbar()
   //Note for translators: These are layout items, like widgets in GTK+.
   m_group_lines.add(m_drag_line_horizontal);
   m_group_lines.add(m_drag_line_vertical);
-  
+
   //Note for translators: These are layout items, like widgets in GTK+.
   m_group_records.add(m_drag_related_records);
 
@@ -63,14 +64,13 @@ PrintLayoutToolbar::PrintLayoutToolbar()
   add_group(m_group_records);
 
   set_drag_source();
-  
+
   show_all_children();
 }
 
 PrintLayoutToolbar::~PrintLayoutToolbar()
 {
-  
+
 }
 
 } // namespace Glom
-
diff --git a/glom/mode_design/print_layouts/print_layout_toolbar.h b/glom/mode_design/print_layouts/print_layout_toolbar.h
index 4476eee..ccd4257 100644
--- a/glom/mode_design/print_layouts/print_layout_toolbar.h
+++ b/glom/mode_design/print_layouts/print_layout_toolbar.h
@@ -21,10 +21,10 @@
 #ifndef GLOM_UTILITY_WIDGETS_DRAGBAR_H
 #define GLOM_UTILITY_WIDGETS_DRAGBAR_H
 
+#include <gtkmm/box.h>
 #include <glom/mode_design/print_layouts/print_layout_toolbar_button.h>
 #include <gtkmm/window.h>
 #include <gtkmm/handlebox.h>
-#include <gtkmm/box.h>
 #include <gtkmm/toolitemgroup.h>
 
 #include <glom/utility_widgets/sidebar.h>
diff --git a/glom/mode_design/print_layouts/window_print_layout_edit.h b/glom/mode_design/print_layouts/window_print_layout_edit.h
index 3210d1d..d3a163d 100644
--- a/glom/mode_design/print_layouts/window_print_layout_edit.h
+++ b/glom/mode_design/print_layouts/window_print_layout_edit.h
@@ -21,6 +21,7 @@
 #ifndef WINDOW_PRINT_LAYOUT_EDIT_H
 #define WINDOW_PRINT_LAYOUT_EDIT_H
 
+#include <gtkmm/box.h>
 #include <libglom/data_structure/print_layout.h>
 #include <glom/print_layout/canvas_print_layout.h>
 #include <glom/mode_design/print_layouts/print_layout_toolbar.h>
@@ -29,7 +30,6 @@
 #include <gtkmm/window.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/label.h>
-#include <gtkmm/box.h>
 #include <gtkmm/uimanager.h>
 //#include <gtkmm/toggleaction.h>
 #include <gtkmm/ruler.h>
diff --git a/glom/mode_design/relationships_overview/dialog_relationships_overview.cc b/glom/mode_design/relationships_overview/dialog_relationships_overview.cc
index 4e70d76..53ab212 100644
--- a/glom/mode_design/relationships_overview/dialog_relationships_overview.cc
+++ b/glom/mode_design/relationships_overview/dialog_relationships_overview.cc
@@ -1,5 +1,5 @@
 /* Glom
- * 
+ *
  * Copyright (C) 2001-2004 Murray Cumming
  *
  * This program is free software; you can redistribute it and/or
@@ -19,6 +19,7 @@
  */
 
 #include "config.h"
+#include <gtkmm.h>
 #include "dialog_relationships_overview.h"
 #include "glom/utility_widgets/canvas/canvas_line_movable.h"
 #include "glom/utility_widgets/canvas/canvas_text_movable.h"
@@ -112,7 +113,7 @@ Dialog_RelationshipsOverview::Dialog_RelationshipsOverview(BaseObjectType* cobje
   #endif
 
   //Get the menu:
-  m_menu = dynamic_cast<Gtk::MenuBar*>( m_refUIManager->get_widget("/Overview_MainMenu") ); 
+  m_menu = dynamic_cast<Gtk::MenuBar*>( m_refUIManager->get_widget("/Overview_MainMenu") );
   if(!m_menu)
     g_warning("menu not found");
 
@@ -123,10 +124,10 @@ Dialog_RelationshipsOverview::Dialog_RelationshipsOverview(BaseObjectType* cobje
   //Get the scolled window and add the canvas to it:
   m_scrolledwindow_canvas = 0;
   builder->get_widget("scrolledwindow_canvas", m_scrolledwindow_canvas);
-  
+
   m_scrolledwindow_canvas->add(m_canvas);
   m_canvas.show();
-  
+
   //Restore the previous window size, to avoid annoying the user:
   if(m_last_size_x != 0 && m_last_size_y != 0 )
   {
@@ -139,8 +140,8 @@ Dialog_RelationshipsOverview::Dialog_RelationshipsOverview(BaseObjectType* cobje
   m_canvas.add_item(m_group_lines);
   m_group_lines->lower(); //Make sure that the lines are below the tables.
 
-  //Respond to changes of window size, 
-  //so we always make the canvas bounds big enough: 
+  //Respond to changes of window size,
+  //so we always make the canvas bounds big enough:
   m_scrolledwindow_canvas->get_hadjustment()->signal_changed().connect(
     sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_scroll_value_changed) );
   m_scrolledwindow_canvas->get_vadjustment()->signal_changed().connect(
@@ -152,8 +153,8 @@ Dialog_RelationshipsOverview::Dialog_RelationshipsOverview(BaseObjectType* cobje
 Dialog_RelationshipsOverview::~Dialog_RelationshipsOverview()
 {
   get_size(m_last_size_x, m_last_size_y);
-  
-  //Disconnect signal handlers for all current items, 
+
+  //Disconnect signal handlers for all current items,
   //so sigc::bind()ed RefPtrs can be released.
   while(m_list_table_connections.size())
   {
@@ -162,7 +163,7 @@ Dialog_RelationshipsOverview::~Dialog_RelationshipsOverview()
      the_connection.disconnect();
      m_list_table_connections.erase(iter);
   }
-  
+
   //Remove all current items:
   //while(m_group_tables->get_n_children() > 0)
   //  m_group_tables->remove_child(0);
@@ -171,7 +172,7 @@ Dialog_RelationshipsOverview::~Dialog_RelationshipsOverview()
 
 void Dialog_RelationshipsOverview::draw_tables()
 {
-  //Disconnect signal handlers for all current items, 
+  //Disconnect signal handlers for all current items,
   //so sigc::bind()ed RefPtrs can be released.
   while(m_list_table_connections.size())
   {
@@ -180,11 +181,11 @@ void Dialog_RelationshipsOverview::draw_tables()
      the_connection.disconnect();
      m_list_table_connections.erase(iter);
   }
-  
+
   //Remove all current items:
   while(m_group_tables->get_n_children() > 0)
     m_group_tables->remove_child(0);
-  
+
   Document* document = dynamic_cast<Document*>(get_document());
   if(document)
   {
@@ -198,7 +199,7 @@ void Dialog_RelationshipsOverview::draw_tables()
     {
       sharedptr<TableInfo> info = *iter;
       const Glib::ustring table_name = info->get_name();
-     
+
       float table_x = 0;
       float table_y = 0;
       //Get the x and y position from the document:
@@ -209,10 +210,10 @@ void Dialog_RelationshipsOverview::draw_tables()
         document->set_table_overview_position(table_name, table_x, table_y);
         m_modified = true;
       }
- 
+
       Document::type_vec_fields fields = document->get_table_fields(table_name);
 
-      Glib::RefPtr<CanvasGroupDbTable> table_group = 
+      Glib::RefPtr<CanvasGroupDbTable> table_group =
         CanvasGroupDbTable::create(info->get_name(), info->get_title_or_name(), fields, table_x, table_y);
       m_group_tables->add_child(table_group);
 
@@ -220,15 +221,15 @@ void Dialog_RelationshipsOverview::draw_tables()
         sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_table_moved),
         table_group) );
       m_list_table_connections.push_back(the_connection);
-     
+
       the_connection = table_group->signal_show_context().connect( sigc::bind(
         sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_table_show_context),
         table_group) );
       m_list_table_connections.push_back(the_connection);
-    
+
       //tv->x2 = tv->x1 + table_width;
       //tv->y2 = tv->y1 + table_height;
-      
+
       sizex += table_group->get_table_width() + 10;
 
       max_table_height = std::max(max_table_height, table_group->get_table_height());
@@ -237,16 +238,16 @@ void Dialog_RelationshipsOverview::draw_tables()
     m_canvas.set_bounds(0, 0, sizex, max_table_height * tables.size());
   }
 }
-   
+
 void Dialog_RelationshipsOverview::draw_lines()
 {
   //Remove all current items:
   while(m_group_lines->get_n_children() > 0)
     m_group_lines->remove_child(0);
-   
+
   Document* document = dynamic_cast<Document*>(get_document());
   if(document)
-  { 
+  {
     //Create the lines linking tables to show relationships:
     Document::type_listTableInfo tables = document->get_tables();
     for(Document::type_listTableInfo::iterator iter = tables.begin(); iter != tables.end(); ++iter)
@@ -256,7 +257,7 @@ void Dialog_RelationshipsOverview::draw_lines()
 
       Document::type_vec_relationships m_relationships = document->get_relationships(table_name);
       Document::type_vec_fields fields = document->get_table_fields(table_name);
-      
+
       for(Document::type_vec_relationships::const_iterator rit = m_relationships.begin(); rit != m_relationships.end(); ++rit)
       {
         sharedptr<const Relationship> relationship = *rit;
@@ -273,7 +274,7 @@ void Dialog_RelationshipsOverview::draw_lines()
           double temp_x = 0.0;
           double temp_y = 0.0;
           group_from->get_xy(temp_x, temp_y);
-        
+
           from_field_x = temp_x;
           from_field_y = temp_y + group_from->get_field_y(relationship->get_from_field());
         }
@@ -296,7 +297,7 @@ void Dialog_RelationshipsOverview::draw_lines()
           }
 
           //Start the line from the right of the from table instead of the left, if the to table is to the right:
-          double extra_line = 0; //An extra horizontal line before the real diagonal line starts. 
+          double extra_line = 0; //An extra horizontal line before the real diagonal line starts.
           if(to_field_x > from_field_x)
           {
             from_field_x += group_from->get_table_width();
@@ -307,7 +308,7 @@ void Dialog_RelationshipsOverview::draw_lines()
             to_field_x += group_to->get_table_width();
             extra_line = -20;
           }
- 
+
           //Create the line:
           Glib::RefPtr<CanvasLineMovable> line = CanvasLineMovable::create();
           double points_coordinates[] = {from_field_x, from_field_y,
@@ -327,12 +328,12 @@ void Dialog_RelationshipsOverview::draw_lines()
 
           //Create a text item, showing the name of the relationship on the line:
           //
-          //Raise or lower the text slightly to make it show above the line when horizontal, 
+          //Raise or lower the text slightly to make it show above the line when horizontal,
           //and to avoid overwriting a relationship in the other direction:
           //TODO: This is not very clear. Investigate how other systems show this.
-          double y_offset = (from_field_x < to_field_x) ? -10 : +10; 
+          double y_offset = (from_field_x < to_field_x) ? -10 : +10;
           if(from_field_x == to_field_x)
-            y_offset = (from_field_y < to_field_y) ? -10 : +10; 
+            y_offset = (from_field_y < to_field_y) ? -10 : +10;
 
           const double text_x = (from_field_x + to_field_x) / 2;
           const double text_y = ((from_field_y + to_field_y) / 2) + y_offset;
@@ -363,7 +364,7 @@ void Dialog_RelationshipsOverview::on_response(int /* id */)
 {
   if(m_modified && get_document())
     get_document()->set_modified();
-    
+
   hide();
 }
 
@@ -456,7 +457,7 @@ void Dialog_RelationshipsOverview::on_table_moved(Glib::RefPtr<CanvasGroupDbTabl
     document->set_table_overview_position(table->get_table_name(), x, y);
   }
 
-  //It is probably incredibly inefficient to recreate the lines repeatedly while dragging a table, 
+  //It is probably incredibly inefficient to recreate the lines repeatedly while dragging a table,
   //but it seems to work OK, and it makes the code much simpler.
   //If this is a problem, we should just change the start/end coordinates of any lines connected to the moved table.
   draw_lines();
@@ -466,14 +467,14 @@ void Dialog_RelationshipsOverview::on_table_show_context(guint button, guint32 a
 {
   if(m_action_edit_fields)
   {
-    // Disconnect the previous handler, 
+    // Disconnect the previous handler,
     // and connect a new one, with the correct table as a bound parameter:
     m_connection_edit_fields.disconnect();
-    m_connection_edit_fields = m_action_edit_fields->signal_activate().connect( 
+    m_connection_edit_fields = m_action_edit_fields->signal_activate().connect(
       sigc::bind( sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_context_menu_edit_fields), table ));
 
     m_connection_edit_relationships.disconnect();
-    m_connection_edit_relationships = m_action_edit_relationships->signal_activate().connect( 
+    m_connection_edit_relationships = m_action_edit_relationships->signal_activate().connect(
       sigc::bind( sigc::mem_fun(*this, &Dialog_RelationshipsOverview::on_context_menu_edit_relationships), table ));
   }
 
@@ -501,7 +502,7 @@ void Dialog_RelationshipsOverview::setup_context_menu()
   try
   {
   #endif
-    Glib::ustring ui_info = 
+    Glib::ustring ui_info =
     "<ui>"
     "  <popup name='ContextMenu'>"
     "  <menuitem action='ContextEditFields'/>"
@@ -526,7 +527,7 @@ void Dialog_RelationshipsOverview::setup_context_menu()
   #endif
 
   //Get the menu:
-  m_context_menu = dynamic_cast<Gtk::Menu*>( m_context_menu_uimanager->get_widget("/ContextMenu") ); 
+  m_context_menu = dynamic_cast<Gtk::Menu*>( m_context_menu_uimanager->get_widget("/ContextMenu") );
 }
 
 void Dialog_RelationshipsOverview::on_context_menu_edit_fields(Glib::RefPtr<CanvasGroupDbTable> table)
@@ -561,14 +562,14 @@ void Dialog_RelationshipsOverview::on_scroll_value_changed()
   double height = m_scrolledwindow_canvas->get_vadjustment()->get_page_size();
   //double x = m_scrolledwindow_canvas->get_hadjustment()->get_value();
   //double y = m_scrolledwindow_canvas->get_vadjustment()->get_value();
-  
+
   //Make sure that the canvas bounds are as big as the scrollable area:
   double old_left = 0;
   double old_top = 0;
   double old_right = 0;
   double old_bottom = 0;
   m_canvas.get_bounds(old_left, old_top, old_right, old_bottom);
-  
+
   const double old_height = old_bottom - old_top;
   const double old_width = old_right - old_left;
 
@@ -580,4 +581,3 @@ void Dialog_RelationshipsOverview::on_scroll_value_changed()
 }
 
 } //namespace Glom
-
diff --git a/glom/mode_design/report_layout/treestore_report_layout.cc b/glom/mode_design/report_layout/treestore_report_layout.cc
index 1d399d4..ba9db82 100644
--- a/glom/mode_design/report_layout/treestore_report_layout.cc
+++ b/glom/mode_design/report_layout/treestore_report_layout.cc
@@ -18,6 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <gtkmm.h>
 #include "treestore_report_layout.h"
 #include <libglom/data_structure/layout/report_parts/layoutitem_groupby.h>
 #include <libglom/data_structure/layout/report_parts/layoutitem_summary.h>
diff --git a/glom/mode_design/script_library/dialog_new_script.h b/glom/mode_design/script_library/dialog_new_script.h
index 31ce935..8d3cffb 100644
--- a/glom/mode_design/script_library/dialog_new_script.h
+++ b/glom/mode_design/script_library/dialog_new_script.h
@@ -21,8 +21,8 @@
 #ifndef GLOM_MODE_DESIGN_USERS_DIALOG_NEWSCRIPT_H
 #define GLOM_MODE_DESIGN_USERS_DIALOG_NEWSCRIPT_H
 
-#include <gtkmm/builder.h>
 #include <gtkmm/dialog.h>
+#include <gtkmm/builder.h>
 #include <gtkmm/entry.h>
 
 namespace Glom
@@ -43,4 +43,3 @@ public:
 } //namespace Glom
 
 #endif //GLOM_MODE_DESIGN_USERS_DIALOG_NEWSCRIPT_H
-
diff --git a/glom/mode_design/translation/dialog_change_language.cc b/glom/mode_design/translation/dialog_change_language.cc
index 207772f..ec37af2 100644
--- a/glom/mode_design/translation/dialog_change_language.cc
+++ b/glom/mode_design/translation/dialog_change_language.cc
@@ -18,6 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <gtkmm.h>
 #include "dialog_change_language.h"
 #include <glibmm/i18n.h>
 
diff --git a/glom/mode_design/translation/dialog_change_language.h b/glom/mode_design/translation/dialog_change_language.h
index 4475c69..9056730 100644
--- a/glom/mode_design/translation/dialog_change_language.h
+++ b/glom/mode_design/translation/dialog_change_language.h
@@ -22,8 +22,8 @@
 #define GLOM_TRANSLATIONS_DIALOG_CHANGE_LANGUAGE_H
 
 #include "combobox_locale.h"
-#include <gtkmm/builder.h>
 #include <gtkmm/dialog.h>
+#include <gtkmm/builder.h>
 
 namespace Glom
 {
diff --git a/glom/mode_design/translation/dialog_copy_translation.h b/glom/mode_design/translation/dialog_copy_translation.h
index 1255401..60e9609 100644
--- a/glom/mode_design/translation/dialog_copy_translation.h
+++ b/glom/mode_design/translation/dialog_copy_translation.h
@@ -21,10 +21,10 @@
 #ifndef GLOM_TRANSLATIONS_DIALOG_COPY_TRANSLATION_H
 #define GLOM_TRANSLATIONS_DIALOG_COPY_TRANSLATION_H
 
+#include <gtkmm/dialog.h>
 #include "combobox_locale.h"
 #include <libglom/document/document.h> // For View_Composite_Glom
 #include <gtkmm/builder.h>
-#include <gtkmm/dialog.h>
 
 namespace Glom
 {
@@ -50,4 +50,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_TRANSLATIONS_DIALOG_COPY_TRANSLATION_H
-
diff --git a/glom/mode_design/translation/dialog_identify_original.h b/glom/mode_design/translation/dialog_identify_original.h
index 8c0d46b..4bbd724 100644
--- a/glom/mode_design/translation/dialog_identify_original.h
+++ b/glom/mode_design/translation/dialog_identify_original.h
@@ -21,10 +21,10 @@
 #ifndef GLOM_TRANSLATIONS_DIALOG_IDENTIFY_ORIGINAL_H
 #define GLOM_TRANSLATIONS_DIALOG_IDENTIFY_ORIGINAL_H
 
+#include <gtkmm/dialog.h>
 #include "combobox_locale.h"
 #include <libglom/document/view.h> // For View_Glom
 #include <gtkmm/builder.h>
-#include <gtkmm/dialog.h>
 
 namespace Glom
 {
@@ -54,4 +54,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_TRANSLATIONS_DIALOG_IDENTIFY_ORIGINAL_H
-
diff --git a/glom/mode_design/users/dialog_choose_user.h b/glom/mode_design/users/dialog_choose_user.h
index 02c4fb9..ec7a622 100644
--- a/glom/mode_design/users/dialog_choose_user.h
+++ b/glom/mode_design/users/dialog_choose_user.h
@@ -21,8 +21,8 @@
 #ifndef GLOM_MODE_DESIGN_USERS_DIALOG_CHOOSE_USER_H
 #define GLOM_MODE_DESIGN_USERS_DIALOG_CHOOSE_USER_H
 
-#include <gtkmm/builder.h>
 #include <gtkmm/dialog.h>
+#include <gtkmm/builder.h>
 #include <gtkmm/entry.h>
 #include "../../utility_widgets/combo_textglade.h"
 
@@ -50,4 +50,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_MODE_DESIGN_USERS_DIALOG_CHOOSER_USER_H
-
diff --git a/glom/mode_design/users/dialog_new_group.h b/glom/mode_design/users/dialog_new_group.h
index dc04da9..ad51b21 100644
--- a/glom/mode_design/users/dialog_new_group.h
+++ b/glom/mode_design/users/dialog_new_group.h
@@ -21,8 +21,8 @@
 #ifndef GLOM_MODE_DESIGN_USERS_DIALOG_NEWGROUP_H
 #define GLOM_MODE_DESIGN_USERS_DIALOG_NEWGROUP_H
 
-#include <gtkmm/builder.h>
 #include <gtkmm/dialog.h>
+#include <gtkmm/builder.h>
 #include <gtkmm/entry.h>
 
 namespace Glom
diff --git a/glom/print_layout/canvas_layout_item.cc b/glom/print_layout/canvas_layout_item.cc
index c1f6aba..0d9e3c1 100644
--- a/glom/print_layout/canvas_layout_item.cc
+++ b/glom/print_layout/canvas_layout_item.cc
@@ -18,6 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <glom/utils_ui.h>
 #include "canvas_layout_item.h"
 #include <glom/utility_widgets/canvas/canvas_rect_movable.h>
 #include <glom/utility_widgets/canvas/canvas_text_movable.h>
@@ -33,7 +34,6 @@
 #include <libglom/data_structure/layout/layoutitem_portal.h>
 #include <libglom/data_structure/layout/report_parts/layoutitem_fieldsummary.h>
 #include <libglom/data_structure/glomconversions.h>
-#include <glom/utils_ui.h>
 #include <glibmm/i18n.h>
 #include <math.h>
 #include <algorithm> //For std::max().
@@ -82,13 +82,13 @@ void CanvasLayoutItem::apply_formatting(const Glib::RefPtr<CanvasTextMovable>& c
   if(!layout_item)
     return;
 
-  //Horizontal alignment:   
+  //Horizontal alignment:
   const FieldFormatting::HorizontalAlignment alignment =
     layout_item->get_formatting_used_horizontal_alignment();
   const Pango::Alignment x_align = (alignment == FieldFormatting::HORIZONTAL_ALIGNMENT_LEFT ? Pango::ALIGN_LEFT : Pango::ALIGN_RIGHT);
-#ifdef GLIBMM_PROPERTIES_ENABLED  
+#ifdef GLIBMM_PROPERTIES_ENABLED
   canvas_item->property_alignment() = x_align;
-#else    
+#else
   canvas_item->set_property("alignment", alignment);
 #endif
 
@@ -101,7 +101,7 @@ void CanvasLayoutItem::apply_formatting(const Glib::RefPtr<CanvasTextMovable>& c
 
     //Set it in the input parameter,
     //so that this is the default:
-    //TODO? formatting.set_text_format_font(font);    
+    //TODO? formatting.set_text_format_font(font);
   }
 
   canvas_item->set_font_points(font);
@@ -150,9 +150,9 @@ void CanvasLayoutItem::set_layout_item(const sharedptr<LayoutItem>& layout_item)
 
   if(child_item)
   {
-    //child_item->property_pointer_events() = 
+    //child_item->property_pointer_events() =
     //  (Goocanvas::PointerEvents)(Goocanvas::EVENTS_VISIBLE_FILL & GOO_CANVAS_EVENTS_VISIBLE_STROKE);
-      
+
     //Set the position and dimensions of this group to match the child:
     double x = 0;
     double y = 0;
@@ -252,7 +252,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
         double end_x  = 0;
         double end_y = 0;
         line->get_coordinates(start_x, start_y, end_x, end_y);
-        
+
         Glib::RefPtr<CanvasLineMovable> canvas_item = CanvasLineMovable::create();
         #ifdef GLIBMM_PROPERTIES_ENABLED
         canvas_item->property_line_width() = 1;
@@ -295,13 +295,13 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
             #else
             canvas_item->set_property("line-width", 0);
             #endif
-         
+
             apply_formatting(canvas_item, field);
 
             Glib::ustring name = field->get_name();
             if(name.empty())
               name = _("Choose Field");
-          
+
             canvas_item->set_text(name);
 
             child = canvas_item;
@@ -337,7 +337,7 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
               {
                 sharedptr<LayoutItem> layout_item = *iter;
 
-                //We use create_canvas_item_for_layout_item() instead of just 
+                //We use create_canvas_item_for_layout_item() instead of just
                 //creating another CanvasLayoutItem, because that would be a group,
                 //but goocanvas cannot yet support Groups inside Tables. murrayc.
                 //TODO: Bug number.
@@ -354,9 +354,9 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
                   Glib::RefPtr<Goocanvas::Item> cell_as_item = CanvasItemMovable::cast_to_item(cell);
                   if(cell_as_item)
                   {
-                    canvas_item->attach(cell_as_item, 
-                      col /* left_attach */, col+1 /* right_attach */, 
-                      row /* top_attach */, row + 1 /* right_attach */, 
+                    canvas_item->attach(cell_as_item,
+                      col /* left_attach */, col+1 /* right_attach */,
+                      row /* top_attach */, row + 1 /* right_attach */,
                       Gtk::FILL, (Gtk::AttachOptions)Gtk::FILL | Gtk::EXPAND);
                   }
                 }
@@ -385,9 +385,9 @@ Glib::RefPtr<CanvasItemMovable> CanvasLayoutItem::create_canvas_item_for_layout_
 
   if(child && child_item)
   {
-    //child_item->property_pointer_events() = 
+    //child_item->property_pointer_events() =
     //  (Goocanvas::PointerEvents)(Goocanvas::EVENTS_VISIBLE_FILL & GOO_CANVAS_EVENTS_VISIBLE_STROKE);
-      
+
     //Set the position and dimensions of this group to match the child:
     double x = 0;
     double y = 0;
@@ -416,11 +416,11 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
   sharedptr<LayoutItem_Field> field = sharedptr<LayoutItem_Field>::cast_dynamic(m_layout_item);
   if(!field)
     return;
-    
+
   Glib::RefPtr<CanvasItemMovable> child = get_child();
   if(!child)
     return;
-  
+
   const Field::glom_field_type field_type = field->get_glom_type();
   switch(field->get_glom_type())
   {
@@ -433,7 +433,7 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
       Glib::RefPtr<CanvasTextMovable> canvas_item = Glib::RefPtr<CanvasTextMovable>::cast_dynamic(child);
       if(!canvas_item)
         return;
-        
+
       Glib::ustring text_value = Conversions::get_text_for_gda_value(field_type, value, field->get_formatting_used().m_numeric_format);
 
       //The Postgres summary functions return NULL when summarising NULL records, but 0 is more sensible:
@@ -443,7 +443,7 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
         Gnome::Gda::Value value = Conversions::parse_value(0);
         text_value = Conversions::get_text_for_gda_value(field_type, value, field->get_formatting_used().m_numeric_format);
       }
-    
+
       canvas_item->set_text(text_value);
       break;
     }
@@ -452,23 +452,23 @@ void CanvasLayoutItem::set_db_data(const Gnome::Gda::Value& value)
       Glib::RefPtr<CanvasImageMovable> canvas_item = Glib::RefPtr<CanvasImageMovable>::cast_dynamic(child);
       if(!canvas_item)
         return;
-        
+
       //Get the height of the item (not of the pixbuf),
       //so we can scale the pixbuf:
       double width = 0;
       double height = 0;
       canvas_item->get_width_height(width, height);
-      
+
       Glib::RefPtr<Gdk::Pixbuf> pixbuf = Utils::get_pixbuf_for_gda_value(value);
       if(pixbuf) //TODO: Remove this if() check when goocanvas has my patch to avoid crashes when this is NULL.
         canvas_item->set_image(pixbuf);
-     
+
       break;
     }
     default:
       std::cerr << "CanvasLayoutItem::set_db_data(): unhandled field type." << std::endl;
   }
-        
+
 }
 
 void CanvasLayoutItem::remove_empty_indicators()
@@ -491,4 +491,3 @@ void CanvasLayoutItem::remove_empty_indicators()
 }
 
 } //namespace Glom
-
diff --git a/glom/utility_widgets/canvas/canvas_editable.cc b/glom/utility_widgets/canvas/canvas_editable.cc
index 4f46fb7..c0b2e7b 100644
--- a/glom/utility_widgets/canvas/canvas_editable.cc
+++ b/glom/utility_widgets/canvas/canvas_editable.cc
@@ -18,6 +18,7 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include <gtkmm.h>
 #include "canvas_editable.h"
 #include "canvas_group_resizable.h"
 #include "canvas_rect_movable.h"
@@ -111,7 +112,7 @@ Glib::RefPtr<Goocanvas::Item> CanvasEditable::get_parent_container_or_self(const
 {
   return item;
 
-  Glib::RefPtr<Goocanvas::Item> result = item; 
+  Glib::RefPtr<Goocanvas::Item> result = item;
   while(result && !result->is_container())
     result = result->get_parent();
 
@@ -144,4 +145,3 @@ CanvasEditable::type_signal_show_context CanvasEditable::signal_show_context()
 }
 
 } //namespace Glom
-
diff --git a/glom/utility_widgets/canvas/canvas_item_movable.h b/glom/utility_widgets/canvas/canvas_item_movable.h
index 65dea3d..5d197f6 100644
--- a/glom/utility_widgets/canvas/canvas_item_movable.h
+++ b/glom/utility_widgets/canvas/canvas_item_movable.h
@@ -21,7 +21,6 @@
 #ifndef GLOM_UTILITY_WIDGETS_CANVAS_ITEM_MOVABLE_H
 #define GLOM_UTILITY_WIDGETS_CANVAS_ITEM_MOVABLE_H
 
-#include "canvas_item_movable.h"
 #include "canvas_group_grid.h"
 #include <goocanvasmm/item.h>
 #include <gdkmm/cursor.h>
@@ -38,7 +37,7 @@ protected:
 public:
 
   /* Get the position of the item.
-   * For some items, this is an arbitrary part of the item, 
+   * For some items, this is an arbitrary part of the item,
    * such as the top-left of a rectangle,
    * or the first point in a line.
    */
@@ -50,11 +49,11 @@ public:
    */
   virtual void set_xy(double x, double y) = 0;
 
-  /* 
+  /*
    */
   virtual void get_width_height(double& width, double& height) const = 0;
 
-  /** 
+  /**
    */
   virtual void set_width_height(double width, double height) = 0;
 
@@ -71,7 +70,7 @@ public:
   typedef sigc::signal<void, guint, guint32> type_signal_show_context;
   type_signal_show_context signal_show_context();
 
-  /** Provide information about a grid or rules, 
+  /** Provide information about a grid or rules,
    * to which the item should snap when moving:
    *
    * @param grid: This must exist for as long as the canvas item.
@@ -98,7 +97,7 @@ private:
 
   void set_cursor(const Gdk::Cursor& cursor);
   void unset_cursor();
-  
+
 public:
   //These should really be protected, but the compiler doesn't allow it:
   bool on_button_press_event(const Glib::RefPtr<Goocanvas::Item>& target, GdkEventButton* event);
@@ -127,4 +126,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_UTILITY_WIDGETS_CANVAS_ITEM_MOVABLE_H
-
diff --git a/glom/utility_widgets/cellrendererlist/cellrendererlist.h b/glom/utility_widgets/cellrendererlist/cellrendererlist.h
index 914d95a..cbeb618 100644
--- a/glom/utility_widgets/cellrendererlist/cellrendererlist.h
+++ b/glom/utility_widgets/cellrendererlist/cellrendererlist.h
@@ -21,8 +21,9 @@
 #ifndef ADDDEL_CELLRENDERERLIST_H
 #define ADDDEL_CELLRENDERERLIST_H
 
-#include <gtkmm/cellrenderercombo.h>
-#include <gtkmm/liststore.h>
+#include <gtkmm.h>
+//#include <gtkmm/cellrenderercombo.h>
+//#include <gtkmm/liststore.h>
 
 
 namespace Glom
@@ -71,5 +72,3 @@ private:
 } //namespace Glom
 
 #endif //ADDDEL_CELLRENDERERLIST_H
-
-
diff --git a/glom/utility_widgets/db_adddel/glom_db_treemodel.h b/glom/utility_widgets/db_adddel/glom_db_treemodel.h
index f98e7d4..41b65aa 100644
--- a/glom/utility_widgets/db_adddel/glom_db_treemodel.h
+++ b/glom/utility_widgets/db_adddel/glom_db_treemodel.h
@@ -21,8 +21,9 @@
 #ifndef GLOM_MODE_DATA_DB_TREEMODEL_H
 #define GLOM_MODE_DATA_DB_TREEMODEL_H
 
-#include <gtkmm/treemodel.h>
-#include <gtkmm/treepath.h>
+#include <gtkmm.h>
+//#include <gtkmm/treemodel.h>
+//#include <gtkmm/treepath.h>
 #include <libglom/data_structure/layout/layoutitem_field.h>
 #include <libglom/connectionpool.h>
 #include <glom/base_db.h>
@@ -58,7 +59,7 @@ public:
 
   bool m_removed; //If it should not be shown anymore.
   bool m_extra; //A temporary new row.
-};  
+};
 
 class DbTreeModel
   : public Glib::Object,
@@ -195,4 +196,3 @@ private:
 } //namespace Glom
 
 #endif //GLOM_MODE_DATA_DB_TREEMODEL_H
-
diff --git a/glom/utility_widgets/dialog_properties.cc b/glom/utility_widgets/dialog_properties.cc
index b443ada..dcf98ee 100644
--- a/glom/utility_widgets/dialog_properties.cc
+++ b/glom/utility_widgets/dialog_properties.cc
@@ -18,8 +18,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
-#include "dialog_properties.h"
 #include "glom/utility_widgets/adddel/adddel.h"
+#include "dialog_properties.h"
 
 namespace Glom
 {
@@ -34,7 +34,7 @@ Dialog_Properties::Dialog_Properties(BaseObjectType* cobject, const Glib::RefPtr
 
   //In general, we don't want to allow changes to windows underneath while editing properties.
   //Also, if we don't set this then seconday windows (from a modal dialog) will be on top but unusable.
-  set_modal(); 
+  set_modal();
 
   //Connect signal handlers:
   m_pButton_Cancel->signal_clicked().connect( sigc::mem_fun(*this, &Dialog_Properties::on_button_cancel) );
@@ -158,5 +158,3 @@ void Dialog_Properties::enforce_constraints()
 }
 
 } //namespace Glom
-
-
diff --git a/glom/utility_widgets/filechooserdialog_saveextras.h b/glom/utility_widgets/filechooserdialog_saveextras.h
index 115f4e4..a507d69 100644
--- a/glom/utility_widgets/filechooserdialog_saveextras.h
+++ b/glom/utility_widgets/filechooserdialog_saveextras.h
@@ -26,9 +26,9 @@
 
 #include <libglom/document/document.h>
 
+#include <gtkmm/box.h>
 #include <gtkmm/filechooserdialog.h>
 #include <gtkmm/label.h>
-#include <gtkmm/box.h>
 #include <gtkmm/frame.h>
 #include <gtkmm/entry.h>
 #include <gtkmm/radiobutton.h>
diff --git a/glom/utility_widgets/layouttoolbar.h b/glom/utility_widgets/layouttoolbar.h
index 9eb5306..5520c48 100644
--- a/glom/utility_widgets/layouttoolbar.h
+++ b/glom/utility_widgets/layouttoolbar.h
@@ -21,10 +21,11 @@
 #ifndef GLOM_UTILITY_WIDGETS_LAYOUTTOOLBAR_H
 #define GLOM_UTILITY_WIDGETS_LAYOUTTOOLBAR_H
 
+#include <gtkmm/box.h>
 #include <glom/utility_widgets/layouttoolbarbutton.h>
 #include <gtkmm/window.h>
 #include <gtkmm/handlebox.h>
-#include <gtkmm/box.h>
+
 
 #include "sidebar.h"
 
diff --git a/glom/utility_widgets/layouttoolbarbutton.cc b/glom/utility_widgets/layouttoolbarbutton.cc
index d86daa8..f128abc 100644
--- a/glom/utility_widgets/layouttoolbarbutton.cc
+++ b/glom/utility_widgets/layouttoolbarbutton.cc
@@ -17,7 +17,8 @@
  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  * Boston, MA 02111-1307, USA.
  */
- 
+
+#include <gtkmm.h>
 #include "layouttoolbarbutton.h"
 
 namespace
@@ -52,7 +53,7 @@ LayoutToolbarButton::LayoutToolbarButton(const std::string& icon_name, LayoutWid
   std::list<Gtk::TargetEntry> targetentries;
   targetentries.push_back(Gtk::TargetEntry(get_target()));
 
-  drag_source_set(targetentries, Gdk::MODIFIER_MASK, 
+  drag_source_set(targetentries, Gdk::MODIFIER_MASK,
                   Gdk::ACTION_COPY | Gdk::ACTION_MOVE);
   set_tooltip_text(tooltip);
   set_label(title);
@@ -63,7 +64,7 @@ LayoutToolbarButton::~LayoutToolbarButton()
 
 }
 
-void LayoutToolbarButton::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&, 
+void LayoutToolbarButton::on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>&,
                                   Gtk::SelectionData& selection_data, guint, guint)
 {
   selection_data.set(8, (guint8*)(&m_type), 4);
diff --git a/glom/utility_widgets/layoutwidgetbase.h b/glom/utility_widgets/layoutwidgetbase.h
index 3fafb97..3f3687c 100644
--- a/glom/utility_widgets/layoutwidgetbase.h
+++ b/glom/utility_widgets/layoutwidgetbase.h
@@ -21,8 +21,8 @@
 #ifndef GLOM_MODE_DATA_LAYOUT_WIDGET_BASE_H
 #define GLOM_MODE_DATA_LAYOUT_WIDGET_BASE_H
 
-#include <libglom/data_structure/layout/layoutitem.h>
 #include <gtkmm.h>
+#include <libglom/data_structure/layout/layoutitem.h>
 #include <glom/mode_design/layout/treestore_layout.h> //Forthe enum.
 
 #include "config.h" // For GLOM_ENABLE_CLIENT_ONLY
@@ -34,7 +34,7 @@ class Application;
 
 class LayoutWidgetBase : virtual public sigc::trackable
 {
-public: 
+public:
   LayoutWidgetBase();
   virtual ~LayoutWidgetBase();
 
@@ -69,7 +69,7 @@ public:
 
   //Allow a child widget to delegate to a parent widget:
   typedef sigc::signal<void> type_signal_user_requested_layout;
-  type_signal_user_requested_layout signal_user_requested_layout(); 
+  type_signal_user_requested_layout signal_user_requested_layout();
 
   //Allow a child widget to delegate to a parent widget:
   typedef sigc::signal<void> type_signal_user_requested_layout_properties;
@@ -82,7 +82,7 @@ public:
   void set_dnd_in_progress(bool drag = true);
   bool get_dnd_in_progress();
 #endif // !GLOM_ENABLE_CLIENT_ONLY
-    
+
 protected:
   virtual Application* get_application() const; // = 0;
 
diff --git a/glom/utility_widgets/sidebar.h b/glom/utility_widgets/sidebar.h
index 7ae07be..ca514ac 100644
--- a/glom/utility_widgets/sidebar.h
+++ b/glom/utility_widgets/sidebar.h
@@ -21,9 +21,9 @@
 #ifndef GLOM_UTILITY_WIDGETS_SIDEBAR_H
 #define GLOM_UTILITY_WIDGETS_SIDEBAR_H
 
+#include <gtkmm/box.h>
 #include <gtkmm/window.h>
 #include <gtkmm/handlebox.h>
-#include <gtkmm/box.h>
 #include <gtkmm/button.h>
 #include "gtkmm/toolpalette.h"
 
@@ -35,19 +35,19 @@ class SideBar : public Gtk::HandleBox
 public:
   SideBar();
   virtual ~SideBar();
-    
+
   void add_group(Gtk::ToolItemGroup& group);
   void remove_group(Gtk::ToolItemGroup& group);
-  
+
   void set_drag_source();
 
 private:
   virtual void on_child_detached(Gtk::Widget* child);
   virtual void on_child_attached(Gtk::Widget* child);
-    
+
 private:
   Gtk::ToolPalette m_palette;
-    
+
   int m_width;
   int m_height;
 };
diff --git a/glom/utils_ui.h b/glom/utils_ui.h
index 274b4b3..67772f2 100644
--- a/glom/utils_ui.h
+++ b/glom/utils_ui.h
@@ -22,12 +22,12 @@
 #define GLOM_UTILS_UI_H
 
 #include "config.h"
+#include <gtkmm/dialog.h>
 #include <libglom/data_structure/field.h>
 #include <libglom/data_structure/numeric_format.h>
 
 #include <libglom/data_structure/layout/layoutitem_field.h>
 
-#include <gtkmm/dialog.h>
 #include <gtkmm/messagedialog.h>
 
 #ifdef GLOM_ENABLE_MAEMO
@@ -55,15 +55,15 @@ enum DefaultSpacings
 /**
  * Show the dialog, blocking until there is a non-help response,
  * showing the appropriate help page if the help button is clicked.
- */ 
+ */
 int dialog_run_with_help(Gtk::Dialog* dialog, const Glib::ustring& id = Glib::ustring());
 
 /**
  * Show the dialog, blocking until there is a non-help response,
  * showing the appropriate help page if the help button is clicked.
- *  This requires the dialog class to have a static 
+ *  This requires the dialog class to have a static
  * glade_id member variable, which we reuse as the help ID.
- */ 
+ */
 template<class T_Dialog>
 int dialog_run_with_help(T_Dialog* dialog)
 {
@@ -72,7 +72,7 @@ int dialog_run_with_help(T_Dialog* dialog)
 
 // Maemo has no help system since Maemo 5 (Fremantle).
 #ifndef GLOM_ENABLE_MAEMO
-/** This is a replacement for gnome_help_display(), 
+/** This is a replacement for gnome_help_display(),
  * to avoid the libgnome dependency.
  * TODO: GTK+ should have a function for this soon.
  */
@@ -90,7 +90,7 @@ Glib::ustring bold_message(const Glib::ustring& message);
 Glib::RefPtr<Gdk::Pixbuf> get_pixbuf_for_gda_value(const Gnome::Gda::Value& value);
 
 /** Get the width required for typical data of this type in the current font.
- * 
+ *
  * @widget The widget whose font should be used.
  * @field_layout The layout item whose data type should be used.
  * @or_title If true, check the width of the item's title too, returning the larger of the two values.
@@ -102,10 +102,9 @@ int get_suitable_field_width_for_widget(Gtk::Widget& widget, const sharedptr<con
 std::string get_filepath_with_extension(const std::string& filepath, const std::string& extension);
 
 Glib::RefPtr<Gdk::Pixbuf> image_scale_keeping_ratio(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf, int target_height, int target_width);
-  
+
 } //namespace Utils
 
 } //namespace Glom
 
 #endif //GLOM_UTILS_UI_H
-
diff --git a/tests/test_selfhosting_new_empty.cc b/tests/test_selfhosting_new_empty.cc
index 9917504..f36cc81 100644
--- a/tests/test_selfhosting_new_empty.cc
+++ b/tests/test_selfhosting_new_empty.cc
@@ -51,7 +51,7 @@ static bool delete_directory(const Glib::RefPtr<Gio::File>& directory)
   //(Recursively) Delete any child files and directories,
   //so we can delete this directory.
   Glib::RefPtr<Gio::FileEnumerator> enumerator = directory->enumerate_children();
-  
+
   Glib::RefPtr<Gio::FileInfo> info = enumerator->next_file();
   while(info)
   {
@@ -64,14 +64,14 @@ static bool delete_directory(const Glib::RefPtr<Gio::File>& directory)
 
     if(!removed_child)
        return false;
-    
+
     info = enumerator->next_file();
   }
 
   //Delete the actual directory:
   if(!directory->remove())
     return false;
-  
+
   return true;
 }
 
@@ -94,8 +94,8 @@ int main()
   #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
   {
-    const std::string path = 
-       Glib::build_filename(GLOM_DOCDIR_EXAMPLES_NOTINSTALLED, 
+    const std::string path =
+       Glib::build_filename(GLOM_DOCDIR_EXAMPLES_NOTINSTALLED,
          "example_music_collection.glom");
     uri = Glib::filename_to_uri(path);
   }
@@ -124,18 +124,18 @@ int main()
     std::cerr << "Document::load() failed with failure_code=" << failure_code << std::endl;
     return EXIT_FAILURE;
   }
-  
+
   g_assert(document.get_is_example_file());;
 
   Glom::ConnectionPool* connection_pool = Glom::ConnectionPool::get_instance();
-  
+
   //Save a copy, specifying the path to file in a directory:
   //For instance, /tmp/testfileglom/testfile.glom");
   const std::string temp_filename = "testglom";
-  const std::string temp_filepath_dir = Glib::build_filename(Glib::get_tmp_dir(), 
+  const std::string temp_filepath_dir = Glib::build_filename(Glib::get_tmp_dir(),
     temp_filename);
   const std::string temp_filepath = Glib::build_filename(temp_filepath_dir, temp_filename);
-  
+
   //Make sure that the file does not exist yet:
   {
     const Glib::ustring uri = Glib::filename_to_uri(temp_filepath_dir);
@@ -145,7 +145,7 @@ int main()
   //Save the example as a real file:
   const Glib::ustring file_uri = Glib::filename_to_uri(temp_filepath);
   document.set_file_uri(file_uri);
-  
+
   document.set_hosting_mode(Glom::Document::HOSTING_MODE_POSTGRES_SELF);
   document.set_is_example_file(false);
   document.set_network_shared(false);
@@ -162,16 +162,16 @@ int main()
   connection_pool->set_password(password);
 
   //Create the self-hosting files:
-  const Glom::ConnectionPool::InitErrors initialized_errors = 
+  const Glom::ConnectionPool::InitErrors initialized_errors =
     connection_pool->initialize( sigc::ptr_fun(&on_initialize_progress) );
   g_assert(initialized_errors == Glom::ConnectionPool::Backend::INITERROR_NONE);
 
   //Start self-hosting:
   //TODO: Let this happen automatically on first connection?
   const bool started = connection_pool->startup( sigc::ptr_fun(&on_startup_progress) );
-  g_assert(started == ConnectionPool::Backend::STARTUPERROR_NONE);
-  
-  const bool stopped = connection_pool->cleanup( sigc::ptr_fun(&on_cleanup_progress) );  
+  g_assert(started == Glom::ConnectionPool::Backend::STARTUPERROR_NONE);
+
+  const bool stopped = connection_pool->cleanup( sigc::ptr_fun(&on_cleanup_progress) );
   g_assert(stopped);
 
   //Make sure the directory is removed at the end,
@@ -179,7 +179,7 @@ int main()
     const Glib::ustring uri = Glib::filename_to_uri(temp_filepath_dir);
     delete_directory(uri);
   }
-  
+
   Glom::libglom_deinit();
 
   return EXIT_SUCCESS;



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