After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 511691 - Improve removable folder support
Improve removable folder support
Status: RESOLVED FIXED
Product: conduit
Classification: Other
Component: dataproviders
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: conduit-maint@gnome.bugs
conduit-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2008-01-24 01:37 UTC by John Stowers
Modified: 2008-03-14 04:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Experiments in implementation (14.56 KB, patch)
2008-02-27 23:43 UTC, John Stowers
none Details | Review
Slightly better (25.09 KB, patch)
2008-03-12 01:59 UTC, John Stowers
needs-work Details | Review
Slightly Better (20.85 KB, patch)
2008-03-12 04:19 UTC, John Stowers
needs-work Details | Review
Slightly Better (35.56 KB, patch)
2008-03-12 10:46 UTC, John Stowers
needs-work Details | Review
All the necessary plumbing (37.24 KB, patch)
2008-03-13 03:13 UTC, John Stowers
committed Details | Review

Description John Stowers 2008-01-24 01:37:20 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.
Comment 1 John Stowers 2008-02-27 23:43:50 UTC
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
Comment 2 John Stowers 2008-03-12 01:59:55 UTC
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)
Comment 3 John Stowers 2008-03-12 04:19:17 UTC
Created attachment 107117 [details] [review]
Slightly Better

Cleaned up version of attachment #107114 [details]
Comment 4 John Stowers 2008-03-12 10:46:47 UTC
Created attachment 107135 [details] [review]
Slightly Better

Much closer. Needs some more testing
Comment 5 John Stowers 2008-03-13 03:13:36 UTC
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!
Comment 6 John Stowers 2008-03-13 13:20:11 UTC
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
Comment 7 John Stowers 2008-03-14 04:24:36 UTC
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.