Use GIO to determine backup/ hidden files in Addons
So Windows-specific behavior is taken into account.
This commit is contained in:
parent
0c611f8d6a
commit
49317da35c
1 changed files with 11 additions and 5 deletions
|
@ -1781,13 +1781,19 @@ addons_directory_monitor_changed (GFileMonitor* monitor,
|
||||||
GFileMonitorEvent flags,
|
GFileMonitorEvent flags,
|
||||||
MidoriExtension* extension)
|
MidoriExtension* extension)
|
||||||
{
|
{
|
||||||
char* basename;
|
GFileInfo* info;
|
||||||
GSource* source;
|
GSource* source;
|
||||||
|
|
||||||
basename = g_file_get_basename (child);
|
info = g_file_query_info (child,
|
||||||
if (g_str_has_prefix (basename, ".") ||
|
"standard::is-hidden,standard::is-backup", 0, NULL, NULL);
|
||||||
g_str_has_suffix (basename, "~")) /* Hidden or temporary files */
|
if (info != NULL)
|
||||||
return;
|
{
|
||||||
|
gboolean hidden = g_file_info_get_is_hidden (info)
|
||||||
|
|| g_file_info_get_is_backup (info);
|
||||||
|
g_object_unref (info);
|
||||||
|
if (hidden)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* We receive a lot of change events, so we use a timeout to trigger
|
/* We receive a lot of change events, so we use a timeout to trigger
|
||||||
elements update only once */
|
elements update only once */
|
||||||
|
|
Loading…
Reference in a new issue