mirror of
https://github.com/samba-team/samba.git
synced 2025-03-01 04:58:35 +03:00
r834: Fix gconf and dir backends
(This used to be commit fe5166ee88d401cdd493644af4876e803f546aef)
This commit is contained in:
parent
f0d7ae39c0
commit
25ed82e7ee
@ -127,6 +127,14 @@ static WERROR reg_dir_add_value(REG_KEY *p, const char *name, int type, void *da
|
|||||||
return WERR_NOT_SUPPORTED;
|
return WERR_NOT_SUPPORTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static WERROR reg_dir_get_hive(REG_HANDLE *h, int hive, REG_KEY **key)
|
||||||
|
{
|
||||||
|
if(hive != 0) return WERR_NO_MORE_ITEMS;
|
||||||
|
*key = reg_key_new_abs("", h, NULL);
|
||||||
|
(*key)->backend_data = talloc_strdup((*key)->mem_ctx, h->location);
|
||||||
|
return WERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
static WERROR reg_dir_del_value(REG_VAL *v)
|
static WERROR reg_dir_del_value(REG_VAL *v)
|
||||||
{
|
{
|
||||||
/* FIXME*/
|
/* FIXME*/
|
||||||
@ -137,6 +145,7 @@ static struct registry_ops reg_backend_dir = {
|
|||||||
.name = "dir",
|
.name = "dir",
|
||||||
.open_registry = reg_dir_open,
|
.open_registry = reg_dir_open,
|
||||||
.open_key = reg_dir_open_key,
|
.open_key = reg_dir_open_key,
|
||||||
|
.get_hive = reg_dir_get_hive,
|
||||||
.fetch_subkeys = reg_dir_fetch_subkeys,
|
.fetch_subkeys = reg_dir_fetch_subkeys,
|
||||||
.add_key = reg_dir_add_key,
|
.add_key = reg_dir_add_key,
|
||||||
.del_key = reg_dir_del_key,
|
.del_key = reg_dir_del_key,
|
||||||
|
@ -41,10 +41,22 @@ static WERROR reg_close_gconf(REG_HANDLE *h)
|
|||||||
return WERR_OK;
|
return WERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WERROR gconf_open_key (REG_HANDLE *h, const char *name, REG_KEY **key)
|
static WERROR gconf_get_hive (REG_HANDLE *h, int hivenum, REG_KEY **key)
|
||||||
|
{
|
||||||
|
if(hivenum != 0) return WERR_NO_MORE_ITEMS;
|
||||||
|
*key = reg_key_new_abs("", h, NULL);
|
||||||
|
(*key)->backend_data = talloc_strdup((*key)->mem_ctx, "/");
|
||||||
|
return WERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
static WERROR gconf_open_key (REG_HANDLE *h, int hivenum, const char *name, REG_KEY **key)
|
||||||
{
|
{
|
||||||
REG_KEY *ret;
|
REG_KEY *ret;
|
||||||
char *fullpath = reg_path_win2unix(strdup(name));
|
char *fullpath;
|
||||||
|
|
||||||
|
if(hivenum != 0) return WERR_NO_MORE_ITEMS;
|
||||||
|
|
||||||
|
fullpath = reg_path_win2unix(strdup(name));
|
||||||
|
|
||||||
/* Check if key exists */
|
/* Check if key exists */
|
||||||
if(!gconf_client_dir_exists((GConfClient *)h->backend_data, fullpath, NULL)) {
|
if(!gconf_client_dir_exists((GConfClient *)h->backend_data, fullpath, NULL)) {
|
||||||
@ -183,6 +195,7 @@ static struct registry_ops reg_backend_gconf = {
|
|||||||
.name = "gconf",
|
.name = "gconf",
|
||||||
.open_registry = reg_open_gconf,
|
.open_registry = reg_open_gconf,
|
||||||
.close_registry = reg_close_gconf,
|
.close_registry = reg_close_gconf,
|
||||||
|
.get_hive = gconf_get_hive,
|
||||||
.open_key = gconf_open_key,
|
.open_key = gconf_open_key,
|
||||||
.fetch_subkeys = gconf_fetch_subkeys,
|
.fetch_subkeys = gconf_fetch_subkeys,
|
||||||
.fetch_values = gconf_fetch_values,
|
.fetch_values = gconf_fetch_values,
|
||||||
|
@ -454,24 +454,40 @@ static GtkWidget* create_mainwin (void)
|
|||||||
open_nt4 = gtk_image_menu_item_new_with_mnemonic("_Open NT4 file");
|
open_nt4 = gtk_image_menu_item_new_with_mnemonic("_Open NT4 file");
|
||||||
gtk_widget_show (open_nt4);
|
gtk_widget_show (open_nt4);
|
||||||
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_nt4);
|
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_nt4);
|
||||||
|
|
||||||
|
g_signal_connect ((gpointer) open_nt4, "activate",
|
||||||
|
G_CALLBACK (on_open_file_activate),
|
||||||
|
"nt4");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reg_has_backend("w95")) {
|
if(reg_has_backend("w95")) {
|
||||||
open_w95 = gtk_image_menu_item_new_with_mnemonic("_Open Win9x file");
|
open_w95 = gtk_image_menu_item_new_with_mnemonic("_Open Win9x file");
|
||||||
gtk_widget_show (open_w95);
|
gtk_widget_show (open_w95);
|
||||||
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_w95);
|
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_w95);
|
||||||
|
|
||||||
|
g_signal_connect ((gpointer) open_w95, "activate",
|
||||||
|
G_CALLBACK (on_open_file_activate),
|
||||||
|
"w95");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reg_has_backend("gconf")) {
|
if(reg_has_backend("gconf")) {
|
||||||
open_gconf = gtk_image_menu_item_new_with_mnemonic ("_Open GConf");
|
open_gconf = gtk_image_menu_item_new_with_mnemonic ("_Open GConf");
|
||||||
gtk_widget_show (open_gconf);
|
gtk_widget_show (open_gconf);
|
||||||
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_gconf);
|
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_gconf);
|
||||||
|
|
||||||
|
g_signal_connect ((gpointer) open_gconf, "activate",
|
||||||
|
G_CALLBACK (on_open_gconf_activate),
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reg_has_backend("rpc")) {
|
if(reg_has_backend("rpc")) {
|
||||||
open_remote = gtk_menu_item_new_with_mnemonic ("_Open Remote");
|
open_remote = gtk_menu_item_new_with_mnemonic ("_Open Remote");
|
||||||
gtk_widget_show (open_remote);
|
gtk_widget_show (open_remote);
|
||||||
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_remote);
|
gtk_container_add (GTK_CONTAINER (menu_file_menu), open_remote);
|
||||||
|
|
||||||
|
g_signal_connect ((gpointer) open_remote, "activate",
|
||||||
|
G_CALLBACK (on_open_remote_activate),
|
||||||
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
|
save = gtk_image_menu_item_new_from_stock ("gtk-save", accel_group);
|
||||||
@ -605,18 +621,6 @@ static GtkWidget* create_mainwin (void)
|
|||||||
gtk_box_pack_start (GTK_BOX (vbox1), statusbar, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox1), statusbar, FALSE, FALSE, 0);
|
||||||
gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), FALSE);
|
gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), FALSE);
|
||||||
|
|
||||||
g_signal_connect ((gpointer) open_nt4, "activate",
|
|
||||||
G_CALLBACK (on_open_file_activate),
|
|
||||||
"nt4");
|
|
||||||
g_signal_connect ((gpointer) open_w95, "activate",
|
|
||||||
G_CALLBACK (on_open_file_activate),
|
|
||||||
"w95");
|
|
||||||
g_signal_connect ((gpointer) open_gconf, "activate",
|
|
||||||
G_CALLBACK (on_open_gconf_activate),
|
|
||||||
NULL);
|
|
||||||
g_signal_connect ((gpointer) open_remote, "activate",
|
|
||||||
G_CALLBACK (on_open_remote_activate),
|
|
||||||
NULL);
|
|
||||||
g_signal_connect ((gpointer) save, "activate",
|
g_signal_connect ((gpointer) save, "activate",
|
||||||
G_CALLBACK (on_save_activate),
|
G_CALLBACK (on_save_activate),
|
||||||
NULL);
|
NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user