[glom] Correct non-maemo build



commit 7545a3b3088ec4f7d4ad4cb08d239d64e2fe9e7e
Author: Murray Cumming <murrayc murrayc com>
Date:   Mon Oct 12 17:48:33 2009 +0200

    Correct non-maemo build
    problems after merging from the maemo5 branch.

 ChangeLog                                   |    7 +++++++
 glom/utility_widgets/db_adddel/db_adddel.cc |   14 +++++++-------
 glom/utility_widgets/flowtable.h            |    8 ++++++--
 glom/utility_widgets/flowtable_dnd.cc       |    2 +-
 4 files changed, 21 insertions(+), 10 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 142ef8c..e3d41e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-10-12  Murray Cumming  <murrayc murrayc com>
 
+	* glom/utility_widgets/db_adddel/db_adddel.cc:
+	* glom/utility_widgets/flowtable.h:
+	* glom/utility_widgets/flowtable_dnd.cc: Correct non-maemo build 
+	problems after merging from the maemo5 branch.
+
+2009-10-12  Murray Cumming  <murrayc murrayc com>
+
   Maemo: Details: Put scrollbar against the right edge, as per spec.
   
 	* glom/window_boxholder.[h|cc]: On Maemo, use an Alignment with no padding 
diff --git a/glom/utility_widgets/db_adddel/db_adddel.cc b/glom/utility_widgets/db_adddel/db_adddel.cc
index 5ecc1f6..d089649 100644
--- a/glom/utility_widgets/db_adddel/db_adddel.cc
+++ b/glom/utility_widgets/db_adddel/db_adddel.cc
@@ -1066,7 +1066,7 @@ void DbAddDel::construct_specified_columns()
   #endif //GLOM_ENABLE_MAEMO
 
   bool no_columns_used = true;
-  int data_model_column_index = 0;
+  int data_model_column_index = 0; //-1 means undefined index.
   
   guint column_to_expand = 0;
   const bool has_expandable_column = get_column_to_expand(column_to_expand);
@@ -1099,7 +1099,7 @@ void DbAddDel::construct_specified_columns()
       {
         //Get the index of the field in the query, if it is a field:
         //std::cout << "debug: model_column_index=" << model_column_index << ", item_data_model_column_index=" << item_data_model_column_index << std::endl;
-        const bool expand = column_to_expand && (column_to_expand == model_column_index);
+        const bool expand = has_expandable_column && ((int)column_to_expand == model_column_index);
         treeview_append_column(column_name, 
           *pCellRenderer, 
           model_column_index, item_data_model_column_index, 
@@ -1957,16 +1957,16 @@ bool DbAddDel::get_column_to_expand(guint& column_to_expand) const
 
 guint DbAddDel::treeview_append_column(const Glib::ustring& title, Gtk::CellRenderer& cellrenderer, int model_column_index, int data_model_column_index, bool expand)
 {
-  #ifndef GLOM_ENABLE_MAEMO
-  //Mathias Hasselmann says that this is required for the Maemo 5 style, 
-  //though we don't know yet where that is documented. murrayc.
-  cellrenderer->set_property("x-pad", HILDON_MARGIN_DEFAULT);
-  
+  #ifndef GLOM_ENABLE_MAEMO 
   DbTreeViewColumnGlom* pViewColumn = Gtk::manage( new DbTreeViewColumnGlom(Utils::string_escape_underscores(title), cellrenderer) );
   pViewColumn->set_sizing(Gtk::TREE_VIEW_COLUMN_FIXED); //Need by fixed-height mode.
 
   guint cols_count = m_TreeView.append_column(*pViewColumn);
   #else
+  //Mathias Hasselmann says that this is required for the Maemo 5 style, 
+  //though we don't know yet where that is documented. murrayc.
+  cellrenderer.set_property("x-pad", HILDON_MARGIN_DEFAULT);
+
   Glib::RefPtr<Hildon::TouchSelectorColumn> pViewColumn = touch_selector_get_column();
   pViewColumn->pack_start(cellrenderer, expand);
   g_assert(pViewColumn);
diff --git a/glom/utility_widgets/flowtable.h b/glom/utility_widgets/flowtable.h
index c568e6a..73ca856 100644
--- a/glom/utility_widgets/flowtable.h
+++ b/glom/utility_widgets/flowtable.h
@@ -70,7 +70,7 @@ public:
   typedef sigc::slot<void, Widget&> ForallSlot;
   void forall(const ForallSlot& slot);
 
-protected:
+private:
 
   #ifndef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
   // These are the hand-coded C default signal handlers in case the
@@ -99,6 +99,7 @@ protected:
   virtual void on_unrealize();
   virtual bool on_expose_event(GdkEventExpose* event);
 
+protected:
   int get_column_height(guint start_widget, guint widget_count, int& total_width) const;
 
   /** 
@@ -127,7 +128,7 @@ protected:
     Gtk::Allocation m_second_allocation;
   };
 
-  typedef std::vector<FlowTableItem> type_vecChildren;
+private:
   void insert_before(FlowTableItem& item, Gtk::Widget& before);
 
   int get_item_requested_height(const FlowTableItem& item) const;
@@ -139,7 +140,10 @@ protected:
   Gtk::Allocation assign_child(Gtk::Widget* widget, int x, int y);
   Gtk::Allocation assign_child(Gtk::Widget* widget, int x, int y, int width, int height);
 
+protected:
+  typedef std::vector<FlowTableItem> type_vecChildren;
   type_vecChildren m_children;
+private:
   guint m_columns_count;
   guint m_column_padding, m_row_padding;
   bool m_design_mode;
diff --git a/glom/utility_widgets/flowtable_dnd.cc b/glom/utility_widgets/flowtable_dnd.cc
index 42cc686..704d270 100644
--- a/glom/utility_widgets/flowtable_dnd.cc
+++ b/glom/utility_widgets/flowtable_dnd.cc
@@ -244,7 +244,7 @@ FlowTableDnd::dnd_item_at_position(int drag_x, int drag_y)
     {
       Gdk::Rectangle second_rect = cur_item->m_second->get_allocation();
       rect.set_height(MAX(rect.get_height(), second_rect.get_height()));
-      rect.set_width(rect.get_width() + m_padding + second_rect.get_width());
+      rect.set_width(rect.get_width() + get_column_padding() + second_rect.get_width());
     }
     
     int cur_column = 0;



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