[gnome-commander] Fix for legacy mounting a device: do not stop if no GMount is available
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Fix for legacy mounting a device: do not stop if no GMount is available
- Date: Sun, 1 May 2022 10:22:05 +0000 (UTC)
commit 1a972946a00dfdde0c638c93af4ab67a3de49767
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sun May 1 12:14:21 2022 +0200
Fix for legacy mounting a device: do not stop if no GMount is available
src/gnome-cmd-con-device.cc | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/src/gnome-cmd-con-device.cc b/src/gnome-cmd-con-device.cc
index 403e8650..006e7470 100644
--- a/src/gnome-cmd-con-device.cc
+++ b/src/gnome-cmd-con-device.cc
@@ -201,7 +201,16 @@ static void do_legacy_mount_thread_func(GnomeCmdCon *con)
GError *error = nullptr;
if (!con->base_path)
- con->base_path = new GnomeCmdPlainPath(G_DIR_SEPARATOR_S);
+ {
+ if (GNOME_CMD_CON_DEVICE(con)->priv->mountp)
+ {
+ con->base_path = new GnomeCmdPlainPath(GNOME_CMD_CON_DEVICE(con)->priv->mountp);
+ }
+ else
+ {
+ con->base_path = new GnomeCmdPlainPath(G_DIR_SEPARATOR_S);
+ }
+ }
do_legacy_mount(con);
@@ -394,17 +403,25 @@ static GFile *dev_create_gfile (GnomeCmdCon *con, GnomeCmdPath *gnomeCmdPath)
GFile *newGFile = nullptr;
GnomeCmdConDevice *dev_con = GNOME_CMD_CON_DEVICE (con);
- g_return_val_if_fail (dev_con->priv->gMount != nullptr, nullptr);
-
- if (gnomeCmdPath)
+ if (dev_con->priv->gMount != nullptr)
{
- auto gMountGFile = g_mount_get_default_location (dev_con->priv->gMount);
- newGFile = g_file_resolve_relative_path(gMountGFile, gnomeCmdPath->get_path());
- g_object_unref(gMountGFile);
+ if (gnomeCmdPath)
+ {
+ auto gMountGFile = g_mount_get_default_location (dev_con->priv->gMount);
+ newGFile = g_file_resolve_relative_path(gMountGFile, gnomeCmdPath->get_path());
+ g_object_unref(gMountGFile);
+ }
+ else
+ {
+ newGFile = g_mount_get_default_location (dev_con->priv->gMount);
+ }
}
else
{
- newGFile = g_mount_get_default_location (dev_con->priv->gMount);
+ if (gnomeCmdPath != nullptr)
+ {
+ newGFile = g_file_new_for_path(gnomeCmdPath->get_path());
+ }
}
return newGFile;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]