Gtk Ckipboard: pasting files from a source with custom URI scheme

这一生的挚爱 提交于 2019-12-08 00:00:06

问题


I'm trying to write a a GTK/C application that puts some files on the Gtk clipboard, so a user with Nautilus will be able to paste them. There is a good example of Gtk Clipboard local file copy and paste on stackoverflow. Unofrtunately the files I need to paste are not on the local disk, and cannot be accessed via a standard GVFS URI scheme like file:// Only my application can access these source file after setting up a TCP connection, authenticating and opening an extra channel.

How can I have these application managed remote files on the Gtk clipboard for pasting with Nautilus ? And in the future, for Dolphin/KDE too ?

After googling around I came to the following idea: I need to develop a new gvfs URI scheme handler (ie: my-app://). But it's hard to find examples or documentation. Is it the only way ? And, can my application register itself as a temporary GVFS URI scheme handler without changing any external system configuration file ? How ?

来源:https://stackoverflow.com/questions/36215967/gtk-ckipboard-pasting-files-from-a-source-with-custom-uri-scheme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!