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 525847 - No gtk_file_chooser_get_current_name()
No gtk_file_chooser_get_current_name()
Status: RESOLVED DUPLICATE of bug 328092
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
unspecified
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2008-04-02 20:51 UTC by Björn Lindqvist
Modified: 2016-04-06 20:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Björn Lindqvist 2008-04-02 20:51:43 UTC
There is no getter for the current_name attribute, only the setter gtk_file_chooser_set_current_name(). You need a getter for unit testing and it could also be marginally useful for other purposes. The attribute should match what is in the location entry and probably be NULL if there is no location entry in the file choosers current action mode.
Comment 1 Christian Persch 2008-04-02 21:13:16 UTC

*** This bug has been marked as a duplicate of 328092 ***
Comment 2 Andrew Robinson 2016-04-06 19:21:13 UTC
I have confirmed this bug exists and has not been fixed.

This bug was not addressed or resolved either by 328092 or by 135901.

The function gtk_file_chooser_set_current_name exists and works

The function gtk_file_chooser_get_current_name will not link

I looked at the libgtk-3-0.dll and the function was not listed as an export there, nor in any other dll issued by GTK. I looked at the header file, gtkfilechooser.h, and although I could see that gtk_file_chooser_set_current_name and gtk_file_chooser_get_current_name were defined, they were prototyped differently:

   GDK_AVAILABLE_IN_ALL
   void gtk_file_chooser_set_current_name (GtkFileChooser *chooser,
   const gchar *name);

   GDK_AVAILABLE_IN_3_10
   gchar *gtk_file_chooser_get_current_name (GtkFileChooser *chooser);

I am not familiar with the GDK_AVAILABLE macros, so I'm not sure if this is the problem or not. Also, I believe they use GCC to compile GTK, but I'm not sure, so the fact that they prototype gtk_file_chooser_get_current_name as,

   gchar *gtk_file_chooser_get_current_name

instead of

   gchar * gtk_file_chooser_get_current_name

as they do for gtk_file_chooser_set_current_name, might be the problem, but I don't know. I all know is that linking to gtk_file_chooser_get_current_name will throw errors because the function is not present in any of the runtime DLLs that GTK has issued.

I am using runtime version 3.8.1-i686.
Comment 3 Andrew Robinson 2016-04-06 19:26:33 UTC
Let me clarify:

   gchar *gtk_file_chooser_get_current_name

is not the same as all the other functions, such as

   gchar * gtk_file_chooser_get_filename

or

   gchar * gtk_file_chooser_get_current_folder

(note the extra space)

The difference between gtk_file_chooser_set_current_name and gtk_file_chooser_set_current_name that I am concerned about is the

   GDK_AVAILABLE_IN_ALL

and the

   GDK_AVAILABLE_IN_3_10

Does that mean gtk_file_chooser_get_current_name was only available in version 3.1? Why doesn't it say _ALL like gtk_file_chooser_set_current_name does? The GTK manual says the function is available in all.
Comment 4 Andrew Robinson 2016-04-06 19:29:22 UTC
I also forgot to add I am using the Win32 runtime version.
Comment 5 Emmanuele Bassi (:ebassi) 2016-04-06 19:29:39 UTC
GDK_AVAILABLE_IN_3_10 means that the symbol is available since GTK+ 3.10, not 3.1.

If you're using GTK+ 3.8, then it means you don't have that symbol — hence why you can't use it. You need GTK+ 3.10 or newer in order to use gtk_file_chooser_get_current_name().
Comment 6 Andrew Robinson 2016-04-06 20:49:16 UTC
Okay, my mistake. I had a hard time finding the GTK runtime I was using for windows as is, since Google kept redirecting me to version .1 everytime I typed .10. I found a site that has the latest precompiled version for windows at http://lvserver.ugent.be/gtk-win64/. I just hope this 64-bit version doesn't cause other problems for me or my users.