Gnome::Vfs::DirectoryHandle::list_load



Hello

I think there is something wrong with the gnome-vfsmm the static
member-function of Gnome::Vfs::DirectoryHandle:

static void list_load(const Glib::ListHandle<Glib::ustring>& list,
                      const Glib::ustring& text_uri, 
                      FileInfoOptions info_options) throw(exception);

See this little example program:
<code>
#include <libgnomevfsmm.h>
#include <iostream>
#include <list>

int main(int argc, char** argv)
{
    Gnome::Vfs::init();

    std::list<Glib::ustring>        list;
    Glib::ListHandle<Glib::ustring> listHandle(list);
    Gnome::Vfs::DirectoryHandle::list_load(
        listHandle,
        "ftp://ftp.gnome.org";,
        Gnome::Vfs::FILE_INFO_DEFAULT );
    
    std::cout << list.size() << std::endl; 

    // ------------------------------
    GList* glist;
    gnome_vfs_directory_list_load(
        &glist, 
        "ftp://ftp.gnome.org";,               
static_cast<GnomeVFSFileInfoOptions>(Gnome::Vfs::FILE_INFO_DEFAULT) );
   
    std::cout << g_list_length(glist) << std::endl; // prints: 17
    GnomeVFSFileInfo* info =
static_cast<GnomeVFSFileInfo*>(g_list_nth_data(glist,5));
    std::cout << info->name << std::endl;
    
    return 0;
}
</code>

<output>
0
17
conspiracy
</output>

The GList holds pointers GnomeVFSFileInfo structures, so Glib::ustring
being ListHandle-type makes no sense to me.

Is this a bug or didn't I get how to use this this function?


Maik








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