Skip to content

Commit

Permalink
filebrowser: fix warning -Wincompatible-pointer-types
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuj authored and raveit65 committed Jan 25, 2024
1 parent 9be22af commit 9f033b7
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions plugins/filebrowser/pluma-file-bookmarks-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,8 @@ pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
GtkTreeIter * iter)
{
GObject * obj;
GFile * file = NULL;
guint flags;
gchar * ret = NULL;
gboolean isfs;

g_return_val_if_fail (PLUMA_IS_FILE_BOOKMARKS_STORE (model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
Expand All @@ -839,26 +837,25 @@ pluma_file_bookmarks_store_get_uri (PlumaFileBookmarksStore * model,
&obj,
-1);

if (obj == NULL)
return NULL;

isfs = (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS);

if (isfs && (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT))
{
file = g_mount_get_root (G_MOUNT (obj));
}
else if (!isfs)
if (obj != NULL)
{
file = g_object_ref (obj);
}
if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_FS)
{
if (flags & PLUMA_FILE_BOOKMARKS_STORE_IS_MOUNT)
{
GFile * file;

g_object_unref (obj);
file = g_mount_get_root (G_MOUNT (obj));
ret = g_file_get_uri (file);
g_object_unref (file);
}
}
else
{
ret = g_file_get_uri (G_FILE (obj));
}

if (file)
{
ret = g_file_get_uri (file);
g_object_unref (file);
g_object_unref (obj);
}

return ret;
Expand Down

0 comments on commit 9f033b7

Please sign in to comment.