[libgda] Tools: ported to new LDAP provider
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Tools: ported to new LDAP provider
- Date: Tue, 23 Apr 2019 22:52:05 +0000 (UTC)
commit dbd9097855fc49b19fb032f8e6dc59ab0a3aa365
Author: Daniel Espinosa <esodan gmail com>
Date: Tue Apr 23 17:40:11 2019 -0500
Tools: ported to new LDAP provider
libgda-ui/data-entries/gdaui-entry-common-time.c | 21 +++++++++++++--------
providers/ldap/meson.build | 7 +++++--
tools/browser/ldap-browser/classes-view.c | 2 +-
tools/browser/ldap-browser/hierarchy-view.c | 2 +-
tools/browser/ldap-browser/ldap-classes-page.c | 2 +-
tools/browser/ldap-browser/ldap-entries-page.c | 2 +-
tools/browser/ldap-browser/ldap-search-page.c | 2 +-
tools/browser/ldap-browser/mgr-ldap-classes.c | 2 +-
tools/browser/ui-support.h | 4 ++--
tools/common/t-connection.h | 2 +-
tools/meson.build | 1 +
11 files changed, 28 insertions(+), 19 deletions(-)
---
diff --git a/libgda-ui/data-entries/gdaui-entry-common-time.c
b/libgda-ui/data-entries/gdaui-entry-common-time.c
index dd2141cba..c92bc9091 100644
--- a/libgda-ui/data-entries/gdaui-entry-common-time.c
+++ b/libgda-ui/data-entries/gdaui-entry-common-time.c
@@ -502,12 +502,15 @@ real_set_value (GdauiEntryWrapper *mgwrap, const GValue *value)
else {
const GdaTime *gtim;
GdaTime* copy;
- gtim = gda_value_get_time (value);
+ GTimeZone *tz;
+
+ gtim = gda_value_get_time (value);
priv->value_tz = gda_time_get_timezone (gtim);
priv->value_fraction = gda_time_get_fraction (gtim);
- copy = gda_time_copy (gtim);
- gda_time_change_timezone (copy, priv->displayed_tz);
+ tz = g_time_zone_new_offset (priv->displayed_tz);
+
+ copy = gda_time_to_timezone (gtim, tz);
GValue *copy_value;
copy_value = g_new0 (GValue, 1);
@@ -603,12 +606,14 @@ real_get_value (GdauiEntryWrapper *mgwrap)
if (value && (G_VALUE_TYPE (value) != GDA_TYPE_NULL)) {
const GdaTime *gdatime;
- gdatime = gda_value_get_time (value);
- GdaTime *time_copy = gda_time_copy (gdatime);
- gda_time_set_timezone (time_copy, priv->displayed_tz);
- gda_time_change_timezone (time_copy, priv->value_tz);
- gda_value_set_time (value, time_copy);
+ GTimeZone *tz;
+ gdatime = gda_value_get_time (value);
+ tz = g_time_zone_new_offset (priv->displayed_tz);
+ GdaTime *time_copy = gda_time_to_timezone (gdatime, priv->displayed_tz);
+ GdaTime *tnz = gda_time_to_timezone (time_copy, priv->value_tz);
+ gda_value_set_time (value, tnz);
gda_time_free (time_copy);
+ gda_time_free (tnz);
}
}
else if (type == G_TYPE_DATE_TIME) {
diff --git a/providers/ldap/meson.build b/providers/ldap/meson.build
index c8233b560..4e104e72d 100644
--- a/providers/ldap/meson.build
+++ b/providers/ldap/meson.build
@@ -8,7 +8,7 @@ ldaph_sources = files ([
'gda-tree-mgr-ldap.h'
])
install_headers(ldaph_sources,
- install_dir: join_paths(get_option('includedir'),project_package,'libgda')
+ install_dir: join_paths(get_option('includedir'),project_package,'providers','ldap')
)
ldapc_sources = files ([
@@ -108,7 +108,7 @@ libgda_ldap_provider_cargs = [
]
libgda_ldap_provider_cargs += c_args
-libgda_ldap_provider = library ('gda-ldap-'+project_api_version,
+libldap_provider = library ('gda-ldap-'+project_api_version,
libgda_ldap_sources,
dependencies: [
libgda_dep,
@@ -126,3 +126,6 @@ libgda_ldap_provider = library ('gda-ldap-'+project_api_version,
install: true,
install_dir: join_paths(get_option('libdir'), project_package, 'providers')
)
+
+libldap_provider_dep = declare_dependency(link_with: libldap_provider)
+
diff --git a/tools/browser/ldap-browser/classes-view.c b/tools/browser/ldap-browser/classes-view.c
index 54dc95f9a..8dddd61ba 100644
--- a/tools/browser/ldap-browser/classes-view.c
+++ b/tools/browser/ldap-browser/classes-view.c
@@ -23,7 +23,7 @@
#include "../dnd.h"
#include "../ui-support.h"
#include "../gdaui-bar.h"
-#include <virtual/gda-ldap-connection.h>
+#include <providers/ldap/gda-ldap-connection.h>
#include "mgr-ldap-classes.h"
#include <libgda-ui/gdaui-tree-store.h>
#include <libgda/gda-debug-macros.h>
diff --git a/tools/browser/ldap-browser/hierarchy-view.c b/tools/browser/ldap-browser/hierarchy-view.c
index f535082ef..a6668195e 100644
--- a/tools/browser/ldap-browser/hierarchy-view.c
+++ b/tools/browser/ldap-browser/hierarchy-view.c
@@ -23,7 +23,7 @@
#include "../dnd.h"
#include "../ui-support.h"
#include "../gdaui-bar.h"
-#include <virtual/gda-ldap-connection.h>
+#include <providers/ldap/gda-ldap-connection.h>
#include "mgr-ldap-entries.h"
#include <libgda-ui/gdaui-tree-store.h>
#include <libgda/gda-debug-macros.h>
diff --git a/tools/browser/ldap-browser/ldap-classes-page.c b/tools/browser/ldap-browser/ldap-classes-page.c
index 8f4c2f718..e5646f032 100644
--- a/tools/browser/ldap-browser/ldap-classes-page.c
+++ b/tools/browser/ldap-browser/ldap-classes-page.c
@@ -29,7 +29,7 @@
#include "../browser-page.h"
#include "../browser-window.h"
#include "common/t-connection.h"
-#include <virtual/gda-ldap-connection.h>
+#include <providers/ldap/gda-ldap-connection.h>
#include "mgr-ldap-classes.h"
#include <libgda-ui/gdaui-tree-store.h>
#include <libgda/gda-debug-macros.h>
diff --git a/tools/browser/ldap-browser/ldap-entries-page.c b/tools/browser/ldap-browser/ldap-entries-page.c
index f6b5f89b6..26e45d010 100644
--- a/tools/browser/ldap-browser/ldap-entries-page.c
+++ b/tools/browser/ldap-browser/ldap-entries-page.c
@@ -29,7 +29,7 @@
#include "../browser-page.h"
#include "../browser-window.h"
#include "common/t-connection.h"
-#include <virtual/gda-ldap-connection.h>
+#include <providers/ldap/gda-ldap-connection.h>
#include "mgr-ldap-entries.h"
#include <libgda-ui/gdaui-tree-store.h>
#include "ldap-browser-perspective.h"
diff --git a/tools/browser/ldap-browser/ldap-search-page.c b/tools/browser/ldap-browser/ldap-search-page.c
index c58ce0386..ee3ef45f6 100644
--- a/tools/browser/ldap-browser/ldap-search-page.c
+++ b/tools/browser/ldap-browser/ldap-search-page.c
@@ -27,7 +27,7 @@
#include "../browser-page.h"
#include "../browser-window.h"
#include "common/t-connection.h"
-#include <virtual/gda-ldap-connection.h>
+#include <providers/ldap/gda-ldap-connection.h>
#include "../ui-formgrid.h"
#include "vtable-dialog.h"
#include <libgda/gda-debug-macros.h>
diff --git a/tools/browser/ldap-browser/mgr-ldap-classes.c b/tools/browser/ldap-browser/mgr-ldap-classes.c
index eb1dbc94d..6fdf6191a 100644
--- a/tools/browser/ldap-browser/mgr-ldap-classes.c
+++ b/tools/browser/ldap-browser/mgr-ldap-classes.c
@@ -20,7 +20,7 @@
#include <libgda/libgda.h>
#include "mgr-ldap-classes.h"
#include "gda-tree-node.h"
-#include <sqlite/virtual/gda-ldap-connection.h>
+#include <providers/ldap/gda-ldap-connection.h>
#include "../ui-support.h"
struct _MgrLdapClassesPriv {
diff --git a/tools/browser/ui-support.h b/tools/browser/ui-support.h
index ce4cee6db..84967d2e2 100644
--- a/tools/browser/ui-support.h
+++ b/tools/browser/ui-support.h
@@ -22,8 +22,8 @@
#include <libgda/libgda.h>
#include <gtk/gtk.h>
#ifdef HAVE_LDAP
- #include <libgda/sqlite/virtual/gda-ldap-connection.h>
- #include <virtual/gda-ldap-connection.h>
+ #include <providers/ldap/gda-ldap-connection.h>
+ #include <providers/ldap/gda-ldap-connection.h>
#endif /* HAVE_LDAP */
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <common/t-connection.h>
diff --git a/tools/common/t-connection.h b/tools/common/t-connection.h
index e41283fa3..9921ece3f 100644
--- a/tools/common/t-connection.h
+++ b/tools/common/t-connection.h
@@ -23,7 +23,7 @@
#include "t-favorites.h"
#include "t-decl.h"
#ifdef HAVE_LDAP
-#include <libgda/sqlite/virtual/gda-ldap-connection.h>
+#include <providers/ldap/gda-ldap-connection.h>
#endif
G_BEGIN_DECLS
diff --git a/tools/meson.build b/tools/meson.build
index 0ac7c31d8..4d0d2fd08 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -148,6 +148,7 @@ executable('org.gnome.gda.Browser',
gda_browser_sources,
link_with: [
libgda,
+ libldap_provider,
libgdaui
],
dependencies: browser_deps,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]