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
sc0w committed Aug 5, 2024
1 parent f1b0f49 commit 48e8f2b
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions plugins/filebrowser/lapiz-file-bookmarks-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,8 @@ lapiz_file_bookmarks_store_get_uri (LapizFileBookmarksStore * model,
CtkTreeIter * iter)
{
GObject * obj;
GFile * file = NULL;
guint flags;
gchar * ret = NULL;
gboolean isfs;

g_return_val_if_fail (LAPIZ_IS_FILE_BOOKMARKS_STORE (model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
Expand All @@ -843,26 +841,24 @@ lapiz_file_bookmarks_store_get_uri (LapizFileBookmarksStore * model,
&obj,
-1);

if (obj == NULL)
return NULL;

isfs = (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_FS);

if (isfs && (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_MOUNT))
{
file = g_mount_get_root (G_MOUNT (obj));
}
else if (!isfs)
if (obj != NULL)
{
file = g_object_ref (obj);
}

g_object_unref (obj);
if (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_FS)
{
if (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_MOUNT)
{
GFile * file;

if (file)
{
ret = g_file_get_uri (file);
g_object_unref (file);
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));
}
g_object_unref (obj);
}

return ret;
Expand Down

0 comments on commit 48e8f2b

Please sign in to comment.