[gnome-commander] Don't add a volume if no identifier was found



commit 9fe872729c51e5a1fb827922995c2f782e6781fd
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date:   Thu Nov 25 22:03:10 2021 +0100

    Don't add a volume if no identifier was found
    
    Signed-off-by: Uwe Scholz <u scholz83 gmx de>

 src/gnome-cmd-data.cc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 1cc4af25..4ba3ed9b 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -2164,15 +2164,21 @@ static void add_gvolume (GVolume *gVolume)
     DEBUG('m',"icon path = %s\n", iconpath);
 
     // Don't create a new device connect if one already exists. This can happen if the user manually added 
the same device in "Options|Devices" menu
-    if (!device_mount_point_exists (gnome_cmd_data.priv->con_list, identifier))
+    if (identifier && (!device_mount_point_exists (gnome_cmd_data.priv->con_list, identifier)))
     {
         GnomeCmdConDevice *ConDev = gnome_cmd_con_device_new (name, identifier, nullptr, iconpath);
         gnome_cmd_con_device_set_autovol (ConDev, TRUE);
         gnome_cmd_con_device_set_gvolume (ConDev, gVolume);
         gnome_cmd_data.priv->con_list->add(ConDev);
     }
+    else if (identifier)
+    {
+         DEBUG('m', "Device for mountpoint(%s) already exists. AutoVolume not added\n", identifier);
+    }
     else
-        DEBUG('m', "Device for mountpoint(%s) already exists. AutoVolume not added\n", identifier);
+    {
+        DEBUG('m', "Device does not look like unix device. Skipping\n");
+    }
 
     g_free (uuid);
     g_free (name);


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