From f161aa1e05d099268bb065b32d57cef28fd8a83a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 29 May 2007 23:57:44 +0000 Subject: [PATCH] move install.[ch] to theme.[ch] --- Makefile.am | 4 +-- src/handlers.c | 2 +- src/{install.c => theme.c} | 52 +++++++++++++++++++------------------- src/{install.h => theme.h} | 2 +- 4 files changed, 30 insertions(+), 30 deletions(-) rename src/{install.c => theme.c} (98%) rename src/{install.h => theme.h} (57%) diff --git a/Makefile.am b/Makefile.am index add3e18..e553d37 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,8 +38,8 @@ src_obconf_SOURCES = \ src/main.h \ src/handlers.c \ src/handlers.h \ - src/install.c \ - src/install.h \ + src/theme.c \ + src/theme.h \ src/tree.c \ src/tree.h diff --git a/src/handlers.c b/src/handlers.c index 33a0f93..e48a7d8 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -19,7 +19,7 @@ #include "main.h" #include "tree.h" -#include "install.h" +#include "theme.h" #include "gettext.h" #include "openbox/render.h" diff --git a/src/install.c b/src/theme.c similarity index 98% rename from src/install.c rename to src/theme.c index 3b6af76..4cde0d7 100644 --- a/src/install.c +++ b/src/theme.c @@ -1,4 +1,4 @@ -#include "install.h" +#include "theme.h" #include "main.h" #include "gettext.h" @@ -39,6 +39,31 @@ tartype_t funcs = { (writefunc_t) gzwrite_frontend }; +gboolean theme_install(gchar *path, gchar *theme) +{ + gchar *dest; + gchar *curdir; + + if (!(dest = get_theme_dir())) + return FALSE; + + curdir = g_get_current_dir(); + if (!change_dir(dest)) { + g_free(curdir); + return FALSE; + } + + if (install_theme_to(theme, path, dest)) + gtk_msg(GTK_MESSAGE_INFO, _("%s was installed to %s"), theme, dest); + + g_free(dest); + + change_dir(curdir); + g_free(curdir); + + return TRUE; +} + static gchar *get_theme_dir() { gchar *dir; @@ -94,31 +119,6 @@ static gboolean install_theme_to(gchar *theme, gchar *file, gchar *to) return r == 0; } -gboolean install_theme(gchar *path, gchar *theme) -{ - gchar *dest; - gchar *curdir; - - if (!(dest = get_theme_dir())) - return FALSE; - - curdir = g_get_current_dir(); - if (!change_dir(dest)) { - g_free(curdir); - return FALSE; - } - - if (install_theme_to(theme, path, dest)) - gtk_msg(GTK_MESSAGE_INFO, _("%s was installed to %s"), theme, dest); - - g_free(dest); - - change_dir(curdir); - g_free(curdir); - - return TRUE; -} - static int gzopen_frontend(const char *path, int oflags, int mode) { int fd; diff --git a/src/install.h b/src/theme.h similarity index 57% rename from src/install.h rename to src/theme.h index 215bd34..e02eb6a 100644 --- a/src/install.h +++ b/src/theme.h @@ -3,6 +3,6 @@ #include -gboolean install_theme(gchar *path, gchar *theme); +gboolean theme_install(gchar *path, gchar *theme); #endif -- 2.39.2