Re: FileChooser::get_filesnames question



On 5/26/07, Lucas van Dijk <luckyluke56 gmail com> wrote:
Hi,

I've got a FileChooserDialog, to open some files, multiple files are
allowed. So I looked at the documentation for FileChooser and found a
function called get_filenames(), which returns a Glib::SListHandle with the
filenames.

It also sais 'Free the returned list with Glib::slist_free(), and the
filenames with Glib::free().', but in the Glib namespace Documentaion I
cannot find a function called free() or slist_free. Also the documentation
for Glib::SListHandle doesn't exists.

My question is, What is exactly an SListHandle, and how can I get all the
filenames selected? And how do I have to free them? all filesnames first
with free(), and then slist_free() for the ListHandle? Or is only slist_free
enough?

Hi Lucas,
That looks like a case where the GLib documentation was automatically
converted to glibmm documentation, but it doesn't really make sense.
SListHandle and ListHandle types are 'intermediate' types that you
shouldn't ever really need to use.  They just provide handy
conversions to any of the standard containers.  So, you should just be
able to use either std::list<> or std::vector<> or something like
that. So something like the following:

std::list<Glib::ustring> filenames = chooser.get_filenames();

You shouldn't have to free the list at all.  That documentation is
misleading.  I've filed a bug to get that fixed:
http://bugzilla.gnome.org/show_bug.cgi?id=441422
--
jonner



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]