[patch] slightly controversial refactor

Jeff Mitchell kde-dev at emailgoeshere.com
Sun Jan 21 08:42:50 UTC 2007


On Saturday 20 January 2007 15:00, Andrew Turner wrote:
> and by removing the unexpected side-effect of
> updating all devices from getDevice to its proper place in a separate
> function.

????

I guess you didn't read my earlier email in this thread...so to clarify, 
getDevice never updated all devices.  It did request a new list from kded's 
mediamanager, but only to refresh the one you were looking for by name.    
This behavior hasn't changed.

As a side effect, it would populate m_mediumMap if new devices were found, 
(because why not, you've already spent the processing time so it's free), but 
if a device already existed, it only refreshes the one passed in.  Hence 
passing in "init" and "dummyjusttorerundcop" before (it would never find 
those, so it would, in the process of searching, add all mediums that 
mediamanager detected to m_mediumMap).

Erik's new function is orthogonal; it does a refresh on every device.  This is 
really good functionality to have around because it updates all of the device 
characteristics (in case they've changed).  With getDevice it would update a 
specific device we told it to, but not all devices (since the only thing it 
would do with devices not matching the one we were looking for was add it to 
the map, if they were encountered before the one we wanted), so there wasn't 
a great way to do a full refresh of our m_mediumMap.  With Erik's function we 
don't have to know ahead of time what devices we are looking for in order to 
update them.  Plus it gets rid of the silly arguments that were being passed 
into getDevice...

--Jeff

>
> Andrew
>
> On 20/01/07, Jeff Mitchell <kde-dev at emailgoeshere.com> wrote:
> > Erik, no problem.  I appreciate that you worked on this.
> >
> > --Jeff
> >
> > On Saturday 20 January 2007 14:30, Erik Hovland wrote:
> > > On Sat, Jan 20, 2007 at 08:52:44PM +0000, Andrew Turner wrote:
> > > > Wait, ignore me. The patch didn't fix the memory leak, but Jeff did,
> > > > and in the same commit.
> > >
> > > I knew my patch needed more work.
> > >
> > > Thanks to Jeff for taking a look and sticking with it. I was struggling
> > > with it on my end.
> > >
> > > E
> >
> > _______________________________________________
> > Amarok mailing list
> > Amarok at kde.org
> > https://mail.kde.org/mailman/listinfo/amarok
>
> _______________________________________________
> Amarok mailing list
> Amarok at kde.org
> https://mail.kde.org/mailman/listinfo/amarok



More information about the Amarok mailing list