Collections on External HDD

Jeff Mitchell mitchell at kde.org
Sun Feb 15 02:01:30 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dan Meltzer wrote:
> On Sun, Feb 8, 2009 at 11:20 AM, Casey Link <unnamedrambler at gmail.com> wrote:
>> From Maxx:
>>
>> ---------- Forwarded message ----------
>> From: Maximilian Kossick <maximilian.kossick at googlemail.com>
>> Date: Sun, Feb 8, 2009 at 7:29 AM
>> Subject: Re: Collections on External HDD
>> To: Casey Link <unnamedrambler at gmail.com>
>>
>>
>> Porting MountPointManager and the device plugins in devices/ to use
>> Solid. Ideally they should be moved into SqlCollection, because that's
>> where the code logically belongs, but loading plugins from a plugin
>> might be tricky. The database schema is already
>> DynamicCollectio-enabled. After porting to Solid, emitting a
>> collectionUpdated signal whenever MPM detects a device change is
>> probably the only thing left to do.
> 
> I'm attaching a patch that does this.  I havn't ported the nfs or smb
> devices yet, so they are not dynamic collection enabled at this point.
> 
> It detects when devices are added and removed, and creates an
> appropriate id for them in the database.  I'm not certain what will
> happen if a mysql database already exists (with everything having a
> deviceid of -1) but I'd love to find out if someone could try it...
> 
> The one thing this doesn't do yet is hide the items in the
> collectionbrowser if they are not available.  I need to look at the
> 1.4 sources to figure out how this was done.

I believe it's just a simple modification of the query.

sql_query = "...blahblahblah... WHERE deviceid = -1";

foreach( available_id, all_database_ids )
	sql_query += "OR deviceid = available_id";


As for everything having a deviceid of -1...should we assume that, like
with non-embedded AFT, everyone wants this feature, and just have a full
rescan discard deviceids and re-add the appropriate ones?

I believe everything ending up with -1 and no good way to get rid of it
was something that dogged dynamic collections in 1.4...we should try to
avoid that this time...

- --Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)

iEYEARECAAYFAkmXaWgACgkQANYdqNCuGCX0+wCeMni1K7yiw7UVHgIjx0lqJZEd
EGsAnRABQ60UFWSxleqTKcDCWW6OZgGl
=qVUc
-----END PGP SIGNATURE-----


More information about the Amarok-devel mailing list