[gnome-commander] Fix for propagating a GError object



commit b8e798bf2575e25560fc44a777d30c363cd30b1b
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Sun Jan 23 23:14:23 2022 +0100

    Fix for propagating a GError object

 src/gnome-cmd-dir.cc  | 6 +++---
 src/gnome-cmd-file.cc | 4 ++--
 src/gnome-cmd-file.h  | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/gnome-cmd-dir.cc b/src/gnome-cmd-dir.cc
index 24310678..228ada89 100644
--- a/src/gnome-cmd-dir.cc
+++ b/src/gnome-cmd-dir.cc
@@ -283,7 +283,7 @@ GnomeCmdDir *gnome_cmd_dir_new_from_gfileinfo (GFileInfo *gFileInfo, GnomeCmdDir
 
     gnomeCmdDir = static_cast<GnomeCmdDir*> (g_object_new (GNOME_CMD_TYPE_DIR, nullptr));
     GError *error = nullptr;
-    if(!gnome_cmd_file_setup(G_OBJECT (gnomeCmdDir), gFile, error))
+    if(!gnome_cmd_file_setup(G_OBJECT (gnomeCmdDir), gFile, &error))
     {
         g_warning("gnome_cmd_dir_new_from_gfileinfo error on %s: %s", uriString, error->message);
         g_error_free(error);
@@ -325,7 +325,7 @@ GnomeCmdDir *gnome_cmd_dir_new_with_con (GnomeCmdCon *con)
     gnome_cmd_dir_set_path (dir, con->base_path->clone());
     dir->priv->con = con;
     GError *error = nullptr;
-    if (!gnome_cmd_file_setup (G_OBJECT(dir), gFile, error))
+    if (!gnome_cmd_file_setup (G_OBJECT(dir), gFile, &error))
     {
         g_warning("gnome_cmd_dir_new_with_con error on %s: %s", uriString, error->message);
         g_warning("%s", error->message);
@@ -363,7 +363,7 @@ GnomeCmdDir *gnome_cmd_dir_new (GnomeCmdCon *con, GnomeCmdPath *path, gboolean i
     }
 
     gnomeCmdDir = static_cast<GnomeCmdDir*> (g_object_new (GNOME_CMD_TYPE_DIR, nullptr));
-    if (!gnome_cmd_file_setup (G_OBJECT (gnomeCmdDir), gFile, error))
+    if (!gnome_cmd_file_setup (G_OBJECT (gnomeCmdDir), gFile, &error))
     {
         if (error && !isStartup)
         {
diff --git a/src/gnome-cmd-file.cc b/src/gnome-cmd-file.cc
index 172bec11..fcb69434 100644
--- a/src/gnome-cmd-file.cc
+++ b/src/gnome-cmd-file.cc
@@ -210,7 +210,7 @@ void GnomeCmdFile::invalidate_metadata()
 }
 
 
-gboolean gnome_cmd_file_setup (GObject *gObject, GFile *gFile, GError *error)
+gboolean gnome_cmd_file_setup (GObject *gObject, GFile *gFile, GError **error)
 {
     g_return_val_if_fail (gObject != nullptr, FALSE);
     g_return_val_if_fail (GNOME_CMD_IS_FILE(gObject), FALSE);
@@ -222,7 +222,7 @@ gboolean gnome_cmd_file_setup (GObject *gObject, GFile *gFile, GError *error)
     gnomeCmdFile->gFileInfo = g_file_query_info(gFile, "*", G_FILE_QUERY_INFO_NONE, nullptr, &errorTmp);
     if (errorTmp)
     {
-        g_propagate_error(&error, errorTmp);
+        g_propagate_error(error, errorTmp);
         return FALSE;
     }
 
diff --git a/src/gnome-cmd-file.h b/src/gnome-cmd-file.h
index 9619f6af..10f7b2c6 100644
--- a/src/gnome-cmd-file.h
+++ b/src/gnome-cmd-file.h
@@ -131,7 +131,7 @@ GnomeCmdFile *gnome_cmd_file_new_from_gfile (GFile *gFile);
 GnomeCmdFile *gnome_cmd_file_new (const gchar *local_full_path);
 GnomeCmdFile *gnome_cmd_file_new (GFileInfo *gFileInfo, GnomeCmdDir *dir);
 void gnome_cmd_file_setup (GObject *gObject, GFileInfo *gFileInfo, GnomeCmdDir *dir);
-gboolean gnome_cmd_file_setup (GObject *gObject, GFile *gFile, GError *error);
+gboolean gnome_cmd_file_setup (GObject *gObject, GFile *gFile, GError **error);
 
 inline GnomeCmdFile *gnome_cmd_file_ref (GnomeCmdFile *f)
 {


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