After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 708675 - set_filename & set_uri broken in FileChooserDialog
set_filename & set_uri broken in FileChooserDialog
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks: 702853
 
 
Reported: 2013-09-24 12:10 UTC by Holger Seelig
Modified: 2018-04-15 00:21 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Holger Seelig 2013-09-24 12:10:50 UTC
I have a Gtk::FileChooserDialog build with Gtk::Builder and want to use the same instance multiple times. Setting the uri with set_uri the first time works well. The second time nothing is selected and recent files are opened and the following error occured:

(lt-titania:5803): Gtk-CRITICAL **: _gtk_file_system_model_get_iter_for_file: assertion `GTK_IS_FILE_SYSTEM_MODEL (model)' failed

Source code:

void
BrowserWindow::on_save_as ()
{
   getFileSaveDialog () .set_uri (worldURL .filename () .str ());

   auto response_id = getFileSaveDialog () .run ();

   getFileSaveDialog () .hide ();

   ...
}

Not the same instance is used multiple times. Neither set_filename, set_uri, select_filename, select_uri work the second time.

I used libgtkmm-3.0-1 (3.6.0-0ubuntu1).
Comment 1 Murray Cumming 2013-09-25 08:29:36 UTC
It's rather unlikely that this is a real bug in gtkmm or GTK+ because this would probably have been noticed by now. But even if it is, we would need a simple but complete test case to compile, please.

Alternatively, running your application under valgrind might show you a problem in your application code.
Comment 2 Holger Seelig 2013-09-26 16:28:16 UTC
My code is clean. I made a quick and small test with python and it does not work. Here the source code (replace the path with a path that exists on your system):

---

#!/usr/bin/python

from gi.repository import Gtk

path = "file:///path_that_exists_on_your_system"

dialog = Gtk .FileChooserDialog ()

dialog .set_uri (path)
dialog .run ()
dialog .hide ()

dialog .set_uri (path)
dialog .run ()
dialog .hide ()

---

On my system the dialog opens and selects the file as expected. The second time the recent files entry is shown. An error is not shown in the console.
Comment 3 Murray Cumming 2013-09-27 10:31:08 UTC
So it's almost certainly not a bug in gtkmm. Reassigning to GTK+. However, I'm sure they would appreciate a test case in C. Maybe you can start with one of the existing GTK+ tests.
Comment 4 Timothy Arceri 2013-09-27 13:03:10 UTC
There have been issues with reusing the filechooser dialog for a while now. I created a bug to track all the different issue report a while back bug# 702853.

I'll add this bug as a blocker but it could well be a duplicate, I don't have time to read the other bugs right now.
Comment 5 Matthias Clasen 2018-02-10 05:03:37 UTC
We're moving to gitlab! As part of this move, we are moving bugs to NEEDINFO if they haven't seen activity in more than a year. If this issue is still important to you and still relevant with GTK+ 3.22 or master, please reopen it and we will migrate it to gitlab.
Comment 6 Matthias Clasen 2018-04-15 00:21:20 UTC
As announced a while ago, we are migrating to gitlab, and bugs that haven't seen activity in the last year or so will be not be migrated, but closed out in bugzilla.

If this bug is still relevant to you, you can open a new issue describing the symptoms and how to reproduce it with gtk 3.22.x or master in gitlab:

https://gitlab.gnome.org/GNOME/gtk/issues/new