gnomemm r1726 - in libgdamm/trunk: . libgda libgda/src



Author: jhs
Date: Wed Oct  1 07:28:14 2008
New Revision: 1726
URL: http://svn.gnome.org/viewvc/gnomemm?rev=1726&view=rev

Log:
2008-10-01  Johannes Schmid  <johannes schmid openismus com>

	* libgda/libgdamm.h:
	* libgda/src/column.ccg:
	* libgda/src/column.hg:
	* libgda/src/config.ccg:
	* libgda/src/config.hg:
	* libgda/src/datamodel.ccg:
	* libgda/src/datamodel.hg:
	* libgda/src/datamodelarray.hg:
	* libgda/src/datamodelimport.hg:
	* libgda/src/dataproxy.hg:
	Fixed build with latest libgda-4.0

Modified:
   libgdamm/trunk/ChangeLog
   libgdamm/trunk/libgda/libgdamm.h
   libgdamm/trunk/libgda/src/column.ccg
   libgdamm/trunk/libgda/src/column.hg
   libgdamm/trunk/libgda/src/config.ccg
   libgdamm/trunk/libgda/src/config.hg
   libgdamm/trunk/libgda/src/datamodel.ccg
   libgdamm/trunk/libgda/src/datamodel.hg
   libgdamm/trunk/libgda/src/datamodelarray.hg
   libgdamm/trunk/libgda/src/datamodelimport.hg
   libgdamm/trunk/libgda/src/dataproxy.hg

Modified: libgdamm/trunk/libgda/libgdamm.h
==============================================================================
--- libgdamm/trunk/libgda/libgdamm.h	(original)
+++ libgdamm/trunk/libgda/libgdamm.h	Wed Oct  1 07:28:14 2008
@@ -41,10 +41,8 @@
 #include <libgdamm/datahandler.h>
 #include <libgdamm/datamodel.h>
 #include <libgdamm/datamodelarray.h>
-#include <libgdamm/datamodelquery.h>
 #include <libgdamm/datamodelimport.h>
 #include <libgdamm/datamodeliter.h>
-#include <libgdamm/datamodelrow.h>
 #include <libgdamm/dataproxy.h>
 #include <libgdamm/holder.h>
 #include <libgdamm/metastore.h>

Modified: libgdamm/trunk/libgda/src/column.ccg
==============================================================================
--- libgdamm/trunk/libgda/src/column.ccg	(original)
+++ libgdamm/trunk/libgda/src/column.ccg	Wed Oct  1 07:28:14 2008
@@ -43,22 +43,13 @@
     return false;
 
   const bool result = get_title() == src->get_title() &&
-                get_defined_size() == src->get_defined_size() &&
                 get_name() == src->get_name() &&
-                get_table() == src->get_table() &&
-                get_caption() == src->get_caption() &&
-                get_scale() == src->get_scale() &&
                 get_dbms_type() == src->get_dbms_type() &&
                 get_g_type() == src->get_g_type() &&
                 get_allow_null() == src->get_allow_null() &&
-                get_primary_key() == src->get_primary_key() &&
-                get_unique_key() == src->get_unique_key() &&
-                get_references() == src->get_references() &&
                 get_auto_increment() == src->get_auto_increment() &&
                 get_position() == src->get_position();
-/* FIXME:
-                && get_default_value() == src->get_default_value();
-*/
+                // FIXME: get_default_value() == src->get_default_value();
 
   return result;
 }

Modified: libgdamm/trunk/libgda/src/column.hg
==============================================================================
--- libgdamm/trunk/libgda/src/column.hg	(original)
+++ libgdamm/trunk/libgda/src/column.hg	Wed Oct  1 07:28:14 2008
@@ -73,7 +73,7 @@
 
 #m4 _CONVERSION(`const char*',`const Glib::ustring&',__GCHARP_TO_USTRING)
   _WRAP_SIGNAL(void name_changed(const Glib::ustring& old_name), "name-changed")
-  _WRAP_SIGNAL(void g_type_changed(int old_type, int new_type), "g-type-changed")
+  _WRAP_SIGNAL(void g_type_changed(int old_type, int new_type), "g-type-changed", no_default_handler)
 
   _WRAP_PROPERTY("id", Glib::ustring)
 };

Modified: libgdamm/trunk/libgda/src/config.ccg
==============================================================================
--- libgdamm/trunk/libgda/src/config.ccg	(original)
+++ libgdamm/trunk/libgda/src/config.ccg	Wed Oct  1 07:28:14 2008
@@ -28,6 +28,12 @@
 namespace Gda
 {
 
+DsnInfo* Config::get_dsn_info (const Glib::ustring& dsn_name)
+{
+  return gda_config_get_dsn_info (dsn_name.c_str()); 
+}
+
+  
 bool Config::dsn_needs_authentication(const Glib::ustring& dsn_name)
 {
   return gda_config_dsn_needs_authentication(dsn_name.c_str());

Modified: libgdamm/trunk/libgda/src/config.hg
==============================================================================
--- libgdamm/trunk/libgda/src/config.hg	(original)
+++ libgdamm/trunk/libgda/src/config.hg	Wed Oct  1 07:28:14 2008
@@ -32,8 +32,8 @@
 
 namespace Gda
 {
-
-typedef GdaDataSourceInfo DataSourceInfo;
+#m4 _EQUAL(GdaDsnInfo*, DsnInfo*)
+typedef GdaDsnInfo DsnInfo;
   
 /** Configuration â Access/Management of libgda configuration
  *
@@ -47,6 +47,9 @@
 public:
   _WRAP_METHOD(static Glib::RefPtr<Config> get(), gda_config_get, refreturn)
   
+  _WRAP_METHOD_DOCS_ONLY(gda_config_get_dsn_info);
+  static DsnInfo* get_dsn_info (const Glib::ustring& dsn_name);
+    
   _WRAP_METHOD_DOCS_ONLY(gda_config_dsn_needs_authentication)
   static bool dsn_needs_authentication(const Glib::ustring& dsn_name);
   _WRAP_METHOD_DOCS_ONLY(gda_config_list_dsn)
@@ -58,12 +61,14 @@
   _WRAP_METHOD_DOCS_ONLY(gda_config_can_modify_system_config)
   static bool can_modify_system_config();
   
-  #m4 _EQUAL(GdaDataSourceInfo*, DataSourceInfo*)
-  #m4 _CONVERSION(`gpointer',`DataSourceInfo*',`(DataSourceInfo*)($3)')
-  _WRAP_SIGNAL(void dsn_added(DataSourceInfo* info), "dsn-added", no_default_handler)
-  _WRAP_SIGNAL(void dsn_changed(DataSourceInfo* info), "dsn-changed", no_default_handler)
-  _WRAP_SIGNAL(void dsn_removed(DataSourceInfo* info), "dsn-removed", no_default_handler)
-  _WRAP_SIGNAL(void dsn_to_be_removed(DataSourceInfo* info), "dsn-to-be-removed", no_default_handler)    
+  #m4 _CONVERSION(`gpointer',`DsnInfo*',`(DsnInfo*)($3)')
+  _WRAP_SIGNAL(void dsn_added(DsnInfo* info), "dsn-added", no_default_handler)
+  _WRAP_SIGNAL(void dsn_changed(DsnInfo* info), "dsn-changed", no_default_handler)
+  _WRAP_SIGNAL(void dsn_removed(DsnInfo* info), "dsn-removed", no_default_handler)
+  _WRAP_SIGNAL(void dsn_to_be_removed(DsnInfo* info), "dsn-to-be-removed", no_default_handler)
+    
+  _WRAP_PROPERTY("system-filename", Glib::ustring);
+  _WRAP_PROPERTY("user-filename", Glib::ustring);
 };
 
 } // namespace Gda

Modified: libgdamm/trunk/libgda/src/datamodel.ccg
==============================================================================
--- libgdamm/trunk/libgda/src/datamodel.ccg	(original)
+++ libgdamm/trunk/libgda/src/datamodel.ccg	Wed Oct  1 07:28:14 2008
@@ -33,22 +33,24 @@
 namespace Gda
 {
      
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
 Glib::ValueBase DataModel::get_value_at(int col, int row) const
+#else
+Glib::ValueBase DataModel::get_value_at(int col, int row, std::auto_ptr<Glib::Error>& error) const
+#endif
 {
+  GError* gerror = 0;
   Glib::ValueBase retval;
   const GValue* value;
   //Note that the function does not return a new value, so we should not free it:
-  value = gda_data_model_get_value_at(const_cast<GdaDataModel*>(gobj()), col, row);
-  retval.init(value);
-  return retval;
-}
-
-Glib::ValueBase DataModel::get_value_at(const Glib::ustring& column_name, int row) const
-{
-  Glib::ValueBase retval;
-  const GValue* value;
-  //Note that the function does not return a new value, so we should not free it:
-  value = gda_data_model_get_value_at_col_name(const_cast<GdaDataModel*>(gobj()), column_name.c_str(), row);
+  value = gda_data_model_get_value_at(const_cast<GdaDataModel*>(gobj()), col, row, &gerror);
+#ifdef GLIBMM_EXCEPTIONS_ENABLED
+  if(gerror)
+    ::Glib::Error::throw_exception(gerror);
+#else
+  if(gerror)
+    error = ::Glib::Error::throw_exception(gerror);
+#endif //GLIBMM_EXCEPTIONS_ENABLED
   retval.init(value);
   return retval;
 }

Modified: libgdamm/trunk/libgda/src/datamodel.hg
==============================================================================
--- libgdamm/trunk/libgda/src/datamodel.hg	(original)
+++ libgdamm/trunk/libgda/src/datamodel.hg	Wed Oct  1 07:28:14 2008
@@ -118,12 +118,9 @@
   //We use a custom conversion here, because we need to copy the value:
   //#m4 _CONVERSION(`GValue*',`Value',`Glib::wrap($3, true /* take_copy=true */)')
   //#m4 _CONVERSION(`const GValue*',`Value',`Glib::wrap(const_cast<GValue*>($3), true /* take_copy */)')
- 
-  Glib::ValueBase get_value_at(int col, int row) const;
-  _IGNORE(gda_data_model_get_value_at)
 
-  Glib::ValueBase get_value_at(const Glib::ustring& column_name, int row) const;
-  _IGNORE(gda_data_model_get_value_at_col_name)
+  _WRAP_METHOD_DOCS_ONLY(gda_data_model_get_value_at)
+  Glib::ValueBase get_value_at(int col, int row) const;
 
   _WRAP_METHOD(ValueAttribute get_attributes_at(int col, int row), gda_data_model_get_attributes_at)
 

Modified: libgdamm/trunk/libgda/src/datamodelarray.hg
==============================================================================
--- libgdamm/trunk/libgda/src/datamodelarray.hg	(original)
+++ libgdamm/trunk/libgda/src/datamodelarray.hg	Wed Oct  1 07:28:14 2008
@@ -19,11 +19,10 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
-#include <libgdamm/datamodelrow.h>
+#include <glibmm/object.h>
 
 _DEFS(libgdamm,libgda)
 _PINCLUDE(glibmm/private/object_p.h)
-_PINCLUDE(libgdamm/private/datamodelrow_p.h)
 
 namespace Gnome
 {
@@ -36,9 +35,9 @@
  * @ingroup DataModels
  */
 class DataModelArray
- : public DataModelRow
+ : public Glib::Object
 {
-  _CLASS_GOBJECT(DataModelArray, GdaDataModelArray, GDA_DATA_MODEL_ARRAY, Gda::DataModelRow, GdaDataModelRow)
+  _CLASS_GOBJECT(DataModelArray, GdaDataModelArray, GDA_DATA_MODEL_ARRAY, Glib::Object, GObject)
 protected:
   explicit DataModelArray(int cols);
 

Modified: libgdamm/trunk/libgda/src/datamodelimport.hg
==============================================================================
--- libgdamm/trunk/libgda/src/datamodelimport.hg	(original)
+++ libgdamm/trunk/libgda/src/datamodelimport.hg	Wed Oct  1 07:28:14 2008
@@ -20,11 +20,10 @@
  */
 
 #include <glibmm/object.h>
-#include <libgdamm/datamodelrow.h>
 #include <libgdamm/set.h>
 
 _DEFS(libgdamm,libgda)
-_PINCLUDE(libgdamm/private/datamodelrow_p.h)
+_PINCLUDE(glibmm/private/object_p.h)
 
 namespace Gnome
 {
@@ -54,9 +53,9 @@
  * @ingroup DataModels
  */
 class DataModelImport
- : public DataModelRow
+ : public Glib::Object
 {
-  _CLASS_GOBJECT(DataModelImport, GdaDataModelImport, GDA_DATA_MODEL_IMPORT, Gda::DataModelRow, GdaDataModelRow)
+  _CLASS_GOBJECT(DataModelImport, GdaDataModelImport, GDA_DATA_MODEL_IMPORT, Glib::Object, GObject)
 protected:
   DataModelImport(const std::string& filename, bool random_access, const Glib::RefPtr<const Set>& options);
   _IGNORE(gda_data_model_import_new_file)

Modified: libgdamm/trunk/libgda/src/dataproxy.hg
==============================================================================
--- libgdamm/trunk/libgda/src/dataproxy.hg	(original)
+++ libgdamm/trunk/libgda/src/dataproxy.hg	Wed Oct  1 07:28:14 2008
@@ -109,7 +109,7 @@
   _WRAP_SIGNAL(void row_delete_changed(int row, bool to_be_deleted), "row-delete-changed")
   _WRAP_SIGNAL(void sample_changed(int sample_start, int sample_end), "sample-changed")
   _WRAP_SIGNAL(void sample_size_changed(int sample_size), "sample-size-changed")
-  _WRAP_SIGNAL(void filter_changed(), "filter-changed")
+  _WRAP_SIGNAL(void filter_changed(), "filter-changed", no_default_handler)
 };
 
 } // namespace Gda



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