[gnome-commander] Use const char for getting the filename



commit e762915de77741a511f2d701018c93e9bfe02334
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Thu Jun 24 19:16:12 2021 +0200

    Use const char for getting the filename

 src/dialogs/gnome-cmd-chmod-dialog.cc | 4 +---
 src/dialogs/gnome-cmd-chown-dialog.cc | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-chmod-dialog.cc b/src/dialogs/gnome-cmd-chmod-dialog.cc
index 933f5eb1..1486153f 100644
--- a/src/dialogs/gnome-cmd-chmod-dialog.cc
+++ b/src/dialogs/gnome-cmd-chmod-dialog.cc
@@ -72,11 +72,9 @@ static void do_chmod (GnomeCmdFile *in, guint32 permissions, gboolean recursive,
     {
         if (!in->chmod(permissions, &error))
         {
-            auto filename = g_file_get_basename(in->gFile);
-            auto message = g_strdup_printf (_("Could not chmod %s"), filename);
+            auto message = g_strdup_printf (_("Could not chmod %s"), in->get_name());
             gnome_cmd_show_message (nullptr, message, error->message);
             g_error_free(error);
-            g_free(filename);
             g_free(message);
             return;
         }
diff --git a/src/dialogs/gnome-cmd-chown-dialog.cc b/src/dialogs/gnome-cmd-chown-dialog.cc
index 4c9c898d..11d5813c 100644
--- a/src/dialogs/gnome-cmd-chown-dialog.cc
+++ b/src/dialogs/gnome-cmd-chown-dialog.cc
@@ -52,11 +52,9 @@ static void do_chown (GnomeCmdFile *in, uid_t uid, gid_t gid, gboolean recurse)
 
     if(!in->chown(uid, gid, &error))
     {
-        auto filename = g_file_get_basename(in->gFile);
-        auto message = g_strdup_printf (_("Could not chown %s"), filename);
+        auto message = g_strdup_printf (_("Could not chown %s"), in->get_name());
         gnome_cmd_show_message (nullptr, message, error->message);
         g_error_free(error);
-        g_free(filename);
         g_free(message);
         return;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]