Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
thunar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
267
Issues
267
List
Boards
Labels
Service Desk
Milestones
Custom Issue Tracker
Custom Issue Tracker
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xfce
thunar
Commits
b2012f58
Commit
b2012f58
authored
Apr 17, 2015
by
Harald Judt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement reloading file information on manual reload
parent
b839b29d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
thunar/thunar-folder.c
thunar/thunar-folder.c
+22
-3
thunar/thunar-folder.h
thunar/thunar-folder.h
+2
-1
thunar/thunar-standard-view.c
thunar/thunar-standard-view.c
+2
-2
No files found.
thunar/thunar-folder.c
View file @
b2012f58
...
...
@@ -109,6 +109,7 @@ struct _ThunarFolder
ThunarFile
*
corresponding_file
;
GList
*
new_files
;
GList
*
files
;
gboolean
reload_info
;
GList
*
content_type_ptr
;
guint
content_type_idle_id
;
...
...
@@ -248,6 +249,7 @@ thunar_folder_init (ThunarFolder *folder)
g_signal_connect
(
G_OBJECT
(
folder
->
file_monitor
),
"file-destroyed"
,
G_CALLBACK
(
thunar_folder_file_destroyed
),
folder
);
folder
->
monitor
=
NULL
;
folder
->
reload_info
=
FALSE
;
}
...
...
@@ -545,6 +547,18 @@ thunar_folder_finished (ExoJob *job,
}
}
/* schedule a reload of the file information of all files if requested */
if
(
folder
->
reload_info
)
{
for
(
lp
=
folder
->
files
;
lp
!=
NULL
;
lp
=
lp
->
next
)
thunar_file_reload_idle
(
lp
->
data
);
/* reload folder information too */
thunar_file_reload_idle
(
folder
->
corresponding_file
);
folder
->
reload_info
=
FALSE
;
}
/* we did it, the folder is loaded */
g_signal_handlers_disconnect_matched
(
folder
->
job
,
G_SIGNAL_MATCH_DATA
,
0
,
0
,
NULL
,
NULL
,
folder
);
g_object_unref
(
folder
->
job
);
...
...
@@ -578,7 +592,7 @@ thunar_folder_file_changed (ThunarFileMonitor *file_monitor,
if
(
G_UNLIKELY
(
folder
->
corresponding_file
==
file
))
{
/* ...and if so, reload the folder */
thunar_folder_reload
(
folder
);
thunar_folder_reload
(
folder
,
FALSE
);
}
}
...
...
@@ -855,7 +869,7 @@ thunar_folder_get_for_file (ThunarFile *file)
g_object_set_qdata
(
G_OBJECT
(
file
),
thunar_folder_quark
,
folder
);
/* schedule the loading of the folder */
thunar_folder_reload
(
folder
);
thunar_folder_reload
(
folder
,
FALSE
);
}
return
folder
;
...
...
@@ -923,15 +937,20 @@ thunar_folder_get_loading (const ThunarFolder *folder)
/**
* thunar_folder_reload:
* @folder : a #ThunarFolder instance.
* @reload_info : reload all information for the files too
*
* Tells the @folder object to reread the directory
* contents from the underlying media.
**/
void
thunar_folder_reload
(
ThunarFolder
*
folder
)
thunar_folder_reload
(
ThunarFolder
*
folder
,
gboolean
reload_info
)
{
_thunar_return_if_fail
(
THUNAR_IS_FOLDER
(
folder
));
/* reload file info too? */
folder
->
reload_info
=
reload_info
;
/* stop metadata collector */
if
(
folder
->
content_type_idle_id
!=
0
)
g_source_remove
(
folder
->
content_type_idle_id
);
...
...
thunar/thunar-folder.h
View file @
b2012f58
...
...
@@ -42,7 +42,8 @@ ThunarFile *thunar_folder_get_corresponding_file (const ThunarFolder *folder);
GList
*
thunar_folder_get_files
(
const
ThunarFolder
*
folder
);
gboolean
thunar_folder_get_loading
(
const
ThunarFolder
*
folder
);
void
thunar_folder_reload
(
ThunarFolder
*
folder
);
void
thunar_folder_reload
(
ThunarFolder
*
folder
,
gboolean
reload_info
);
G_END_DECLS
;
...
...
thunar/thunar-standard-view.c
View file @
b2012f58
...
...
@@ -1714,7 +1714,7 @@ thunar_standard_view_reload (ThunarView *view,
/* determine the folder for the view model */
folder
=
thunar_list_model_get_folder
(
standard_view
->
model
);
if
(
G_LIKELY
(
folder
!=
NULL
))
thunar_folder_reload
(
folder
);
thunar_folder_reload
(
folder
,
reload_info
);
/* schedule thumbnail reload update */
if
(
!
standard_view
->
priv
->
thumbnailing_scheduled
)
...
...
@@ -3286,7 +3286,7 @@ thunar_standard_view_drag_data_received (GtkWidget *view,
{
/* reload the folder corresponding to the file */
folder
=
thunar_folder_get_for_file
(
file
);
thunar_folder_reload
(
folder
);
thunar_folder_reload
(
folder
,
FALSE
);
g_object_unref
(
G_OBJECT
(
folder
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment