diff options
Diffstat (limited to 'mixgtk/mixgtk_device.c')
-rw-r--r-- | mixgtk/mixgtk_device.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/mixgtk/mixgtk_device.c b/mixgtk/mixgtk_device.c index 96e1ff9..e94006e 100644 --- a/mixgtk/mixgtk_device.c +++ b/mixgtk/mixgtk_device.c @@ -290,7 +290,6 @@ static mix_device_t * mixgtk_device_new_ (mix_device_type_t type) { struct mixgtk_device_t *dev = NULL; - gchar *name = NULL; g_return_val_if_fail (type < mix_dev_INVALID, NULL); @@ -304,10 +303,7 @@ mixgtk_device_new_ (mix_device_type_t type) ((struct mixgtk_bin_device_t *)dev)->last_insert = 0; } - name = g_strconcat (g_get_home_dir(), "/", - MIXGTK_FILES_DIR, "/", DEF_NAMES_[type], NULL); - construct_device_with_name_ (&dev->device, type, name); - g_free (name); + construct_device_ (&dev->device, type); dev->device.vtable = &MIXGTK_VTABLE_; @@ -361,6 +357,7 @@ gboolean mixgtk_device_init (GtkNotebook *container, mix_vm_t *vm) { gint k = 0; + static gchar *devdir = NULL; g_return_val_if_fail (container != NULL, FALSE); g_return_val_if_fail (vm != NULL, FALSE); @@ -375,6 +372,13 @@ mixgtk_device_init (GtkNotebook *container, mix_vm_t *vm) /* remove dummy page from container */ gtk_notebook_remove_page (container_, 0); + if (!devdir) + { + devdir = g_strconcat (g_get_home_dir(), G_DIR_SEPARATOR_S, + MIXGTK_FILES_DIR, NULL); + mix_device_set_dir (devdir); + } + mix_vm_set_device_factory (vm, mixgtk_device_new_); /* read format configuration */ |