[libgda] GdaConnection: allow changing some options once the connection is opened
- From: Vivien Malerba <vivien src gnome org>
- To: svn-commits-list gnome org
- Subject: [libgda] GdaConnection: allow changing some options once the connection is opened
- Date: Tue, 28 Jul 2009 18:49:06 +0000 (UTC)
commit 4f587e6acc3d8403a1d93018a669ecb405008142
Author: Vivien Malerba <malerba gnome-db org>
Date: Tue Jul 28 18:36:13 2009 +0200
GdaConnection: allow changing some options once the connection is opened
libgda/gda-connection.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/libgda/gda-connection.c b/libgda/gda-connection.c
index fc1f9cd..980f558 100644
--- a/libgda/gda-connection.c
+++ b/libgda/gda-connection.c
@@ -642,17 +642,22 @@ gda_connection_set_property (GObject *object,
}
gda_connection_unlock ((GdaLockable*) cnc);
break;
- case PROP_OPTIONS:
+ case PROP_OPTIONS: {
+ GdaConnectionOptions flags;
+ flags = g_value_get_flags (value);
gda_mutex_lock (cnc->priv->mutex);
- if (cnc->priv->is_open) {
- g_warning (_("Could not set the '%s' property when the connection is opened"),
+ if (cnc->priv->is_open &&
+ ((flags & (~GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE)) !=
+ (cnc->priv->options & (~GDA_CONNECTION_OPTIONS_SQL_IDENTIFIERS_CASE_SENSITIVE)))) {
+ g_warning (_("Can't set the '%s' property once the connection is opened"),
pspec->name);
gda_connection_unlock ((GdaLockable*) cnc);
return;
}
- cnc->priv->options = g_value_get_flags (value);
+ cnc->priv->options = flags;
gda_mutex_unlock (cnc->priv->mutex);
break;
+ }
case PROP_META_STORE:
gda_mutex_lock (cnc->priv->mutex);
if (cnc->priv->meta_store) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]