Calls thunar_vfs_init()
and thunar_vfs_shutdown()
. Those calls can be removed.
Use a GFile
instead of a ThunarVfsPath
when creating the file icon manager.
Pass the GFile
to the manager object instead of the ThunarVfsPath
.
Use a GFile
instead of the ThunarVfsPath
for the target_path
struct member.
Make xfdesktop_file_utils_file_icon_list_to_path_list()
return a list of GFile
objects.
Reuse thunar_g_file_list_to_string()
instead of using thunar_vfs_path_list_to_string()
.
Use g_list_foreach()
and g_list_free()
instead of thunar_vfs_path_list_free()
.
There's no need for cancelling jobs if we don't use jobs anymore. Instead we'll use the new D-Bus methods that have been added to Thunar. When using those we can just fire and forget.
We don't need the file info here. Just launch the file using Thunar's Launch()
D-Bus
method. Add an interface method get_file
and make it return a GFile
. Use this
GFile
to compute the URI to be passed to Launch()
.
Make the interface method peek_info
return a GFileInfo
.
Use Thunar's Rename()
(or RenameFiles?
) D-Bus method. For this we only
need the GFile
of the icon, not the file info. Use xfdesktop_file_icon_get_file()
instead of xfdesktop_file_icon_peek_info()
.
Again, use xfdesktop_file_icon_get_file()
instead of xfdesktop_file_icon_peek_info()
to obtain the URIs of the files supposed to be trashed.
Use GAppInfo
instead of ThunarVfsMimeApplication
and call g_app_info_launch()
instead of thunar_vfs_mime_handler_exec()
. Make sure to change the working directory
before and after this call (similar to how Thunar does it).
Replace this method with a similar one based on GAppInfo
instead of
ThunarVfsMimeApplication
.
We don't need the ThunarVfsInfo
here. Use xfdesktop_file_icon_get_file()
instead of xfdesktop_file_icon_peek_info()
. Make xfdesktop_file_utils_open_folder()
take a GFile
instead of a ThunarVfsInfo
.
See the previous function.
Again, we only need the GFile
, not the file info, in order to obtain the file URI.
Replace xfdesktop_file_icon_peek_info()
with xfdesktop_file_icon_get_file()
and ThunarVfsInfo
/ThunarVfsPath
with GFile
.
Again, we only need the GFile
to obtain the URI. Don't use the no-D-Bus-fallback
properties dialog (what's it good for? Thunar should always be running for other
parts of xfdesktop to be working anyway).
Remove this function. We'll create directories through the Thunar D-Bus API. We'll probably have to add another D-Bus method for creating directories.
Use a GFile
instead of the ThunarVfsInfo
and ThunarVfsPath
to obtain
the file URI. Feed exo-desktop-item-edit with the URI instead of a local path.
The function launcher_dialog_item_button_clicked()
in
xfce4-panel/plugins/launcher/launcher-dialog.c has an example of how we can do
this.
Create the directory using a new Thunar D-Bus method instead of implementing
this feature in xfdesktop internally. We'll have to create the D-Bus method
first. It should be called CreateFolder()
or CreateFile()
(with a
type parameter). Need to think about this a bit more.
Remove this function.
Remove this function.
TODO: This needs more thought. Thunar implements the same functionality, so
maybe we can reuse its implementation through D-Bus. If not, then at least
the ThunarVFS stuff should be replaced with GFile
and GFileInfo
. The
calls to thunar_vfs_copy_file()
and thunar_vfs_create_file()
should
be replaced with Thunar D-Bus method calls.
If this is still needed after the other refactorings, make it compare
GFileInfo
objects instead of ThunarVfsInfo
structs.
Use GFile
, GFileEnumerator
and GFileInfo
instead of the corresponding
ThunarVFS structures. Maybe we can reuse some code from Thunar implementing
the same thing.
Use GFileInfo
instead of ThunarVfsInfo
and GFile
instead of ThunarVfsPath
.
Use GAppInfo
instead of ThunarVfsMimeDatabase
and
ThunarVfsMimeHandler
/ThunarVfsMimeApplication
.
Use GFile
instead of ThunarVfsInfo
.
Use GFileInfo
to query the content type and GFile
instead of
ThunarVfsPath
to query the file path passed to XfceRc
.
Use GVolume
instead of ThunarVfsVolume
.
Replace this with a monitor callback for GFileMonitor
.
This function will have to be replaced with something similar because we cannot use the list dir job from ThunarVfsJob anymore.
This function will have to be replaced with something similar because we cannot use the list dir job from ThunarVfsJob anymore.
This function will have to be replaced with something similar because we cannot use the list dir job from ThunarVfsJob anymore.
Asynchronously load the folder using GFileEnumerator
.
Replace this function with a similar one based on GVolumeMonitor
.
The calls to thunar_vfs_is_removable()
and thunar_vfs_volume_is_present()
need to be replaced with something similar based on GVolume
. Thunar has the
same problem solved with this code:
This will be replaced with a handler for the volume-added
signal of
GVolumeMonitor
which should call
xfdesktop_file_icon_manager_add_removable_volume()
as well.
Similar to the previous function, this one should be replaced with one
that handles a single GVolume
volume only.
Use the GVolumeMonitor
here and connect to the right signals.
We'll need new callbacks for some of them.
Needs to iterate over the volumes hash table, disconnect from all
returned volumes, destroy all volume icons and disconnect from the
GVolumeMonitor
.
Get rid of the ThunarVfsMimeDatabase
and the global ThunarVfsVolumeManager
.
The hash table needs to use either URIs or GFile
as well as the right hash
and equal functions for them. URIs are easier due to the availability of string
hash and equal functions, I guess.
We'll have to change the ThunarVfsInfo
parameter of xfdesktop_regular_file_icon_new()
to a GFile
or GFileInfo
. We can use g_file_new_for_path()
instead of
thunar_vfs_info_new_for_path()
here when creating the GFile
for the desktop folder,
if the folder
member isn't a GFile
already.
The counterpart to the previous function. Same deal.
Use 'xfdesktop_file_icon_peek_file()
instead of …_peek_info()
. The file type
can then be determined with g_file_query_file_type()
.
Use g_file_get_child()
instead of thunar_vfs_path_relative()
and g_file_get_uri()
instead of thunar_vfs_path_dup_uri()
.
Use …_peek_file()
and …_peek_info()
(we need both this time around) and
GFile
functions instead of ThunarVfsPath
. To convert the string list into a list
of GFile
objects, we can use something similar to Thunar's solution:
We'll need a bit of custom code to execute the executable target file with the dropped
files as parameters. There are two possibilities: either the target is a desktop entry,
then we can parse it into a GDesktopAppInfo
, or it is a regular executable file,
then we can simply spawn it (make sure to pass the file parameters and implement startup
notification).
The code block dealing with jobs needs to be reworked around GFile
, GFileInfo
and the Thunar D-Bus API completely. Maybe danielm's branch implements this already?
We need to replace xfdesktop_file_utils_file_icon_list_to_path_list()
with something
like xfdesktop_file_utils_file_icon_list_to_g_file_list()
and then call
g_file_list_to_string()
instead of thunar_vfs_path_list_to_string()
. Again,
Thunar can serve as an inspiration here:
Change the ThunarVfsPath
parameter to a GFile
. That's all.
Change the ThunarVfsPath
folder member to a GFile
.
Replace the ThunarVfsMonitor
with a GVolumeMonitor
and remove
the ThunarVfsMonitorHandle
.
Remove the ThunarVfsJob *list_job
member.
Alter the “folder” property so that it becomes an object property
using the G_TYPE_FILE
object type.
Change the “folder” property code to reflect the changes to the property type made in the class_init function.
Same here, see above.
Use g_object_unref()
instead of thunar_vfs_path_unref()
.
Replace the code with something similar based on GFile
, g_file_query_exists()
,
g_file_query_file_type()
and g_file_make_directory()
.
Remove entirely. We'll re-use Thunar's properties dialog via its D-Bus API.
Remove. We'll no longer implement anything job-related in xfdesktop itself.
Remove as well.
If this is still needed after refactoring, then make it take a GFileInfo
and rewrite the checks based on GFileInfo
attributes.
Replace with a function called xfdesktop_file_utils_file_icon_list_to_g_file_list()
that creates a list of GFile
objects.
No longer needed, remove. g_file_info_get_icon()
always returns a valid GIcon
.
We have two options here: either remove and use g_file_info_get_icon()
or make it
load and return a GdkPixbuf
from the GIcon
.
TODO We'll have to investigate where xfdesktop_file_utils_get_file_icon()
is
being used and how.
Remove. We don't use a D-Bus fallback here as we rely on the D-Bus API of Thunar so hard that we can't provide any real functionality without it anyway.
Remove fallback code.
Replace the ThunarVfsInfo *info
member with GFile
and GFileInfo
members.
Return a GFileInfo
.
TODO: Replace the ThunarVfsInfo
parameter with GFileInfo
. Maybe we also need
to add a GFile
parameter because GFileInfo
contains no path information.
Remove.
Call g_object_unref()
instead of thunar_vfs_info_unref()
. Also release the
new GFile
member.
Update this to Thunarx 2. Need to set iface→get_file_info
, iface→get_filesystem_info
and iface→get_location
.
Need to rewrite this to make use of g_file_get_icon()
and tumbler. Maybe a new thumbnailer
or icon factory class like in thunar could be introduced.
Use GFileInfo
instead of ThunarVfsInfo
. Instead of ThunarVfsInfo
flags we have
to query GFileInfo
attributes to determine the readable/writable state of the target icon.
See the previous function.
I don't think we need this any longer. Thunar will display errors for us.
Remove.
Remove.
Rewrite the code based on GFileInfo
and GFile
. Use the Thunar D-Bus API
to launch executable files. Use a NULL check with g_file_get_parent()
to
replace the call to thunar_vfs_path_is_root()
. Instead of thunar_vfs_move_file()
,
thunar_vfs_copy_file()
etc. use the Thunar D-Bus API.
Instead of implement the Thunar D-Bus client manually we could rely on code generation.
What we need is to read the last modification time, the file type and a human readable
version of the size of the file. There are attributes for the modification time, the
file type and the file size in GFileInfo
. To humanize the file time we can use
something similar to what Thunar is doing,
for the file size we can use g_format_size_for_display()
.
Here we can simply rewrite the code to use GFile
and GFileInfo
.
Remove.
Remove.
Instead of thunar_vfs_unlink_file()
, use the Thunar D-Bus API here. Fire
and forget.
See previous function.
Change the return type to GFileInfo
.
TODO: Check how and where this function is being used and what we can do in order
to replace the ThunarVfsInfo
parameter.
Add a GFile
parameter, update the code to use g_object_ref()
instead of
thunar_vfs_info_ref()
.
TODO
TODO
TODO
TODO: we no longer need the thunar-vfs workaround I think.
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO
TODO