[packagekit] pk-glib2 problem

Daniel Nicoletti dantti85-pk at yahoo.com.br
Wed Sep 16 09:43:51 PDT 2009


> if (pk_package_id_split(pi) != NULL)
> or
> if (pk_package_id_check(pi) == TRUE)
Just one comment to pk_package_id_check,
isn't better something like pk_package_id_is_ok,
imho check is too wide...
It's hard for me to tell from check what the returned
value would be.

Daniel.




----- Mensagem original ----
> De: Richard Hughes <hughsient at gmail.com>
> Para: PackageKit users and developers list <packagekit at lists.freedesktop.org>
> Enviadas: Terça-feira, 15 de Setembro de 2009 4:59:03
> Assunto: Re: [packagekit] pk-glib2 problem
> 
> 2009/9/14 Daniel Nicoletti :
> > in resolve I need to know if there is a package version
> > provided:
> > if (pk_package_id_split(pi)[PK_PACKAGE_ID_VERSION] == NULL) {
> 
> You need to either use:
> 
> if (pk_package_id_split(pi) != NULL)
> or
> if (pk_package_id_check(pi) == TRUE)
> 
> > This segfaults...
> > also as there is not package_id_free
> > is this ok?
> >
> > gchar *pi;
> > pi = package_ids[i];
> > delete pi;
> 
> No, delete is a C++ thing, and the memory is allocated using C. You
> need to use g_strfreev() on arrays you've created yourself.
> 
> 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