[packagekit] pk-glib2 problem

Daniel Nicoletti dantti85-pk at yahoo.com.br
Wed Sep 16 10:57:14 PDT 2009


> > using p->name imo was much easier...
> 
> Sure, but you have to ask yourself, why are you using the package
> _name_ so much -- shouldn't you be using the package_id internally
> more?
Well no, for apt what from the package id really matters is
pkg name and version, and i need the name to match to the internal
package.
Of course i can change it to do all those operations (gchar **, free..)
I just think this makes it easier to write applications that leaks...

BTW do you know what i need to do with gdb to see if there is something
leaking?

Thanks,
Daniel.



----- Mensagem original ----
> De: Richard Hughes <hughsient at gmail.com>
> Para: PackageKit users and developers list <packagekit at lists.freedesktop.org>
> Enviadas: Quarta-feira, 16 de Setembro de 2009 14:48:12
> Assunto: Re: [packagekit] pk-glib2 problem
> 
> 2009/9/16 Daniel Nicoletti :
> > Will this will leak right?
> > FindPkg( pk_package_id_split(pi)[PK_PACKAGE_ID_NAME] );
> 
> Yes.
> 
> > instead i should:
> > gchar **parts;
> > parts = pk_package_id_split (package->priv->id);
> > FindPkg( parts[PK_PACKAGE_ID_NAME] );
> > g_strfreev (parts);
> >
> > right?
> 
> Correct.
> 
> > can't we have a more  convenient function to get name, version instead?
> 
> Well, you could write _get_name(), get_version() etc methods, but
> it'll split the string on each request and be very inefficent. The new
> way is quite a bit faster (less copies and pointer lookups) and easier
> to debug.
> 
> > using p->name imo was much easier...
> 
> Sure, but you have to ask yourself, why are you using the package
> _name_ so much -- shouldn't you be using the package_id internaly
> more?
> 
> Richard.
> _______________________________________________
> PackageKit mailing list
> PackageKit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/packagekit



      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com


More information about the PackageKit mailing list