gtk: Update path references from gtk-3.0 to gtk-4.0

This commit is contained in:
Rico Tzschichholz 2016-10-23 20:06:33 +02:00
parent 66a422affc
commit 8abf05e194
13 changed files with 31 additions and 34 deletions

View File

@ -262,9 +262,9 @@ additional environment variables.
the dynamically loaded object is given as an absolute path name,
then GTK+ loads it directly.
Otherwise, GTK+ goes in turn through the directories in <envar>GTK_PATH</envar>,
followed by the directory <filename>.gtk-3.0</filename> in the user's
followed by the directory <filename>.gtk-4.0</filename> in the user's
home directory, followed by the system default directory,
which is <filename><replaceable>libdir</replaceable>/gtk-3.0/modules</filename>.
which is <filename><replaceable>libdir</replaceable>/gtk-4.0/modules</filename>.
(If <envar>GTK_EXE_PREFIX</envar> is defined, <replaceable>libdir</replaceable> is
<filename>$GTK_EXE_PREFIX/lib</filename>. Otherwise it is the libdir
specified when GTK+ was configured, usually
@ -319,7 +319,7 @@ additional environment variables.
<para>
Specifies the file listing the IM modules to load. This environment
variable the default value
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>
<filename><replaceable>libdir</replaceable>/gtk-4.0/4.0.0/immodules.cache</filename>
(<replaceable>libdir</replaceable> has the same meaning here as explained for <envar>GTK_PATH</envar>).
</para>
<para>
@ -378,7 +378,7 @@ nevertheless.
<para>
Specifies the file listing the GdkPixbuf loader modules to load.
This environment variable overrides the default value
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/loaders.cache</filename>
<filename><replaceable>libdir</replaceable>/gtk-4.0/4.0.0/loaders.cache</filename>
(<replaceable>libdir</replaceable> is the sysconfdir specified when
GTK+ was configured, usually <filename>/usr/local/lib</filename>.)
</para>

View File

@ -73,7 +73,7 @@ get_bookmarks_file (void)
GFile *file;
gchar *filename;
filename = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "bookmarks", NULL);
filename = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "bookmarks", NULL);
file = g_file_new_for_path (filename);
g_free (filename);

View File

@ -519,7 +519,7 @@ gtk_compose_hash_get_cache_path (guint32 hash)
basename = g_strdup_printf ("%08x.cache", hash);
dir = g_build_filename (g_get_user_cache_dir (), "gtk-3.0", "compose", NULL);
dir = g_build_filename (g_get_user_cache_dir (), "gtk-4.0", "compose", NULL);
path = g_build_filename (dir, basename, NULL);
if (g_mkdir_with_parents (dir, 0755) != 0)
{

View File

@ -61,7 +61,7 @@
* gtk_style_context_add_provider_for_screen().
* In addition, certain files will be read when GTK+ is initialized. First, the
* file `$XDG_CONFIG_HOME/gtk-3.0/gtk.css` is loaded if it exists. Then, GTK+
* file `$XDG_CONFIG_HOME/gtk-4.0/gtk.css` is loaded if it exists. Then, GTK+
* loads the first existing file among
* `XDG_DATA_HOME/themes/theme-name/gtk-VERSION/gtk.css`,
* `$HOME/.themes/theme-name/gtk-VERSION/gtk.css`,
@ -1924,14 +1924,11 @@ _gtk_css_provider_get_theme_dir (GtkCssProvider *provider)
/*
* Look for
* $dir/$subdir/gtk-3.16/gtk-$variant.css
* $dir/$subdir/gtk-3.14/gtk-$variant.css
* $dir/$subdir/gtk-4.16/gtk-$variant.css
* $dir/$subdir/gtk-4.14/gtk-$variant.css
* ...
* $dir/$subdir/gtk-3.0/gtk-$variant.css
* $dir/$subdir/gtk-4.0/gtk-$variant.css
* and return the first found file.
* We don't check versions before 3.14,
* since those GTK+ versions didn't have
* the versioned loading mechanism.
*/
static gchar *
_gtk_css_find_theme_dir (const gchar *dir,
@ -1960,7 +1957,7 @@ _gtk_css_find_theme_dir (const gchar *dir,
if (i < 14)
i = 0;
subsubdir = g_strdup_printf ("gtk-3.%d", i);
subsubdir = g_strdup_printf ("gtk-4.%d", i);
path = g_build_filename (base, subsubdir, file, NULL);
g_free (subsubdir);

View File

@ -150,7 +150,7 @@ custom_paper_get_filename (void)
gchar *filename;
filename = g_build_filename (g_get_user_config_dir (),
"gtk-3.0",
"gtk-4.0",
CUSTOM_PAPER_FILENAME, NULL);
g_assert (filename != NULL);
return filename;
@ -256,7 +256,7 @@ _gtk_print_save_custom_papers (GtkListStore *store)
filename = custom_paper_get_filename ();
parentdir = g_build_filename (g_get_user_config_dir (),
"gtk-3.0",
"gtk-4.0",
NULL);
if (g_mkdir_with_parents (parentdir, 0700) == 0)
{

View File

@ -54,7 +54,7 @@
* from the X11 Compose files.
*
* GtkIMContextSimple reads additional compose sequences from the first of the
* following files that is found: ~/.config/gtk-3.0/Compose, ~/.XCompose,
* following files that is found: ~/.config/gtk-4.0/Compose, ~/.XCompose,
* /usr/share/X11/locale/$locale/Compose (for locales that have a nontrivial
* Compose file). The syntax of these files is described in the Compose(5)
* manual page.
@ -161,7 +161,7 @@ gtk_im_context_simple_init_compose_table (GtkIMContextSimple *im_context_simple)
const char * const *sys_lang = NULL;
gchar *x11_compose_file_dir = get_x11_compose_file_dir ();
path = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "Compose", NULL);
path = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "Compose", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
{
gtk_im_context_simple_add_compose_file (im_context_simple, path);

View File

@ -379,9 +379,9 @@ gtk_get_im_module_file (void)
var = g_getenv ("GTK_EXE_PREFIX");
if (var)
path = g_build_filename (var, "lib", "gtk-3.0", GTK_BINARY_VERSION, "immodules.cache", NULL);
path = g_build_filename (var, "lib", "gtk-4.0", GTK_BINARY_VERSION, "immodules.cache", NULL);
else
path = g_build_filename (_gtk_get_libdir (), "gtk-3.0", GTK_BINARY_VERSION, "immodules.cache", NULL);
path = g_build_filename (_gtk_get_libdir (), "gtk-4.0", GTK_BINARY_VERSION, "immodules.cache", NULL);
return path;
}

View File

@ -65,9 +65,9 @@ get_module_path (void)
exe_prefix = g_getenv ("GTK_EXE_PREFIX");
if (exe_prefix)
default_dir = g_build_filename (exe_prefix, "lib", "gtk-3.0", NULL);
default_dir = g_build_filename (exe_prefix, "lib", "gtk-4.0", NULL);
else
default_dir = g_build_filename (_gtk_get_libdir (), "gtk-3.0", NULL);
default_dir = g_build_filename (_gtk_get_libdir (), "gtk-4.0", NULL);
if (module_path_env)
module_path = g_build_path (G_SEARCHPATH_SEPARATOR_S,

View File

@ -187,7 +187,7 @@ server_list_load (GtkPlacesView *view)
priv = gtk_places_view_get_instance_private (view);
bookmarks = g_bookmark_file_new ();
datadir = g_build_filename (g_get_user_config_dir (), "gtk-3.0", NULL);
datadir = g_build_filename (g_get_user_config_dir (), "gtk-4.0", NULL);
filename = g_build_filename (datadir, "servers", NULL);
g_mkdir_with_parents (datadir, 0700);
@ -245,7 +245,7 @@ server_list_save (GBookmarkFile *bookmarks)
{
gchar *filename;
filename = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "servers", NULL);
filename = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "servers", NULL);
g_bookmark_file_to_file (bookmarks, filename, NULL);
g_free (filename);
}

View File

@ -77,8 +77,8 @@
* utilities that let the user change these settings. In the absence of
* an Xsettings manager, GTK+ reads default values for settings from
* `settings.ini` files in
* `/etc/gtk-3.0`, `$XDG_CONFIG_DIRS/gtk-3.0`
* and `$XDG_CONFIG_HOME/gtk-3.0`.
* `/etc/gtk-4.0`, `$XDG_CONFIG_DIRS/gtk-4.0`
* and `$XDG_CONFIG_HOME/gtk-4.0`.
* These files must be valid key files (see #GKeyFile), and have
* a section called Settings. Themes can also provide default values
* for settings by installing a `settings.ini` file
@ -301,12 +301,12 @@ gtk_settings_init (GtkSettings *settings)
}
g_free (pspecs);
path = g_build_filename (_gtk_get_data_prefix (), "share", "gtk-3.0", "settings.ini", NULL);
path = g_build_filename (_gtk_get_data_prefix (), "share", "gtk-4.0", "settings.ini", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
g_free (path);
path = g_build_filename (_gtk_get_sysconfdir (), "gtk-3.0", "settings.ini", NULL);
path = g_build_filename (_gtk_get_sysconfdir (), "gtk-4.0", "settings.ini", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
g_free (path);
@ -314,13 +314,13 @@ gtk_settings_init (GtkSettings *settings)
config_dirs = g_get_system_config_dirs ();
for (i = 0; config_dirs[i] != NULL; i++)
{
path = g_build_filename (config_dirs[i], "gtk-3.0", "settings.ini", NULL);
path = g_build_filename (config_dirs[i], "gtk-4.0", "settings.ini", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
g_free (path);
}
path = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "settings.ini", NULL);
path = g_build_filename (g_get_user_config_dir (), "gtk-4.0", "settings.ini", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
g_free (path);
@ -1158,7 +1158,7 @@ settings_init_style (GtkSettings *settings)
css_provider = gtk_css_provider_new ();
css_path = g_build_filename (g_get_user_config_dir (),
"gtk-3.0",
"gtk-4.0",
"gtk.css",
NULL);

View File

@ -110,7 +110,7 @@
* to make your style information prevail to the themes, so you must use
* a #GtkStyleProvider with the %GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
* priority, keep in mind that the user settings in
* `XDG_CONFIG_HOME/gtk-3.0/gtk.css` will
* `XDG_CONFIG_HOME/gtk-4.0/gtk.css` will
* still take precedence over your changes, as it uses the
* %GTK_STYLE_PROVIDER_PRIORITY_USER priority.
*/

View File

@ -77,7 +77,7 @@ G_BEGIN_DECLS
* GTK_STYLE_PROVIDER_PRIORITY_USER:
*
* The priority used for the style information from
* `~/.gtk-3.0.css`.
* `~/.gtk-4.0.css`.
*
* You should not use priorities higher than this, to
* give the user the last word.

View File

@ -281,7 +281,7 @@ fill_gtk (const gchar *path,
while ((dir_entry = g_dir_read_name (dir)))
{
gchar *filename = g_build_filename (path, dir_entry, "gtk-3.0", "gtk.css", NULL);
gchar *filename = g_build_filename (path, dir_entry, "gtk-4.0", "gtk.css", NULL);
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR) &&
!g_hash_table_contains (t, dir_entry))