Commit 2fb1e3f3 authored by Paolo Borelli's avatar Paolo Borelli

merge win32 branch containing the fixes needed to compile and run on windows...

merge win32 branch containing the fixes needed to compile and run on windows and the windows installer

svn path=/trunk/; revision=6727
parent 30ca9d35
2008-12-25 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/Makefile.am:
* configure.ac:
Add the -mwindows flag.
2008-12-25 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit.c:
Set the path at runtime.
2008-12-25 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-document.[ch]:
* gedit/gedit-tab.c:
Use content type instead of mime type where possible.
2008-12-24 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-plugins-engine.[ch]:
* gedit/gedit-prefs-manager.[ch]:
* gedit/gedit-prefs-manager.[ch]:
Centralize all gconf related code in the prefs manager.
2008-12-24 Paolo Borelli <pborelli@katamail.com>
* gedit/gedit-language-manager.[ch]:
* gedit/gedit-documemt.c:
Use gtk_source_language_manager_guess_language instead of
scanning mime types manually.
2008-12-23 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* win32/build-installer:
* win32/gedit.iss.in:
Include the immodules too.
2008-12-23 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* win32/build-installer:
* win32/gedit.iss.in:
Add pixbuf loaders.
2008-12-23 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* win32/build-installer:
* win32/gedit.iss.in:
Add plugin files.
2008-12-23 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit.c:
* gedit/Makefile.am:
* gedit/gedit-dirs.c:
* gedit/gedit-dirs.h:
Use dir func to manage the locale dir.
2008-12-23 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit.c:
* gedit/Makefile.am:
Use dir functions to manage the icons path.
2008-12-23 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-commands-help.c:
* gedit/Makefile.am:
Manage the logo with the dir funcs.
2008-12-23 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-dirs.c:
* gedit/gedit-dirs.h:
* gedit/gedit-plugins-engine.c:
* gedit/Makefile.am:
Use dir functions to manage the loaders and plugins.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* win32/build-installer:
* win32/gedit.iss.in:
Fix path.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-dirs.c:
Fixed bug in win32 part.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* win32/build-installer:
* win32/gedit.iss.in:
Add gconf schemas.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/dialogs/gedit-open-location-dialog.c:
* gedit/dialogs/gedit-encodings-dialog.c:
* gedit/dialogs/gedit-preferences-dialog.c:
* gedit/dialogs/gedit-style-scheme-dialog.c:
* gedit/dialogs/gedit-search-dialog.c:
* gedit/gedit-print-job.c:
* gedit/gedit-window.c:
* gedit/gedit-style-scheme-manager.c:
Use the dir functions.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-utils.c:
* gedit/gedit-utils.h:
* gedit/gedit-app.c:
* gedit/gedit-dirs.c:
* gedit/gedit-prefs-manager-app.c:
* gedit/gedit-dirs.h:
* gedit/gedit-style-scheme-manager.c:
* gedit/gedit-plugins-engine.c:
* gedit/Makefile.am:
Added gedit-dirs.[ch] to manage the dir cross platform funcs.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* win32/build-installer:
* win32/gedit.iss.in:
Fix a few paths and comment python files for now.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* win32/querymodules.bat:
* win32/Makefile.am:
* win32/build-installer:
* win32/README:
* win32/gedit.iss.in:
* configure.ac:
* Makefile.am:
Added win32 installer scripts based on glom ones.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/Makefile.am:
Change LOADER_SOURCES name to POSIXIO_FILES.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-metadata-manager.c:
Changed to use the cache dir.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-plugins-engine.c:
Include gedit-utils.h
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-metadata-manager.c:
* gedit/gedit-utils.c:
* gedit/gedit-utils.h:
* gedit/gedit-app.c:
* gedit/gedit-prefs-manager-app.c:
* gedit/gedit-style-scheme-manager.c:
* gedit/gedit-plugins-engine.c:
Use gedit_utils_get_config_dir instead of hardcoding to .gnome2.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-app.c:
Use a standard rol for all platforms.
2008-12-22 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-utils.c:
* gedit/gedit-utils.h:
Removed get_stdin function.
2008-12-21 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* configure.ac:
Use the right flags for plugin loaders.
2008-12-21 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit.c:
Changed define.
2008-12-21 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit-document-loader.c:
* gedit/gedit-document-saver.c:
* gedit/Makefile.am:
Use always the gio loader and the gio saver in
case we are in windows.
2008-12-21 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
* gedit/gedit.c:
* gedit/gedit-app.c:
* gedit/Makefile.am:
* configure.ac:
Add some ifdefs to not build bacon on windows.
2008-12-20 Paolo Borelli <pborelli@katamail.com>
* plugins/spell/gedit-spell-plugin.c:
......
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = plugin-loaders gedit pixmaps po help data plugins docs
SUBDIRS = plugin-loaders gedit pixmaps po help data plugins docs win32
distuninstallcheck_listfiles = find . -type f -print | grep -v scrollkeeper
......
......@@ -205,7 +205,8 @@ GEDIT_LIBS="${GEDIT_LIBS}"
AC_SUBST(GEDIT_LIBS)
AC_SUBST(GEDIT_CFLAGS)
if test "$platform_osx" = "no"; then
if test "$platform_osx" = "no" &&
test "$platform_win32" = no; then
PKG_CHECK_MODULES(EGG_SMCLIENT, [
sm >= 1.0.0
])
......@@ -365,15 +366,15 @@ fi
# so we create a lib
if test "$platform_win32" = yes; then
GEDIT_IMPLIB="-lgedit-$GEDIT_API_VERSION"
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -Wl,\$(top_builddir)/gedit/libgedit-\$(GEDIT_API_VERSION).a"
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -mwindows -Wl,\$(top_builddir)/gedit/libgedit-\$(GEDIT_API_VERSION).a"
LOADER_LIBTOOL_FLAGS="-module -avoid-version -no-undefined -mwindows -Wl,\$(top_builddir)/gedit/libgedit-\$(GEDIT_API_VERSION).a"
else
GEDIT_IMPLIB=""
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
LOADER_LIBTOOL_FLAGS="-module -avoid-version"
fi
AC_SUBST(GEDIT_IMPLIB)
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
LOADER_LIBTOOL_FLAGS="-module -avoid-version"
AC_SUBST(LOADER_LIBTOOL_FLAGS)
AC_CONFIG_FILES([
......@@ -416,7 +417,9 @@ plugins/sort/Makefile
plugins/spell/Makefile
plugins/taglist/Makefile
plugins/time/Makefile
po/Makefile.in])
po/Makefile.in
win32/gedit.iss
win32/Makefile])
AC_OUTPUT
......
......@@ -13,12 +13,7 @@ INCLUDES = \
$(WARN_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DGEDIT_DATADIR=\""$(datadir)/gedit-2"\" \
-DGEDIT_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
-DGEDIT_UIDIR=\""$(datadir)/gedit-2/ui/"\" \
-DGEDIT_PLUGINDIR=\""$(libdir)/gedit-2/plugins"\" \
-DGEDIT_LOADERDIR=\""$(libdir)/gedit-2/plugin-loaders"\" \
-DGEDIT_ICONDIR=\""$(datadir)/gedit-2/icons"\"
-DLIBDIR=\""$(libdir)"\"
gedit_SOURCES = \
gedit.c
......@@ -26,7 +21,7 @@ gedit_SOURCES = \
gedit_LDADD = libgedit.la $(GEDIT_LIBS) $(EGG_SMCLIENT_LIBS)
if PLATFORM_WIN32
gedit_LDFLAGS = -Wl,--export-all-symbols -Wl,--out-implib,libgedit-$(GEDIT_API_VERSION).a
gedit_LDFLAGS = -Wl,--export-all-symbols -mwindows -Wl,--out-implib,libgedit-$(GEDIT_API_VERSION).a
else
gedit_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
endif
......@@ -76,7 +71,8 @@ NOINST_H_FILES = \
gedit-prefs-manager-private.h \
sexy-icon-entry.h \
gedittextregion.h \
gedit-session.h
gedit-session.h \
gedit-dirs.h
INST_H_FILES = \
gedit-app.h \
......@@ -107,9 +103,19 @@ headerdir = $(prefix)/include/gedit-@GEDIT_API_VERSION@/gedit
header_DATA = \
$(INST_H_FILES)
if !PLATFORM_WIN32
POSIXIO_FILES = \
gedit-mmap-document-loader.c \
gedit-local-document-saver.c
else
POSIXIO_FILES =
endif
libgedit_la_SOURCES = \
$(BUILT_SOURCES) \
$(BACON_FILES) \
$(POSIXIO_FILES) \
gedit-app.c \
gedit-commands-documents.c \
gedit-commands-edit.c \
......@@ -120,12 +126,11 @@ libgedit_la_SOURCES = \
gedit-commands-view.c \
gedit-convert.c \
gedit-debug.c \
gedit-dirs.c \
gedit-document.c \
gedit-document-loader.c \
gedit-mmap-document-loader.c \
gedit-gio-document-loader.c \
gedit-document-saver.c \
gedit-local-document-saver.c \
gedit-gio-document-saver.c \
gedit-documents-panel.c \
gedit-encodings.c \
......@@ -194,15 +199,20 @@ dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)
install-exec-hook:
rm -f $(DESTDIR)$(bindir)/gnome-text-editor
ln -s gedit $(DESTDIR)$(bindir)/gnome-text-editor
if PLATFORM_WIN32
$(mkinstalldirs) "$(DESTDIR)$(libdir)"
$(INSTALL_DATA) libgedit-$(GEDIT_API_VERSION).a "$(DESTDIR)$(libdir)"
else
rm -f $(DESTDIR)$(bindir)/gnome-text-editor
ln -s gedit $(DESTDIR)$(bindir)/gnome-text-editor
endif
if !PLATFORM_WIN32
BACON_DIR=$(srcdir)/../../libbacon/src/
BACON_FILES=bacon-message-connection.h bacon-message-connection.c
regenerate-built-sources:
BACONFILES="$(BACON_FILES)" BACONDIR="$(BACON_DIR)" $(top_srcdir)/gedit/update-from-bacon.sh
else
BACON_DIR=
endif
......@@ -44,6 +44,7 @@
#include "gedit-utils.h"
#include "gedit-debug.h"
#include "gedit-help.h"
#include "gedit-dirs.h"
#define GEDIT_ENCODINGS_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GEDIT_TYPE_ENCODINGS_DIALOG, \
......@@ -300,6 +301,7 @@ gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
GtkWidget *error_widget;
int i;
gboolean ret;
gchar *file;
gchar *root_objects[] = {
"encodings-dialog-contents",
NULL
......@@ -334,7 +336,8 @@ gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
G_CALLBACK (response_handler),
dlg);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-encodings-dialog.ui",
file = gedit_dirs_get_ui_file ("gedit-encodings-dialog.ui");
ret = gedit_utils_get_ui_objects (file,
root_objects,
&error_widget,
"encodings-dialog-contents", &content,
......@@ -343,6 +346,7 @@ gedit_encodings_dialog_init (GeditEncodingsDialog *dlg)
"available-treeview", &dlg->priv->available_treeview,
"displayed-treeview", &dlg->priv->displayed_treeview,
NULL);
g_free (file);
if (!ret)
{
......
......@@ -41,6 +41,7 @@
#include "gedit-encodings-option-menu.h"
#include "gedit-utils.h"
#include "gedit-help.h"
#include "gedit-dirs.h"
#define GEDIT_OPEN_LOCATION_DIALOG_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GEDIT_TYPE_OPEN_LOCATION_DIALOG, \
......@@ -117,6 +118,7 @@ gedit_open_location_dialog_init (GeditOpenLocationDialog *dlg)
GtkWidget *encoding_hbox;
GtkWidget *error_widget;
gboolean ret;
gchar *file;
gchar *root_objects[] = {
"open_uri_dialog_content",
NULL
......@@ -154,7 +156,8 @@ gedit_open_location_dialog_init (GeditOpenLocationDialog *dlg)
G_CALLBACK (response_handler),
NULL);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-open-location-dialog.ui",
file = gedit_dirs_get_ui_file ("gedit-open-location-dialog.ui");
ret = gedit_utils_get_ui_objects (file,
root_objects,
&error_widget,
"open_uri_dialog_content", &content,
......@@ -163,6 +166,7 @@ gedit_open_location_dialog_init (GeditOpenLocationDialog *dlg)
"encoding_label", &encoding_label,
"encoding_hbox", &encoding_hbox,
NULL);
g_free (file);
if (!ret)
{
......
......@@ -48,6 +48,7 @@
#include "gedit-style-scheme-manager.h"
#include "gedit-plugin-manager.h"
#include "gedit-help.h"
#include "gedit-dirs.h"
/*
* gedit-preferences dialog is a singleton since we don't
......@@ -1062,6 +1063,7 @@ gedit_preferences_dialog_init (GeditPreferencesDialog *dlg)
{
GtkWidget *error_widget;
gboolean ret;
gchar *file;
gchar *root_objects[] = {
"notebook",
"adjustment1",
......@@ -1097,7 +1099,8 @@ gedit_preferences_dialog_init (GeditPreferencesDialog *dlg)
G_CALLBACK (dialog_response_handler),
NULL);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-preferences-dialog.ui",
file = gedit_dirs_get_ui_file ("gedit-preferences-dialog.ui");
ret = gedit_utils_get_ui_objects (file,
root_objects,
&error_widget,
......@@ -1135,6 +1138,7 @@ gedit_preferences_dialog_init (GeditPreferencesDialog *dlg)
"plugin_manager_place_holder", &dlg->priv->plugin_manager_place_holder,
NULL);
g_free (file);
if (!ret)
{
......
......@@ -40,6 +40,7 @@
#include "gedit-history-entry.h"
#include "gedit-utils.h"
#include "gedit-marshal.h"
#include "gedit-dirs.h"
#define GEDIT_SEARCH_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GEDIT_TYPE_SEARCH_DIALOG, \
......@@ -321,6 +322,7 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
GtkWidget *content;
GtkWidget *error_widget;
gboolean ret;
gchar *file;
gchar *root_objects[] = {
"search_dialog_content",
NULL
......@@ -342,7 +344,8 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dlg)->action_area), 5);
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dlg)->action_area), 6);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-search-dialog.ui",
file = gedit_dirs_get_ui_file ("gedit-search-dialog.ui");
ret = gedit_utils_get_ui_objects (file,
root_objects,
&error_widget,
"search_dialog_content", &content,
......@@ -354,6 +357,7 @@ gedit_search_dialog_init (GeditSearchDialog *dlg)
"search_backwards_checkbutton", &dlg->priv->backwards_checkbutton,
"wrap_around_checkbutton", &dlg->priv->wrap_around_checkbutton,
NULL);
g_free (file);
if (!ret)
{
......
......@@ -39,6 +39,7 @@
#include "gedit-utils.h"
#include "gedit-debug.h"
#include "gedit-help.h"
#include "gedit-dirs.h"
#define GEDIT_STYLE_SCHEME_DIALOG_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GEDIT_TYPE_STYLE_SCHEME_DIALOG, \
......@@ -121,6 +122,7 @@ gedit_style_scheme_dialog_init (GeditStyleSchemeDialog *dlg)
GtkWidget *error_widget;
GtkWidget *main_vbox;
gboolean ret;
gchar *file;
gchar *root_objects[] = {
"contents",
NULL
......@@ -147,7 +149,8 @@ gedit_style_scheme_dialog_init (GeditStyleSchemeDialog *dlg)
G_CALLBACK (dialog_response_handler),
NULL);
ret = gedit_utils_get_ui_objects (GEDIT_UIDIR "gedit-style-scheme-dialog.ui",
file = gedit_dirs_get_ui_file ("gedit-style-scheme-dialog.ui");
ret = gedit_utils_get_ui_objects (file,
root_objects,
&error_widget,
......@@ -174,6 +177,7 @@ gedit_style_scheme_dialog_init (GeditStyleSchemeDialog *dlg)
"search_hl_colorbutton", &dlg->priv->search_hl_colorbutton,
NULL);
g_free (file);
if (!ret)
{
......
......@@ -44,6 +44,7 @@
#include "gedit-debug.h"
#include "gedit-utils.h"
#include "gedit-enum-types.h"
#include "gedit-dirs.h"
#define GEDIT_PAGE_SETUP_FILE "gedit-page-setup"
......@@ -126,31 +127,12 @@ gedit_app_class_init (GeditAppClass *klass)
g_type_class_add_private (object_class, sizeof(GeditAppPrivate));
}
static gchar *
get_accel_file (void)
{
const gchar *home;
home = g_get_home_dir();
if (home != NULL)
{
return g_build_filename (home,
".gnome2",
"accels"
"gedit",
NULL);
}
return NULL;
}
static void
load_accels (void)
{
gchar *filename;
filename = get_accel_file ();
filename = gedit_dirs_get_user_accels_file ();
if (filename != NULL)
{
gedit_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename);
......@@ -164,7 +146,7 @@ save_accels (void)
{
gchar *filename;
filename = get_accel_file ();
filename = gedit_dirs_get_user_accels_file ();
if (filename != NULL)
{
gedit_debug_message (DEBUG_APP, "Saving keybindings in %s\n", filename);
......@@ -176,19 +158,20 @@ save_accels (void)
static gchar *
get_page_setup_file (void)
{
const gchar *home;
gchar *config_dir;
gchar *setup = NULL;
home = g_get_home_dir ();
if (home != NULL)
config_dir = gedit_dirs_get_user_config_dir ();
if (config_dir != NULL)
{
return g_build_filename (home,
".gnome2",
"gedit",
GEDIT_PAGE_SETUP_FILE,
NULL);
setup = g_build_filename (config_dir,
GEDIT_PAGE_SETUP_FILE,
NULL);
g_free (config_dir);
}
return NULL;
return setup;
}
static void
......@@ -248,19 +231,20 @@ save_page_setup (GeditApp *app)
static gchar *
get_print_settings_file (void)
{
const gchar *home;
gchar *config_dir;
gchar *settings = NULL;
home = g_get_home_dir ();
if (home != NULL)
config_dir = gedit_dirs_get_user_config_dir ();
if (config_dir != NULL)
{
return g_build_filename (home,
".gnome2",
"gedit",
GEDIT_PRINT_SETTINGS_FILE,
NULL);
settings = g_build_filename (config_dir,
GEDIT_PRINT_SETTINGS_FILE,
NULL);
g_free (config_dir);
}
return NULL;
return settings;
}
static void
......@@ -436,16 +420,14 @@ window_destroy (GeditWindow *window,
static gchar *
gen_role (void)
{
time_t t;
GTimeVal result;
static gint serial;
g_get_current_time (&result);
t = time (NULL);
return g_strdup_printf ("gedit-window-%d-%d-%d-%ld-%d@%s",
getpid (),
getgid (),
getppid (),
(long) t,
return g_strdup_printf ("gedit-window-%ld-%ld-%d-%s",
result.tv_sec,
result.tv_usec,
serial++,
g_get_host_name ());
}
......
......@@ -40,6 +40,7 @@
#include "gedit-commands.h"
#include "gedit-debug.h"
#include "gedit-help.h"
#include "gedit-dirs.h"
void
_gedit_cmd_help_contents (GtkAction *action,
......@@ -81,11 +82,19 @@ _gedit_cmd_help_about (GtkAction *action,
"GNOME Desktop");
GdkPixbuf *logo;
gchar *data_dir;
gchar *logo_file;
gedit_debug (DEBUG_COMMANDS);
logo = gdk_pixbuf_new_from_file (GEDIT_DATADIR "/logo/gedit-logo.png",
NULL);
data_dir = gedit_dirs_get_gedit_data_dir ();
logo_file = g_build_filename (data_dir,
"logo",
"gedit-logo.png",
NULL);
g_free (data_dir);
logo = gdk_pixbuf_new_from_file (logo_file, NULL);
g_free (logo_file);
gtk_show_about_dialog (GTK_WINDOW (window),
"program-name", "gedit",
......
/*
* gedit-dirs.c
* This file is part of gedit
*
* Copyright (C) 2008 Ignacio Casal Quinteiro
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "gedit-dirs.h"
gchar *
gedit_dirs_get_user_config_dir ()
{
gchar *config_dir = NULL;
#ifndef G_OS_WIN32
const gchar *home;
home = g_get_home_dir ();
if (home != NULL)
{
config_dir = g_build_filename (home,
".gnome2",
"gedit",
NULL);
}
#else
config_dir = g_build_filename (g_get_user_config_dir (),
"gedit",
NULL);
#endif
return config_dir;
}
gchar *
gedit_dirs_get_user_cache_dir ()
{
const gchar *cache_dir;
cache_dir = g_get_user_cache_dir ();
return g_build_filename (cache_dir,
"gedit",
NULL);
}
gchar *
gedit_dirs_get_user_accels_file ()
{
gchar *accels = NULL;
#ifndef G_OS_WIN32
const gchar *home;
home = g_get_home_dir ();
if (home != NULL)
{
/* on linux accels are stored in .gnome2/accels
* for historic reasons (backward compat with the
* old libgnome that took care of saving them */
accels = g_build_filename (home,
".gnome2",
"accels",
"gedit",
NULL);
}
#else
{
gchar *config_dir = NULL;
config_dir = gedit_dirs_get_user_config_dir ();
accels = g_build_filename (config_dir,
"accels",
"gedit",
NULL);
g_free (config_dir);
}
#endif
return accels;
}
gchar *
gedit_dirs_get_gedit_data_dir (void)