[gnome-commander/feature/store_tab_connection_as_uri: 4/5] Fix for propagating a GError object
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/feature/store_tab_connection_as_uri: 4/5] Fix for propagating a GError object
- Date: Sun, 23 Jan 2022 22:32:53 +0000 (UTC)
commit dc4b0c23e7f017eb35985d9793ce06165e403113
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]