Skip to content

Commit 67823b8

Browse files
committed
filebrowser: fix warning -Wincompatible-pointer-types
based in pluma commit: mate-desktop/pluma@6bd3418 Fixes the warning: lapiz-file-bookmarks-store.c: In function 'lapiz_file_bookmarks_store_get_uri': lapiz-file-bookmarks-store.c:857:22: warning: assignment to 'GFile *' {aka 'struct _GFile *'} from incompatible pointer type 'GObject *' {aka 'struct _GObject *'} [-Wincompatible-pointer-types] 857 | file = g_object_ref (obj); | ^
1 parent 1e2ddd2 commit 67823b8

File tree

1 file changed

+16
-19
lines changed

1 file changed

+16
-19
lines changed

plugins/filebrowser/lapiz-file-bookmarks-store.c

+16-19
Original file line numberDiff line numberDiff line change
@@ -828,10 +828,8 @@ lapiz_file_bookmarks_store_get_uri (LapizFileBookmarksStore * model,
828828
CtkTreeIter * iter)
829829
{
830830
GObject * obj;
831-
GFile * file = NULL;
832831
guint flags;
833832
gchar * ret = NULL;
834-
gboolean isfs;
835833

836834
g_return_val_if_fail (LAPIZ_IS_FILE_BOOKMARKS_STORE (model), NULL);
837835
g_return_val_if_fail (iter != NULL, NULL);
@@ -843,26 +841,25 @@ lapiz_file_bookmarks_store_get_uri (LapizFileBookmarksStore * model,
843841
&obj,
844842
-1);
845843

846-
if (obj == NULL)
847-
return NULL;
848-
849-
isfs = (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_FS);
850-
851-
if (isfs && (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_MOUNT))
852-
{
853-
file = g_mount_get_root (G_MOUNT (obj));
854-
}
855-
else if (!isfs)
844+
if (obj != NULL)
856845
{
857-
file = g_object_ref (obj);
858-
}
846+
if (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_FS)
847+
{
848+
if (flags & LAPIZ_FILE_BOOKMARKS_STORE_IS_MOUNT)
849+
{
850+
GFile * file;
859851

860-
g_object_unref (obj);
852+
file = g_mount_get_root (G_MOUNT (obj));
853+
ret = g_file_get_uri (file);
854+
g_object_unref (file);
855+
}
856+
}
857+
else
858+
{
859+
ret = g_file_get_uri (G_FILE (obj));
860+
}
861861

862-
if (file)
863-
{
864-
ret = g_file_get_uri (file);
865-
g_object_unref (file);
862+
g_object_unref (obj);
866863
}
867864

868865
return ret;

0 commit comments

Comments
 (0)