From ec52555862913a23417735f9f7f5402f5230da13 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 17:59:36 +0200 Subject: Adding upstream version 3.38.2. Signed-off-by: Daniel Baumann --- data/.gitignore | 7 + data/dbus-interfaces.xml | 59 +++ data/dbus-interfaces2.xml | 84 ++++ data/freedesktop-dbus-interfaces.xml | 43 ++ .../hicolor/scalable/apps/org.gnome.Nautilus.svg | 253 +++++++++++ .../scalable/apps/org.gnome.NautilusDevel.svg | 1 + .../symbolic/apps/org.gnome.Nautilus-symbolic.svg | 30 ++ data/lineup-parameters.c | 483 +++++++++++++++++++++ data/meson.build | 142 ++++++ data/nautilus-autorun-software.desktop.in | 11 + data/ontology/meson.build | 8 + data/ontology/nautilus.description | 9 + data/ontology/nautilus.ontology | 20 + data/org.freedesktop.FileManager1.service.in | 3 + data/org.gnome.Nautilus.appdata.xml.in.in | 62 +++ data/org.gnome.Nautilus.desktop.in.in | 20 + data/org.gnome.Nautilus.search-provider.ini.in | 5 + data/org.gnome.Nautilus.service.in | 3 + data/org.gnome.nautilus.gschema.xml | 287 ++++++++++++ data/run-uncrustify.sh | 26 ++ data/shell-search-provider-dbus-interfaces.xml | 44 ++ data/tracker/meson.build | 31 ++ ...nome.Nautilus.Tracker3.Miner.Extract.service.in | 7 + ....gnome.Nautilus.Tracker3.Miner.Files.service.in | 7 + data/tracker/org.gnome.Nautilus.domain.rule.in | 21 + data/uncrustify.cfg | 135 ++++++ 26 files changed, 1801 insertions(+) create mode 100644 data/.gitignore create mode 100644 data/dbus-interfaces.xml create mode 100644 data/dbus-interfaces2.xml create mode 100644 data/freedesktop-dbus-interfaces.xml create mode 100644 data/icons/hicolor/scalable/apps/org.gnome.Nautilus.svg create mode 100644 data/icons/hicolor/scalable/apps/org.gnome.NautilusDevel.svg create mode 100644 data/icons/hicolor/symbolic/apps/org.gnome.Nautilus-symbolic.svg create mode 100644 data/lineup-parameters.c create mode 100644 data/meson.build create mode 100644 data/nautilus-autorun-software.desktop.in create mode 100644 data/ontology/meson.build create mode 100644 data/ontology/nautilus.description create mode 100644 data/ontology/nautilus.ontology create mode 100644 data/org.freedesktop.FileManager1.service.in create mode 100644 data/org.gnome.Nautilus.appdata.xml.in.in create mode 100644 data/org.gnome.Nautilus.desktop.in.in create mode 100644 data/org.gnome.Nautilus.search-provider.ini.in create mode 100644 data/org.gnome.Nautilus.service.in create mode 100644 data/org.gnome.nautilus.gschema.xml create mode 100755 data/run-uncrustify.sh create mode 100644 data/shell-search-provider-dbus-interfaces.xml create mode 100644 data/tracker/meson.build create mode 100644 data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in create mode 100644 data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in create mode 100644 data/tracker/org.gnome.Nautilus.domain.rule.in create mode 100644 data/uncrustify.cfg (limited to 'data') diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..89808d7 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1,7 @@ +/lineup-parameters +/nautilus-autorun-software.desktop +/org.freedesktop.FileManager1.service +/org.gnome.Nautilus.appdata.xml +/org.gnome.Nautilus.desktop +/org.gnome.Nautilus.service +/org.gnome.nautilus.gschema.valid diff --git a/data/dbus-interfaces.xml b/data/dbus-interfaces.xml new file mode 100644 index 0000000..a388af0 --- /dev/null +++ b/data/dbus-interfaces.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/dbus-interfaces2.xml b/data/dbus-interfaces2.xml new file mode 100644 index 0000000..8216be0 --- /dev/null +++ b/data/dbus-interfaces2.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/freedesktop-dbus-interfaces.xml b/data/freedesktop-dbus-interfaces.xml new file mode 100644 index 0000000..d648205 --- /dev/null +++ b/data/freedesktop-dbus-interfaces.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/icons/hicolor/scalable/apps/org.gnome.Nautilus.svg b/data/icons/hicolor/scalable/apps/org.gnome.Nautilus.svg new file mode 100644 index 0000000..dea3e0f --- /dev/null +++ b/data/icons/hicolor/scalable/apps/org.gnome.Nautilus.svg @@ -0,0 +1,253 @@ + + + Adwaita Icon Template + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + GNOME Design Team + + + + + Adwaita Icon Template + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/icons/hicolor/scalable/apps/org.gnome.NautilusDevel.svg b/data/icons/hicolor/scalable/apps/org.gnome.NautilusDevel.svg new file mode 100644 index 0000000..d64ac0f --- /dev/null +++ b/data/icons/hicolor/scalable/apps/org.gnome.NautilusDevel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/icons/hicolor/symbolic/apps/org.gnome.Nautilus-symbolic.svg b/data/icons/hicolor/symbolic/apps/org.gnome.Nautilus-symbolic.svg new file mode 100644 index 0000000..2281d98 --- /dev/null +++ b/data/icons/hicolor/symbolic/apps/org.gnome.Nautilus-symbolic.svg @@ -0,0 +1,30 @@ + + + + + + + + image/svg+xml + + Gnome Symbolic Icon Theme + + + + + + + Gnome Symbolic Icon Theme + + + + + + + + + + + + + diff --git a/data/lineup-parameters.c b/data/lineup-parameters.c new file mode 100644 index 0000000..51a01e1 --- /dev/null +++ b/data/lineup-parameters.c @@ -0,0 +1,483 @@ +/* + * This file is part of gnome-c-utils. + * + * Copyright © 2013 Sébastien Wilmet + * + * gnome-c-utils 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 3 of the License, or + * (at your option) any later version. + * + * gnome-c-utils 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 gnome-c-utils. If not, see . + */ + +/* + * Line up parameters of function declarations. + * + * Usage: lineup-parameters [file] + * If the file is not given, stdin is read. + * The result is printed to stdout. + * + * The restrictions: + * - The function name must be at column 0, followed by a space and an opening + * parenthesis; + * - One parameter per line; + * - A paramater must follow certain rules (see the regex in the code), but it + * doesn't accept all possibilities of the C language. + * - The opening curly brace ("{") of the function must also be at column 0. + * + * If one restriction is missing, the function declaration is not modified. + * + * Example: + * + * gboolean + * frobnitz (Frobnitz *frobnitz, + * gint magic_number, + * GError **error) + * { + * ... + * } + * + * Becomes: + * + * gboolean + * frobnitz (Frobnitz *frobnitz, + * gint magic_number, + * GError **error) + * { + * ... + * } + */ + +/* + * Use with Vim: + * + * Although this script can be used in Vim (or other text editors), a Vim plugin + * exists: + * http://damien.lespiau.name/blog/2009/12/07/aligning-c-function-parameters-with-vim/ + * + * You can use a selection: + * - place the cursor at the function's name; + * - press V to start the line selection; + * - press ]] to go to the "{"; + * - type ":" followed by "!lineup-parameters". + * + * Note: the "{" is required in the selection, to detect that we are in a + * function declaration. + * + * You can easily map these steps with a keybinding (F8 in the example below). + * Note that I'm not a Vim expert, so there is maybe a better way to configure + * this stuff. + * + * function! LineupParameters() + * let l:winview = winsaveview() + * execute "normal {V]]:!lineup-parameters\" + * call winrestview(l:winview) + * endfunction + * + * autocmd Filetype c map :call LineupParameters() + */ + +/* TODO support "..." vararg parameter. */ + +#include +#include +#include +#include +#include +#include + +#define USE_TABS FALSE + +typedef struct +{ + gchar *type; + guint nb_stars; + gchar *name; +} ParameterInfo; + +static void +parameter_info_free (ParameterInfo *param_info) +{ + g_free (param_info->type); + g_free (param_info->name); + g_slice_free (ParameterInfo, param_info); +} + +static gboolean +match_function_name (const gchar *line, + gchar **function_name, + gint *first_param_pos) +{ + static GRegex *regex = NULL; + GMatchInfo *match_info; + gint end_pos; + gboolean match = FALSE; + + if (G_UNLIKELY (regex == NULL)) + regex = g_regex_new ("^(\\w+) ?\\(", G_REGEX_OPTIMIZE, 0, NULL); + + g_regex_match (regex, line, 0, &match_info); + + if (g_match_info_matches (match_info) && + g_match_info_fetch_pos (match_info, 1, NULL, &end_pos) && + g_match_info_fetch_pos (match_info, 0, NULL, first_param_pos)) + { + match = TRUE; + + if (function_name != NULL) + *function_name = g_strndup (line, end_pos); + } + + g_match_info_free (match_info); + return match; +} + +static gboolean +match_parameter (gchar *line, + ParameterInfo **info, + gboolean *is_last_parameter) +{ + static GRegex *regex = NULL; + GMatchInfo *match_info; + gint start_pos = 0; + + if (G_UNLIKELY (regex == NULL)) + regex = g_regex_new ("^\\s*(?(const\\s+)?\\w+)\\s+(?\\**)\\s*(?\\w+)\\s*(?,|\\))\\s*$", + G_REGEX_OPTIMIZE, + 0, + NULL); + + if (is_last_parameter != NULL) + *is_last_parameter = FALSE; + + match_function_name (line, NULL, &start_pos); + + g_regex_match (regex, line + start_pos, 0, &match_info); + + if (!g_match_info_matches (match_info)) + { + g_match_info_free (match_info); + return FALSE; + } + + if (info != NULL) + { + gchar *stars; + + *info = g_slice_new0 (ParameterInfo); + + (*info)->type = g_match_info_fetch_named (match_info, "type"); + (*info)->name = g_match_info_fetch_named (match_info, "name"); + g_assert ((*info)->type != NULL); + g_assert ((*info)->name != NULL); + + stars = g_match_info_fetch_named (match_info, "stars"); + (*info)->nb_stars = strlen (stars); + g_free (stars); + } + + if (is_last_parameter != NULL) + { + gchar *end = g_match_info_fetch_named (match_info, "end"); + *is_last_parameter = g_str_equal (end, ")"); + g_free (end); + } + + g_match_info_free (match_info); + return TRUE; +} + +static gboolean +match_opening_curly_brace (const gchar *line) +{ + static GRegex *regex = NULL; + + if (G_UNLIKELY (regex == NULL)) + regex = g_regex_new ("^{\\s*$", G_REGEX_OPTIMIZE, 0, NULL); + + return g_regex_match (regex, line, 0, NULL); +} + +/* Returns the number of lines that take the function declaration. + * Returns 0 if not a function declaration. */ +static guint +get_function_declaration_length (gchar **lines) +{ + guint nb_lines = 1; + gchar **cur_line = lines; + + while (*cur_line != NULL) + { + gboolean match_param; + gboolean is_last_param; + + match_param = match_parameter (*cur_line, NULL, &is_last_param); + + if (is_last_param) + { + gchar *next_line = *(cur_line + 1); + + if (next_line == NULL || + !match_opening_curly_brace (next_line)) + return 0; + + return nb_lines; + } + + if (!match_param) + return 0; + + nb_lines++; + cur_line++; + } + /* should not be reachable - but silences a compiler warning */ + return 0; +} + +static GSList * +get_list_parameter_infos (gchar **lines, + guint length) +{ + GSList *list = NULL; + gint i; + + for (i = length - 1; i >= 0; i--) + { + ParameterInfo *info = NULL; + + match_parameter (lines[i], &info, NULL); + g_assert (info != NULL); + + list = g_slist_prepend (list, info); + } + + return list; +} + +static void +compute_spacing (GSList *parameter_infos, + guint *max_type_length, + guint *max_stars_length) +{ + GSList *l; + *max_type_length = 0; + *max_stars_length = 0; + + for (l = parameter_infos; l != NULL; l = l->next) + { + ParameterInfo *info = l->data; + guint type_length = strlen (info->type); + + if (type_length > *max_type_length) + *max_type_length = type_length; + + if (info->nb_stars > *max_stars_length) + *max_stars_length = info->nb_stars; + } +} + +static void +print_parameter (ParameterInfo *info, + guint max_type_length, + guint max_stars_length) +{ + gint type_length; + gint nb_spaces; + gchar *spaces; + gchar *stars; + + g_print ("%s", info->type); + + type_length = strlen (info->type); + nb_spaces = max_type_length - type_length; + g_assert (nb_spaces >= 0); + + spaces = g_strnfill (nb_spaces, ' '); + g_print ("%s ", spaces); + g_free (spaces); + + nb_spaces = max_stars_length - info->nb_stars; + g_assert (nb_spaces >= 0); + spaces = g_strnfill (nb_spaces, ' '); + g_print ("%s", spaces); + g_free (spaces); + + stars = g_strnfill (info->nb_stars, '*'); + g_print ("%s", stars); + g_free (stars); + + g_print ("%s", info->name); +} + +static void +print_function_declaration (gchar **lines, + guint length) +{ + gchar **cur_line = lines; + gchar *function_name; + gint nb_spaces_to_parenthesis; + GSList *parameter_infos; + GSList *l; + guint max_type_length; + guint max_stars_length; + gchar *spaces; + + if (!match_function_name (*cur_line, &function_name, NULL)) + g_error ("The line doesn't match a function name."); + + g_print ("%s (", function_name); + + nb_spaces_to_parenthesis = strlen (function_name) + 2; + + if (USE_TABS) + { + gchar *tabs = g_strnfill (nb_spaces_to_parenthesis / 8, '\t'); + gchar *spaces_after_tabs = g_strnfill (nb_spaces_to_parenthesis % 8, ' '); + + spaces = g_strdup_printf ("%s%s", tabs, spaces_after_tabs); + + g_free (tabs); + g_free (spaces_after_tabs); + } + else + { + spaces = g_strnfill (nb_spaces_to_parenthesis, ' '); + } + + parameter_infos = get_list_parameter_infos (lines, length); + compute_spacing (parameter_infos, &max_type_length, &max_stars_length); + + for (l = parameter_infos; l != NULL; l = l->next) + { + ParameterInfo *info = l->data; + + if (l != parameter_infos) + g_print ("%s", spaces); + + print_parameter (info, max_type_length, max_stars_length); + + if (l->next != NULL) + g_print (",\n"); + } + + g_print (")\n"); + + g_free (function_name); + g_free (spaces); + g_slist_free_full (parameter_infos, (GDestroyNotify)parameter_info_free); +} + +static void +parse_contents (gchar **lines) +{ + gchar **cur_line = lines; + + /* Skip the empty last line, to avoid adding an extra \n. */ + for (cur_line = lines; cur_line[0] != NULL && cur_line[1] != NULL; cur_line++) + { + guint length; + + if (!match_function_name (*cur_line, NULL, NULL)) + { + g_print ("%s\n", *cur_line); + continue; + } + + length = get_function_declaration_length (cur_line); + + if (length == 0) + { + g_print ("%s\n", *cur_line); + continue; + } + + print_function_declaration (cur_line, length); + + cur_line += length - 1; + } +} + +static gchar * +get_file_contents (gchar *arg) +{ + GFile *file; + gchar *path; + gchar *contents; + GError *error = NULL; + + file = g_file_new_for_commandline_arg (arg); + path = g_file_get_path (file); + g_file_get_contents (path, &contents, NULL, &error); + + if (error != NULL) + g_error ("Impossible to get file contents: %s", error->message); + + g_object_unref (file); + g_free (path); + return contents; +} + +static gchar * +get_stdin_contents (void) +{ + GInputStream *stream; + GString *string; + GError *error = NULL; + + stream = g_unix_input_stream_new (STDIN_FILENO, FALSE); + string = g_string_new (""); + + while (TRUE) + { + gchar buffer[4097] = { '\0' }; + gssize nb_bytes_read = g_input_stream_read (stream, buffer, 4096, NULL, &error); + + if (nb_bytes_read == 0) + break; + + if (error != NULL) + g_error ("Impossible to read stdin: %s", error->message); + + g_string_append (string, buffer); + } + + g_input_stream_close (stream, NULL, NULL); + g_object_unref (stream); + + return g_string_free (string, FALSE); +} + +gint +main (gint argc, + gchar *argv[]) +{ + gchar *contents; + gchar **contents_lines; + + setlocale (LC_ALL, ""); + + if (argc > 2) + { + g_printerr ("Usage: %s [file]\n", argv[0]); + return EXIT_FAILURE; + } + + if (argc == 2) + contents = get_file_contents (argv[1]); + else + contents = get_stdin_contents (); + + contents_lines = g_strsplit (contents, "\n", 0); + g_free (contents); + + parse_contents (contents_lines); + + return EXIT_SUCCESS; +} diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..9a4e2ff --- /dev/null +++ b/data/meson.build @@ -0,0 +1,142 @@ +icondir = join_paths('icons', 'hicolor', 'scalable', 'apps') +install_data( + join_paths(icondir, 'org.gnome.Nautilus' + profile + '.svg'), + install_dir: join_paths(datadir, icondir), + rename: '@0@.svg'.format(application_id) +) + +icondir = join_paths('icons', 'hicolor', 'symbolic', 'apps') + +install_data( + join_paths(icondir, 'org.gnome.Nautilus-symbolic.svg'), + install_dir: join_paths(datadir, icondir), + rename: '@0@-symbolic.svg'.format(application_id) +) + +po_dir = join_paths(meson.source_root(), 'po') + +line_up_parameters = executable( + 'lineup-parameters', + 'lineup-parameters.c', + build_by_default: false, + dependencies: [ + gio, + gio_unix, + ] +) + +desktop_conf = configuration_data() + +desktop_conf.set('icon', application_id) + +desktop = i18n.merge_file( + 'desktop', + input: configure_file( + input: files('org.gnome.Nautilus.desktop.in.in'), + output: 'org.gnome.Nautilus.desktop.in', + configuration: desktop_conf + ), + output: '@0@.desktop'.format(application_id), + install: true, + install_dir: desktopdir, + po_dir: po_dir, + type: 'desktop' +) + +desktop_autorun_software = i18n.merge_file( + 'desktop-autorun-software', + input: 'nautilus-autorun-software.desktop.in', + output: 'nautilus-autorun-software.desktop', + install: true, + install_dir: desktopdir, + po_dir: po_dir, + type: 'desktop' +) + +appdata_conf = configuration_data() + +appdata_conf.set('appid', application_id) + +appdata = i18n.merge_file( + 'appdata', + input: configure_file( + input: files('org.gnome.Nautilus.appdata.xml.in.in'), + output: 'org.gnome.Nautilus.appdata.xml.in', + configuration: appdata_conf + ), + output: '@0@.appdata.xml'.format(application_id), + install: true, + install_dir: join_paths(datadir, 'metainfo'), + po_dir: po_dir +) + +service_conf = configuration_data() +service_conf.set('appid', application_id) +service_conf.set('bindir', join_paths(prefix, bindir)) + +configure_file( + input: 'org.gnome.Nautilus.service.in', + output: '@0@.service'.format(application_id), + configuration: service_conf, + install_dir: servicedir +) + +configure_file( + input: 'org.freedesktop.FileManager1.service.in', + output: 'org.freedesktop.FileManager1.service', + configuration: service_conf, + install_dir: servicedir +) + +search_provider_conf = configuration_data() + +search_provider_conf.set('appid', application_id) +search_provider_conf.set('profile', profile) + +configure_file( + configuration: search_provider_conf, + input: files('org.gnome.Nautilus.search-provider.ini.in'), + install_dir: join_paths(datadir, 'gnome-shell', 'search-providers'), + output: '@0@.search-provider.ini'.format(application_id) +) + +gnome.compile_schemas( + build_by_default: true, + depend_files: 'org.gnome.nautilus.gschema.xml' +) + +install_data( + 'org.gnome.nautilus.gschema.xml', + install_dir: join_paths(datadir, 'glib-2.0', 'schemas') +) + +desktop_file_validate = find_program('desktop-file-validate', required: false) +if desktop_file_validate.found() + test( + 'validate-desktop', + desktop_file_validate, + args: [ + desktop.full_path() + ] + ) + test( + 'validate-desktop-autorun-software', + desktop_file_validate, + args: [ + desktop_autorun_software.full_path() + ] + ) +endif + +appstream_util = find_program('appstream-util', required: false) +if appstream_util.found() + test( + 'validate-appdata', appstream_util, + args: [ + 'validate-relax', '--nonet', appdata.full_path() + ] + ) +endif + +subdir('ontology') +subdir('tracker') diff --git a/data/nautilus-autorun-software.desktop.in b/data/nautilus-autorun-software.desktop.in new file mode 100644 index 0000000..a42c94e --- /dev/null +++ b/data/nautilus-autorun-software.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Run Software +TryExec=nautilus-autorun-software +Exec=nautilus-autorun-software %u +# Translators: Do NOT translate or transliterate this text (this is an icon file name)! +Icon=application-x-executable +NoDisplay=true +Terminal=false +StartupNotify=true +Type=Application +MimeType=x-content/unix-software; diff --git a/data/ontology/meson.build b/data/ontology/meson.build new file mode 100644 index 0000000..cb80e86 --- /dev/null +++ b/data/ontology/meson.build @@ -0,0 +1,8 @@ +ontology_data = files( + 'nautilus.description', + 'nautilus.ontology', +) + +install_data(ontology_data, + install_dir: join_paths(datadir, 'nautilus', 'ontology') +) diff --git a/data/ontology/nautilus.description b/data/ontology/nautilus.description new file mode 100644 index 0000000..42f4102 --- /dev/null +++ b/data/ontology/nautilus.description @@ -0,0 +1,9 @@ +@prefix dsc: . + + a dsc:Ontology ; + dsc:title "Nautilus ontology" ; + dsc:description "Tracker database schema for Nautilus private data." ; + + dsc:localPrefix "nautilus" ; + dsc:baseUrl "https://gitlab.gnome.org/GNOME/nautilus#" ; + dsc:relativePath "./nautilus.ontology" ; diff --git a/data/ontology/nautilus.ontology b/data/ontology/nautilus.ontology new file mode 100644 index 0000000..a3706bc --- /dev/null +++ b/data/ontology/nautilus.ontology @@ -0,0 +1,20 @@ +@prefix rdf: . +@prefix rdfs: . +@prefix xsd: . +@prefix nrl: . +@prefix nautilus: . + +nautilus: a nrl:Namespace, nrl:Ontology ; + nrl:prefix "nautilus" ; + nrl:lastModified "2020-05-01T10:00:00Z" . + +nautilus:File a rdfs:Class ; + rdfs:comment "Represents a file on disk by its URL. Equivalent to http://tracker.api.gnome.org/ontology/v3/nfo#FileDataObject" ; + rdfs:subClassOf rdfs:Resource ; + nrl:notify true . + +nautilus:starred a rdf:Property ; + rdfs:comment "Marks files that are starred in Nautilus." ; + rdfs:domain nautilus:File ; + rdfs:range xsd:boolean ; + nrl:maxCardinality 1 . diff --git a/data/org.freedesktop.FileManager1.service.in b/data/org.freedesktop.FileManager1.service.in new file mode 100644 index 0000000..6a0bbe0 --- /dev/null +++ b/data/org.freedesktop.FileManager1.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.freedesktop.FileManager1 +Exec=@bindir@/nautilus --gapplication-service diff --git a/data/org.gnome.Nautilus.appdata.xml.in.in b/data/org.gnome.Nautilus.appdata.xml.in.in new file mode 100644 index 0000000..aa8f508 --- /dev/null +++ b/data/org.gnome.Nautilus.appdata.xml.in.in @@ -0,0 +1,62 @@ + + + @appid@.desktop + CC0-1.0 + Files + Access and organize files + +

+ Files, also known as Nautilus, is the default file manager of the GNOME desktop. + It provides a simple and integrated way of managing your files and browsing your file system. +

+

+ Nautilus supports all the basic functions of a file manager and more. + It can search and manage your files and folders, both locally and on a network, + read and write data to and from removable media, run scripts, and launch applications. + It has three views: Icon Grid, Icon List, and Tree List. + Its functions can be extended with plugins and scripts. +

+
+ + System + + https://gitlab.gnome.org/GNOME/nautilus/issues + https://www.gnome.org/support-gnome/ + https://wiki.gnome.org/action/show/Apps/Nautilus + https://wiki.gnome.org/action/show/Apps/Nautilus + https://wiki.gnome.org/TranslationProject + @appid@.desktop + + + + GNOME + GPL-2.0+ + The GNOME Project + + + https://static.gnome.org/appdata/nautilus/nautilus-201901141.png + Tile View + + + https://static.gnome.org/appdata/nautilus/nautilus-201901142.png + List View + + + https://static.gnome.org/appdata/nautilus/nautilus-201901143.png + Search + + + https://static.gnome.org/appdata/nautilus/nautilus-201901144.png + Other Locations + + + nautilus-list@gnome.org + nautilus + + HiDpiIcon + ModernToolkit + Notifications + SearchProvider + +
+ diff --git a/data/org.gnome.Nautilus.desktop.in.in b/data/org.gnome.Nautilus.desktop.in.in new file mode 100644 index 0000000..42e0c27 --- /dev/null +++ b/data/org.gnome.Nautilus.desktop.in.in @@ -0,0 +1,20 @@ +[Desktop Entry] +Name=Files +Comment=Access and organize files +# Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon! +Keywords=folder;manager;explore;disk;filesystem;nautilus; +Exec=nautilus --new-window %U +# Translators: Do NOT translate or transliterate this text (this is an icon file name)! +Icon=@icon@ +Terminal=false +Type=Application +DBusActivatable=true +StartupNotify=true +Categories=GNOME;GTK;Utility;Core;FileManager; +MimeType=inode/directory;application/x-7z-compressed;application/x-7z-compressed-tar;application/x-bzip;application/x-bzip-compressed-tar;application/x-compress;application/x-compressed-tar;application/x-cpio;application/x-gzip;application/x-lha;application/x-lzip;application/x-lzip-compressed-tar;application/x-lzma;application/x-lzma-compressed-tar;application/x-tar;application/x-tarz;application/x-xar;application/x-xz;application/x-xz-compressed-tar;application/zip;application/gzip;application/bzip2; +X-GNOME-UsesNotifications=true +Actions=new-window; + +[Desktop Action new-window] +Name=New Window +Exec=nautilus --new-window diff --git a/data/org.gnome.Nautilus.search-provider.ini.in b/data/org.gnome.Nautilus.search-provider.ini.in new file mode 100644 index 0000000..0ef7f79 --- /dev/null +++ b/data/org.gnome.Nautilus.search-provider.ini.in @@ -0,0 +1,5 @@ +[Shell Search Provider] +DesktopId=@appid@.desktop +BusName=@appid@ +ObjectPath=/org/gnome/Nautilus@profile@/SearchProvider +Version=2 diff --git a/data/org.gnome.Nautilus.service.in b/data/org.gnome.Nautilus.service.in new file mode 100644 index 0000000..55505ef --- /dev/null +++ b/data/org.gnome.Nautilus.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=@appid@ +Exec=@bindir@/nautilus --gapplication-service diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml new file mode 100644 index 0000000..941812e --- /dev/null +++ b/data/org.gnome.nautilus.gschema.xml @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 'after-current-tab' + Where to position newly open tabs in browser windows + If set to “after-current-tab”, then new tabs are inserted after the current tab. If set to “end”, then new tabs are appended to the end of the tab list. + + + false + Always use the location entry, instead of the pathbar + If set to true, then Nautilus browser windows will always use a textual input entry for the location toolbar, instead of the pathbar. + + + 'local-only' + Where to perform recursive search + In which locations Nautilus should search on subfolders. Available values are “local-only”, “always”, “never”. + + + 'last_modified' + Filter the search dates using either last used or last modified + Filter the search dates using either last used or last modified. + + + false + Whether to show a context menu item to delete permanently + If set to true, then Nautilus will show a delete permanently context menu item to bypass the Trash. + + + false + Whether to show context menu items to create links from copied or selected files + If set to true, then Nautilus will show context menu items to create links from the copied or selected files. + + + true + Whether to ask for confirmation when deleting files, or emptying the Trash + If set to true, then Nautilus will ask for confirmation when you attempt to delete files, or empty the Trash. + + + + 'local-only' + When to show number of items in a folder + Speed tradeoff for when to show the number of items in a folder. If set to “always” then always show item counts, even if the folder is on a remote server. If set to “local-only” then only show counts for local file systems. If set to “never” then never bother to compute item counts. + + + 'double' + Type of click used to launch/open files + Possible values are “single” to launch files on a single click, or “double” to launch them on a double click. + + + 'display' + What to do with executable text files when activated + What to do with executable text files when they are activated (single or double clicked). Possible values are “launch” to launch them as programs, “ask” to ask what to do via a dialog, and “display” to display them as text files. + + + true + Show the package installer for unknown MIME types + Whether to show the user a package installer dialog in case an unknown MIME type is opened, in order to search for an application to handle it. + + + true + Use extra mouse button events in Nautilus’ browser window + For users with mice that have “Forward” and “Back” buttons, this key will determine if any action is taken inside of Nautilus when either is pressed. + + + 9 + Mouse button to activate the “Forward” command in browser window + For users with mice that have buttons for “Forward” and “Back”, this key will set which button activates the “Forward” command in a browser window. Possible values range between 6 and 14. + + + 8 + Mouse button to activate the “Back” command in browser window + For users with mice that have buttons for “Forward” and “Back”, this key will set which button activates the “Back” command in a browser window. Possible values range between 6 and 14. + + + + 'local-only' + When to show thumbnails of files + Speed trade-off for when to show a file as a thumbnail. If set to “always” then always thumbnail, even if the folder is on a remote server. If set to “local-only” then only show thumbnails for local file systems. If set to “never” then never bother to thumbnail files, just use a generic icon. Despite what the name may suggest, this applies to any previewable file type. + + + + 10 + Maximum image size for thumbnailing + Images over this size (in megabytes) won’t be thumbnailed. The purpose of this setting is to avoid thumbnailing large images that may take a long time to load or use lots of memory. + + + + + + 'name' + Default sort order + The default sort-order for items in the icon view. Possible values are “name”, “size”, “type”, “mtime”, “atime” and “starred”. + + + false + Reverse sort order in new windows + If true, files in new windows will be sorted in reverse order. I.e., if sorted by name, then instead of sorting the files from “a” to “z”, they will be sorted from “z” to “a”; if sorted by size, instead of being incrementally they will be sorted decrementally. + + + + + + + + + 'icon-view' + Default folder viewer + When a folder is visited this viewer is used unless you have selected another view for that particular folder. Possible values are “list-view”, and “icon-view”. + + + false + Whether to show hidden files + This key is deprecated and ignored. The “show-hidden” key from “org.gtk.Settings.FileChooser” is now used instead. + + + 'list-view' + What viewer should be used when searching + When searching Nautilus will switch to the type of view in this setting. + + + true + Whether to open the hovered folder after a timeout when drag and drop operation + If this is set to true, when performing a drag and drop operation the hovered folder will open automatically after a timeout. + + + false + Enable new experimental views + Whether to use the new experimental views using the latest GTK+ widgets to help giving feedback and shaping their future. + + + true + Whether to have full text search enabled by default when opening a new window/tab + If set to true, then Nautilus will also match the file contents besides the name. This toggles the default active state, which can still be overridden in the search popover + + + + + + 'zip' + Default format for compressing files + The format that will be selected when compressing files. + + + + + + [ 'none', 'none', 'none' ] + List of possible captions on icons + A list of captions below an icon in the icon view. The actual number of captions shown depends on the zoom level. Some possible values are: “size”, “type”, “date_modified”, “owner”, “group”, “permissions”, and “mime_type”. + + + 'large' + Default icon view zoom level + + + [ '3' ] + Text Ellipsis Limit + A string specifying how parts of overlong file names should be replaced by ellipses, depending on the zoom level. Each of the list entries is of the form “Zoom Level:Integer”. For each specified zoom level, if the given integer is larger than 0, the file name will not exceed the given number of lines. If the integer is 0 or smaller, no limit is imposed on the specified zoom level. A default entry of the form “Integer” without any specified zoom level is also allowed. It defines the maximum number of lines for all other zoom levels. Examples: 0 — always display overlong file names; 3 — shorten file names if they exceed three lines; smallest:5,smaller:4,0 — shorten file names if they exceed five lines for zoom level “smallest”. Shorten file names if they exceed four lines for zoom level “smaller”. Do not shorten file names for other zoom levels. Available zoom levels: small, standard, large. + + + + + + 'standard' + Default list view zoom level + + + [ 'name', 'size', 'date_modified', 'starred' ] + Columns visible in list view + + + [ 'name', 'size', 'type', 'owner', 'group', 'permissions', 'mime_type', 'where', 'date_modified', 'date_modified_with_time', 'date_accessed', 'recency', 'starred' ] + Column order in list view + + + false + Use tree view + Whether a tree should be used for list view navigation instead of a flat list. + + + + + + (890, 550) + Initial size of the window + A tuple containing the initial width and height of the application window. + + + false + Whether the navigation window should be maximized + Whether the navigation window should be maximized by default. + + + 188 + Width of the side pane + The default width of the side pane in new windows. + + + true + Show location bar in new windows + If set to true, newly opened windows will have the location bar visible. + + + true + Show side pane in new windows + If set to true, newly opened windows will have the side pane visible. + + + diff --git a/data/run-uncrustify.sh b/data/run-uncrustify.sh new file mode 100755 index 0000000..78ac8d6 --- /dev/null +++ b/data/run-uncrustify.sh @@ -0,0 +1,26 @@ +#!/bin/bash +DATA=$(dirname "$BASH_SOURCE") +UNCRUSTIFY=$(command -v uncrustify) + +if [ -z "$UNCRUSTIFY" ]; +then + echo "Uncrustify is not installed on your system." + exit 1 +fi + +if [ ! -x "$DATA/lineup-parameters" ]; +then + echo "Script lineup-parameters does not exists here in (source directory)/data, probably because Nautilus was built in a different directory than the source directory. +Copy the program in the (build directory)/data/lineup-parameters here in (source directory)/data and run again run-uncrustify.sh." + exit 1 +fi + +for DIR in "$DATA/../"{src,test,libnautilus-extension,eel,extensions} +do + for FILE in $(find "$DIR" -name "*.c" -not -path "*/gtk/*" -not -path "*/animation/*" -not -path "*/audio-video-properties/*") + do + # Aligning prototypes is not working yet, so avoid headers + "$UNCRUSTIFY" -c "$DATA/uncrustify.cfg" --no-backup "$FILE" + "$DATA/lineup-parameters" "$FILE" > "$FILE.temp" && mv "$FILE.temp" "$FILE" + done +done diff --git a/data/shell-search-provider-dbus-interfaces.xml b/data/shell-search-provider-dbus-interfaces.xml new file mode 100644 index 0000000..f6840e2 --- /dev/null +++ b/data/shell-search-provider-dbus-interfaces.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/data/tracker/meson.build b/data/tracker/meson.build new file mode 100644 index 0000000..5320af1 --- /dev/null +++ b/data/tracker/meson.build @@ -0,0 +1,31 @@ +# Files needed for running Tracker inside the Flatpak sandbox, for systems +# which don't have a suitable version of Tracker in the host OS. +# +# We must export the .service files from the sandbox so they work on the +# session bus. This means the Tracker domain name must correspond with the +# application ID. + +domain_ontologies_dir = get_option('datadir') / 'tracker3' / 'domain-ontologies' +dbus_services_dir = get_option('datadir') / 'dbus-1' / 'services' + +tracker_domain_config = configuration_data() +tracker_domain_config.set('application_id', application_id) +tracker_domain_config.set('domain_rule', get_option('prefix') / domain_ontologies_dir / application_id + '.domain.rule') + +configure_file( + input: 'org.gnome.Nautilus.domain.rule.in', + output: application_id + '.domain.rule', + configuration: tracker_domain_config, + install_dir: domain_ontologies_dir) + +configure_file( + input: 'org.gnome.Nautilus.Tracker3.Miner.Extract.service.in', + output: application_id + '.Tracker3.Miner.Extract.service', + configuration: tracker_domain_config, + install_dir: dbus_services_dir) + +configure_file( + input: 'org.gnome.Nautilus.Tracker3.Miner.Files.service.in', + output: application_id + '.Tracker3.Miner.Files.service', + configuration: tracker_domain_config, + install_dir: dbus_services_dir) diff --git a/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in new file mode 100644 index 0000000..eb7a87a --- /dev/null +++ b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Extract.service.in @@ -0,0 +1,7 @@ +[D-BUS Service] +Name=@application_id@.Tracker3.Miner.Extract +Exec=/app/libexec/tracker-extract-3 --domain-ontology @domain_rule@ + +# Miner details needed for tracker-control +Path=/org/freedesktop/Tracker3/Miner/Extract +NameSuffix=Miner.Files diff --git a/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in new file mode 100644 index 0000000..4fa7371 --- /dev/null +++ b/data/tracker/org.gnome.Nautilus.Tracker3.Miner.Files.service.in @@ -0,0 +1,7 @@ +[D-BUS Service] +Name=@application_id@.Tracker3.Miner.Files +Exec=/app/libexec/tracker-miner-fs-3 --domain-ontology @domain_rule@ --initial-sleep 0 + +# Miner details needed for tracker-control +Path=/org/freedesktop/Tracker3/Miner/Files +NameSuffix=Miner.Files diff --git a/data/tracker/org.gnome.Nautilus.domain.rule.in b/data/tracker/org.gnome.Nautilus.domain.rule.in new file mode 100644 index 0000000..ec0808e --- /dev/null +++ b/data/tracker/org.gnome.Nautilus.domain.rule.in @@ -0,0 +1,21 @@ +# This defines a private Tracker domain for Nautilus. +# +# It's used to run the Tracker indexer inside a Flatpak sandbox, when Nautilus +# is running on a host that doesn't have a suitable version of Tracker +# installed. + +[DomainOntology] +# Location for the Tracker database +CacheLocation=$XDG_CACHE_HOME/nautilus/miner/files + +# Name of the ontology to use, must be one located in +# $(sharedir)/tracker/ontologies +OntologyName=nepomuk + +# DBus name for the owner (not optional). Tracker will use +# the domain as the prefix of the DBus name for all the +# services related to this domain ontology. +Domain=@application_id@ + +# List of miners we expect to run in this domain. +Miners=Miner.Files;Miner.Extract diff --git a/data/uncrustify.cfg b/data/uncrustify.cfg new file mode 100644 index 0000000..3883681 --- /dev/null +++ b/data/uncrustify.cfg @@ -0,0 +1,135 @@ +# +# 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# Allman style +# + +# indent +indent_ternary_operator = 1 + +# indent using tabs +output_tab_size = 4 +indent_columns = output_tab_size +indent_with_tabs = 0 + +# indent case +indent_switch_case = indent_columns +indent_case_brace = 0 + +# newlines +newlines = lf +nl_after_semicolon = true +nl_start_of_file = remove +nl_end_of_file = force +nl_end_of_file_min = 1 + +# spaces +sp_return_paren = force # "return (1);" vs "return(1);" +sp_sizeof_paren = force # "sizeof (int)" vs "sizeof(int)" +sp_assign = force +sp_arith = force +sp_bool = force +sp_compare = force +sp_after_comma = force +sp_case_label = force +sp_else_brace = force +sp_brace_else = force +sp_func_call_paren = force # "foo (" vs "foo(" +sp_func_proto_paren = force # "int foo ();" vs "int foo();" +sp_before_ptr_star = force +sp_after_ptr_star_qualifier = force # "const char * const" vs. "const char *const" +sp_after_ptr_star = remove +sp_between_ptr_star = remove # "**var" vs "* *var" +sp_inside_paren = remove # "( 1 )" vs "(1)" +sp_inside_fparen = remove # "( 1 )" vs "(1)" - functions +sp_inside_sparen = remove # "( 1 )" vs "(1)" - if/for/etc +sp_after_cast = force # "(int) a" vs "(int)a" +sp_func_call_user_paren = remove # For gettext, "_()" vs. "_ ()" +set func_call_user _ N_ C_ # Needed for sp_after_cast +sp_before_semi = remove +sp_paren_paren = remove # Space between (( and )) + +eat_blanks_before_close_brace = true +eat_blanks_after_open_brace = true + +# Allman style for curly braces +nl_assign_brace = force +nl_enum_brace = force +nl_union_brace = force +nl_struct_brace = force +nl_class_brace = force +nl_do_brace = force +nl_if_brace = force +nl_for_brace = force +nl_else_brace = force +nl_elseif_brace = force +nl_while_brace = force +nl_switch_brace = force +nl_before_case = true +nl_fcall_brace = force +nl_fdef_brace = force +nl_brace_else = force +nl_brace_while = force +nl_case_colon_brace = force +nl_after_brace_open = true + +# Function calls and parameters +nl_func_paren = remove +nl_func_def_paren = remove +nl_func_decl_start = remove +nl_func_def_start = remove +nl_func_decl_args = force +nl_func_def_args = force +nl_func_decl_end = remove +nl_func_def_end = remove + +# Code modifying options (non-whitespace) +mod_full_brace_do = force +mod_full_brace_for = force +mod_full_brace_function = force +mod_full_brace_if = force +mod_full_brace_while = force +mod_case_brace = force +mod_remove_extra_semicolon = true + +# Align +align_func_params = true +align_single_line_func = true +align_var_def_star_style = 2 + +# one liners +nl_func_leave_one_liners = true +nl_enum_leave_one_liners = true +nl_assign_leave_one_liners = true + +# Comments +cmt_cpp_to_c = true # "/* */" vs. "//" +cmt_cpp_group = true # Group single line comments to block +cmt_c_group = true +cmt_convert_tab_to_spaces = true +#cmt_reflow_mode = 2 # Full reflow (seems doesn't work quite well, it doesn't reorder the comments) +#cmt_width = 80 # Line width +cmt_star_cont = true # Whether to put a star on subsequent comment lines +cmt_sp_after_star_cont = 1 # The number of spaces to insert after the star on subsequent comment lines +cmt_c_nl_start = false # false/true +cmt_c_nl_end = true # false/true +# For multi-line comments with a '*' lead, remove leading spaces if the first and last lines of +# the comment are the same length. Default=True +cmt_multi_check_last = false + +# Encoding +utf8_bom = remove +utf8_force = true + -- cgit v1.2.3