GNOME Bugzilla – Bug 511691
Improve removable folder support
Last modified: 2008-03-14 04:24:36 UTC
Conduit should support removable volumes such as USB keys better. I have had a few attempts at implementing this, and have decided that the best implementation is the simplest. Basic approach * Add RemovableFolderFactory --> Emit FolderTwoWay klasses * Add additional args to FolderTwoWay, or make it take kwargs in such a way that it can be created by from a factory. One additional argument could be the root path of the device (its mountpoint) * Change the get_configuration method to drop the configuration xml in a text file in /mount/point/.conduit/username.xml * Special case __init__ in foldertwoway to look for this xml file, and if present to configure itself.
Created attachment 106115 [details] [review] Experiments in implementation This patch contains a first hack at this. Im not convinced about the approach. The goals are * Make the N removable volume datproviders appear in the data provider pane under a category for the inserted volume. * The removable volumes should appear there, if it is detected that they have been synchronized on another computer (i.e. the presence of /mount/point/.conduit/foo) * Removable volume dataproviders should be nothing more than preconfigured FolderTwoWay dataproviders * A FolderTwoWay, when configured on a removable volume, should appear as a removable volume dp in subsequent runs of the app Problems * The get_key system does not suit this model
Created attachment 107114 [details] [review] Slightly better (apologies about this patch containing a bunch of other changes, I will update it later) So this approach looks like it could work. Remaining changes 1. Remove the class registry, store the klass in the module wrapper. It wont add memory because the classes are static in modules anyway. It will also reduce some complexity 2. Clean up ModuleWrapper init args. def __init__(self, klass, classname, initargs, category)
Created attachment 107117 [details] [review] Slightly Better Cleaned up version of attachment #107114 [details]
Created attachment 107135 [details] [review] Slightly Better Much closer. Needs some more testing
Created attachment 107201 [details] [review] All the necessary plumbing OK. I am happy with this approach. Perhaps the get_key() machinery could go away completely, and we could use class parameters and dynamically created class type()s (see Network module and Removable device foo c.f. iPod and Nokia N800), but that is something non-critical I will implement this for Preconfigured folder sync from Phone images, and from USB sticks, then close this bug!
Now I need to 1. For a given uri, what removable volume is it on, and what is the root path of this volume 2. Save the .conduit/group file at #1
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. From NEWS: * Improved removable volume support (like USB keys). Now, inserting a USB key that has been synchronized on another computer will automatically create a preconfigured dataprovider for synchronizing the folders of interest.