DnD: size limitations?



Background: I'm developing a tool for organizing a photo collection. It
will have the usual "tree of folders" approach, and supports
drag-and-drop for moving photographs between folders or "documents" (or
databases, I guess).

As long as the drag-and-drop is within the same document, I can keep the
amount of data transferred (i.e., what is returned by the drag-data-get
signal handler) very small: the operation just updates an internal data
structure. 

If the drag-and-drop is within the same application instance but between
documents, I need to copy some files, but I can do that after the
drag-and-drop finishes, similar to what Nautilus does.

If, however, the source and destination documents are open in different
instances of the application, the only communication channel they have
open is the drag-and-drop one. If I put lots of data through that
channel (e.g., all the images), it becomes very slow. I guess that's not
the way to go? Are there any known limitations on the amount of data one
should return in drag-data-get? How careful should I be with this?

Given my situation, what would be a good way to deal with the problem?

a) I could disallow drag-and-dropping outside an application instance,
but that is a stupid limitation.

b) I could make the assumption that both instances can see the same
filesystem tree (i.e., fully qualified pathnames in both instances refer
to the same files) and pass only filenames through drag-and-drop, and
then have the recipient copy the files afterwards. This would limit what
you can do with an application that runs from a different machine
through an ssh pipe, but I think I could live with that.

c) Use a helpful magic solution that is mentioned somewhere in the Gtk
or Gnome documentation, but which I haven't stumbled on yet.

-- 
http://liw.iki.fi/liw/photos/swordmaiden/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]