Can't import a file with the same name in a ContentStore scope

Bug #1483589 reported by Didier Roche-Tolomelli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
content-hub (Ubuntu)
New
Undecided
Unassigned

Bug Description

Having a ContentStore for a particular scope doesn't enable to import more than once a file name.

If you use:
ContentStore {
        id: appStore
        scope: ContentScope.App
}

and then:
peer.request(appStore)

-> the state transfer changed go to "initiated", "in progress" and "abort" the second time you try to import the same file, not giving you even a chance to rename it.

It doesn't only abort if the files are the same as touch "foo.png" for instance have the same effect.
One solution would have been to keep storing in the temp directory (so no argument to peer.request(), grab the uri of a through an app scoped ContentStore and use contentitem.move() directly.

However, this isn't possible as ContentStore.uri gives: Accessing ContentStore uri with NULL internal store
and we can't access to it.

Another reason it would be insteresting to have the ContentStore.uri path outside of any transfer would be to reference only relative paths for instance in Image {} components and so on, independant of the absolute full path.h

Tags: devexp
description: updated
description: updated
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

FYI, I have workarounded it this way: https://github.com/didrocks/splitthebill/commit/12d380b95a4bf2a1dc58226c814da551dfb2af13 feel free to comment for any better approach.

no longer affects: content-hub (Ubuntu)
affects: content-hub → content-hub (Ubuntu)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.