Skip to content

Commit

Permalink
fix: [dfmio] Check thumbail in trash crash
Browse files Browse the repository at this point in the history
1. when the url is trash and has parent dir, the g_file_peek_path while crash.
2. use the g_file_get_path replace g_file_peek_path

Log: fix issue
Bug: https://pms.uniontech.com/bug-view-241241.html
  • Loading branch information
GongHeng2017 authored and max-lvs committed Feb 19, 2024
1 parent aab42ee commit aeef0ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dfm-io/dfm-io/dfmio_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ QString DFMUtils::devicePathFromUrl(const QUrl &url)
g_autofree gchar *uri = g_file_get_uri(rootFile);
return QString::fromLocal8Bit(uri);
} else {
g_autoptr(GUnixMountEntry) mount = g_unix_mount_for(g_file_peek_path(gfile), nullptr);
g_autoptr(GUnixMountEntry) mount = g_unix_mount_for(g_file_get_path(gfile), nullptr);
if (mount)
return QString::fromLocal8Bit(g_unix_mount_get_device_path(mount));
}
Expand Down

0 comments on commit aeef0ac

Please sign in to comment.