Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.h.meson.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#mesondefine HAVE_EXEMPI
// Define to enable EXIF support
#mesondefine HAVE_EXIF
// Define to enable audio/video preview (GStreamer)
#mesondefine HAVE_GSTREAMER
// Define if libselinux is available
#mesondefine HAVE_SELINUX
// Define to use gtk-layer-shell
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ publicIcons = [
'hicolor/actions/scalable/nemo-sidebar-hide-symbolic-rtl.svg',
'hicolor/actions/scalable/nemo-sidebar-show-symbolic.svg',
'hicolor/actions/scalable/nemo-sidebar-show-symbolic-rtl.svg',
'hicolor/actions/scalable/nemo-preview-hide-symbolic.svg',
'hicolor/actions/scalable/nemo-preview-hide-symbolic-rtl.svg',
'hicolor/actions/scalable/nemo-preview-show-symbolic.svg',
'hicolor/actions/scalable/nemo-preview-show-symbolic-rtl.svg',
'hicolor/actions/scalable/nemo-sidebar-tree-symbolic.svg',
'hicolor/actions/scalable/nemo-sidebar-tree-symbolic-rtl.svg',
'hicolor/actions/scalable/nemo-sidebar-places-symbolic.svg',
Expand Down
5 changes: 5 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Build-Depends:
libglib2.0-dev (>= 2.45.7),
libglib2.0-doc,
libgsf-1-dev,
libgstreamer1.0-dev,
libgstreamer-plugins-base1.0-dev,
libgtk-3-dev (>= 3.10),
libgtk-3-doc,
libgtk-layer-shell-dev,
Expand Down Expand Up @@ -85,6 +87,8 @@ Depends:
cinnamon-l10n,
desktop-file-utils (>= 0.7),
gsettings-desktop-schemas,
gstreamer1.0-gtk3,
gstreamer1.0-plugins-base,
gvfs (>= 1.3.2),
libglib2.0-data,
libnemo-extension1 (= ${binary:Version}),
Expand All @@ -101,6 +105,7 @@ Depends:
${misc:Depends},
${shlibs:Depends},
Recommends:
gstreamer1.0-plugins-good,
gvfs-backends,
gvfs-fuse,
librsvg2-common,
Expand Down
3 changes: 2 additions & 1 deletion gresources/nemo-shell-ui.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
<menuitem name="Show Hide Menubar" action="Show Hide Menubar"/>
<menuitem name="Show Hide Statusbar" action="Show Hide Statusbar"/>
<separator/>
<menuitem name="Show Hide Extra Pane" action="Show Hide Extra Pane"/>
<menuitem name="Show Hide Extra Pane" action="Show Hide Extra Pane"/>
<menuitem name="Show Hide Preview Pane" action="Show Hide Preview Pane"/>
<menuitem name="Edit Location" action="Edit Location"/>
</placeholder>
<separator/>
Expand Down
7 changes: 7 additions & 0 deletions gresources/nemo-shortcuts.ui
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,13 @@
<property name="accelerator">F9</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
<property name="title" translatable="yes" context="shortcut window">Show/hide preview pane</property>
<property name="accelerator">F7</property>
</object>
</child>
<child>
<object class="GtkShortcutsShortcut">
<property name="visible">True</property>
Expand Down
10 changes: 10 additions & 0 deletions libnemo-private/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ nemo_private_sources = [
'nemo-mount-operation.c',
'nemo-placement-grid.c',
'nemo-places-tree-view.c',
'nemo-preview-details.c',
'nemo-preview-image.c',
'nemo-preview-image-info.c',
'nemo-preview-info.c',
'nemo-program-choosing.c',
'nemo-progress-info-manager.c',
'nemo-progress-info.c',
Expand Down Expand Up @@ -90,6 +94,7 @@ nemo_private_deps = [
]

if libexif_enabled
nemo_private_sources += 'nemo-exif-utils.c'
nemo_private_deps += libexif
endif

Expand All @@ -102,6 +107,11 @@ if libselinux_enabled
nemo_private_deps += libselinux
endif

if video_preview_enabled
nemo_private_sources += ['nemo-preview-media-info.c', 'nemo-preview-video.c']
nemo_private_deps += [gstreamer, gst_pbutils, gst_app, gst_video]
endif

if gtk_layer_shell_enabled
nemo_private_deps += gtk_layer_shell
endif
Expand Down
1 change: 1 addition & 0 deletions libnemo-private/nemo-debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static GDebugKey keys[] = {
{ "Thumbnails", NEMO_DEBUG_THUMBNAILS },
{ "Search", NEMO_DEBUG_SEARCH },
{ "Preferences", NEMO_DEBUG_PREFERENCES },
{ "PreviewPane", NEMO_DEBUG_PREVIEW_PANE },
{ 0, }
};

Expand Down
3 changes: 2 additions & 1 deletion libnemo-private/nemo-debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ typedef enum {
NEMO_DEBUG_DESKTOP = 1 << 16,
NEMO_DEBUG_THUMBNAILS = 1 << 17,
NEMO_DEBUG_SEARCH = 1 << 18,
NEMO_DEBUG_PREFERENCES = 1 << 19
NEMO_DEBUG_PREFERENCES = 1 << 19,
NEMO_DEBUG_PREVIEW_PANE = 1 << 20
} DebugFlags;

void nemo_debug_set_flags (DebugFlags flags);
Expand Down
60 changes: 60 additions & 0 deletions libnemo-private/nemo-exif-utils.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */

/*
* nemo-exif-utils.c - EXIF string helpers shared by the properties page and preview pane
*
* Copyright (C) 2026 Linux Mint
*
* Nemo 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.
*
* Nemo 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; see the file COPYING. If not,
* write to the Free Software Foundation, Inc., 51 Franklin Street - Suite 500,
* Boston, MA 02110-1335, USA.
*/

#include <config.h>
#include "nemo-exif-utils.h"
#include <eel/eel-vfs-extensions.h>

gchar *
nemo_exif_string_to_utf8 (const gchar *exif_str)
{
gchar *utf8_str;

if (g_utf8_validate (exif_str, -1, NULL)) {
return g_strdup (exif_str);
}

utf8_str = g_locale_to_utf8 (exif_str, -1, NULL, NULL, NULL);

if (utf8_str != NULL) {
return utf8_str;
}

return eel_make_valid_utf8 (exif_str);
}

gchar *
nemo_exif_get_tag_value_utf8 (ExifData *data,
ExifTag tag)
{
ExifEntry *entry;
gchar buffer[1024];

entry = exif_data_get_entry (data, tag);

if (entry == NULL || exif_entry_get_value (entry, buffer, sizeof (buffer)) == NULL) {
return NULL;
}

return nemo_exif_string_to_utf8 (buffer);
}
34 changes: 34 additions & 0 deletions libnemo-private/nemo-exif-utils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */

/*
* nemo-exif-utils.h - EXIF string helpers shared by the properties page and preview pane
*
* Copyright (C) 2026 Linux Mint
*
* Nemo 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.
*
* Nemo 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; see the file COPYING. If not,
* write to the Free Software Foundation, Inc., 51 Franklin Street - Suite 500,
* Boston, MA 02110-1335, USA.
*/

#ifndef NEMO_EXIF_UTILS_H
#define NEMO_EXIF_UTILS_H

#include <glib.h>
#include <libexif/exif-data.h>

gchar *nemo_exif_string_to_utf8 (const gchar *exif_str);
gchar *nemo_exif_get_tag_value_utf8 (ExifData *data,
ExifTag tag);

#endif /* NEMO_EXIF_UTILS_H */
113 changes: 74 additions & 39 deletions libnemo-private/nemo-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -4314,6 +4314,18 @@ nemo_file_get_activation_location (NemoFile *file)
return nemo_file_get_location (file);
}

char *
nemo_file_get_activation_path (NemoFile *file)
{
g_autoptr(GFile) location = NULL;

g_return_val_if_fail (NEMO_IS_FILE (file), NULL);

location = nemo_file_get_activation_location (file);

return g_file_get_path (location);
}


char *
nemo_file_get_drop_target_uri (NemoFile *file)
Expand Down Expand Up @@ -4646,6 +4658,18 @@ nemo_file_has_loaded_thumbnail (NemoFile *file)
return file->details->thumbnail_is_up_to_date;
}

char *
nemo_file_get_thumbnail_path (NemoFile *file)
{
g_return_val_if_fail (NEMO_IS_FILE (file), NULL);

if (file->details->thumbnail_path != NULL) {
return g_strdup (file->details->thumbnail_path);
}

return NULL;
}

static void
prepend_icon_name (const char *name,
GThemedIcon *icon)
Expand Down Expand Up @@ -5192,56 +5216,25 @@ nemo_date_type_to_string (NemoDateType type)
return "(unknown)";
}

/**
* nemo_file_get_date_as_string:
*
* Get a user-displayable string representing a file modification date.
* The caller is responsible for g_free-ing this string.
* @file: NemoFile representing the file in question.
*
* Returns: Newly allocated string ready to display to the user.
*
**/
static char *
nemo_file_get_date_as_string (NemoFile *file,
NemoDateType date_type,
NemoDateCompactFormat date_format)
format_date_time (GDateTime *file_date_time,
NemoDateCompactFormat date_format)
{
time_t file_time_raw;
GDateTime *file_date_time, *file_date_time_utc;
GDateTime *today_midnight, *now;
GTimeZone *current_timezone;
gint days_ago;
gboolean use_24;
const gchar *format;
gchar *result;
int date_format_pref;

if (!nemo_file_get_date (file, date_type, &file_time_raw))
return NULL;

current_timezone = prefs_current_timezone;

file_date_time_utc = g_date_time_new_from_unix_utc (file_time_raw);

if (!file_date_time_utc) {
DEBUG ("File '%s' has invalid time for %s",
nemo_file_peek_name (file),
nemo_date_type_to_string (date_type));
return NULL;
}

file_date_time = g_date_time_to_timezone (file_date_time_utc, current_timezone);
g_date_time_unref (file_date_time_utc);

date_format_pref = prefs_current_date_format;

if (date_format_pref == NEMO_DATE_FORMAT_LOCALE) {
result = g_date_time_format (file_date_time, "%c");
goto out;
return g_date_time_format (file_date_time, "%c");
} else if (date_format_pref == NEMO_DATE_FORMAT_ISO) {
result = g_date_time_format (file_date_time, "%Y-%m-%d %H:%M:%S");
goto out;
return g_date_time_format (file_date_time, "%Y-%m-%d %H:%M:%S");
}

if (date_format != NEMO_DATE_FORMAT_FULL) {
Expand Down Expand Up @@ -5364,12 +5357,54 @@ nemo_file_get_date_as_string (NemoFile *file,
format = _("%c");
}

result = g_date_time_format (file_date_time, format);
return g_date_time_format (file_date_time, format);
}

out:
g_date_time_unref (file_date_time);
char *
nemo_date_time_to_display_string (GDateTime *date_time)
{
return format_date_time (date_time, NEMO_DATE_FORMAT_REGULAR_WITH_TIME);
}

return result;
/**
* nemo_file_get_date_as_string:
* @file: NemoFile representing the file in question.
* @date_type: which of the file's dates to use.
* @date_format: how compactly to format it.
*
* Get a user-displayable string for the given date of @file.
*
* Returns: Newly allocated string ready to display to the user, or NULL.
*
**/
static char *
nemo_file_get_date_as_string (NemoFile *file,
NemoDateType date_type,
NemoDateCompactFormat date_format)
{
time_t file_time_raw;
GDateTime *file_date_time, *file_date_time_utc;
gchar *result;

if (!nemo_file_get_date (file, date_type, &file_time_raw))
return NULL;

file_date_time_utc = g_date_time_new_from_unix_utc (file_time_raw);

if (!file_date_time_utc) {
DEBUG ("File '%s' has invalid time for %s",
nemo_file_peek_name (file),
nemo_date_type_to_string (date_type));
return NULL;
}

file_date_time = g_date_time_to_timezone (file_date_time_utc, prefs_current_timezone);
g_date_time_unref (file_date_time_utc);

result = format_date_time (file_date_time, date_format);
g_date_time_unref (file_date_time);

return result;
}

static NemoSpeedTradeoffValue show_directory_item_count;
Expand Down
Loading
Loading