google-code-export / gambas

Automatically exported from code.google.com/p/gambas
1 stars 0 forks source link

Dialog.Savefile replaces spaces in gb.GTK #230

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1) Describe the problem.

Saving a file via Dialog.SaveFile using gb.gtk produces a malformed file name 
when there are spaces in the file name. It seems it's encoding the spaces as if 
it was an url '%20'. When using gb.qt4 all goes well.

2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):

Version: TRUNK 3,1
Revision: r4594
Operating system: Linux
Distribution: 
Debian Squeeze
Architecture: Linux debian 2.6.32-5-686 #1 SMP Mon Mar 26 05:20:33 UTC 2012 
i686 GNU/Linux
GUI component:  GTK+
Desktop used: Gnome 

3) Provide a little project that reproduces the bug or the crash.

Run this simple code switching between components qt4 / gtk. :

Public Sub Form_Open()

  Dim pPrinter As New Printer
  'test vars
  Dim var1 As String = "name with"
  Dim var2 As String = "spaces"

  Dialog.Title = "File target"
  Dialog.Path = "/tmp/" & "A file " & var1 & " " & var2
  ' Dialog.Path = Subst$("/tmp/A file &1  &2", var1, var2) 'using subst doesn't help either
  Dialog.Filter = ["*.pdf", "Portable Document Format"]
  If Dialog.SaveFile() Then Return
  pPrinter.OutputFile = Dialog.Path
  Print Dialog.Path 'test console output
  pPrinter.Print

End

4) If your project needs a database, try to provide it, or part of it.
n/a
5) Explain clearly how to reproduce the bug or the crash.

Run previous code

Original issue reported on code.google.com by ea7...@gmail.com on 4 Apr 2012 at 6:31

GoogleCodeExporter commented 9 years ago

Original comment by benoit.m...@gmail.com on 4 Apr 2012 at 11:02

GoogleCodeExporter commented 9 years ago
I actually just get a warning from GTK+, but the path returned by Dialog.Path 
is correct. Which version of GTK+ do you use?

Original comment by benoit.m...@gmail.com on 5 Apr 2012 at 12:23

GoogleCodeExporter commented 9 years ago
Well, version of GTK+ is:

jesus@debian:~$ pkg-config --modversion gtk+-2.0
2.20.1

The path returned by Dialog.Path is correct and it seems so in console output, 
but not the generated filename itself. See attached screenshot. Moreover, the 
complete path (the file name) isn't shown in the dialog textbox, so one must to 
write in manually.

regards

Original comment by ea7...@gmail.com on 5 Apr 2012 at 10:41

Attachments:

GoogleCodeExporter commented 9 years ago
So the problem is in Printer.OutputFile, not in the Dialog class!

Original comment by benoit.m...@gmail.com on 5 Apr 2012 at 5:58

GoogleCodeExporter commented 9 years ago
I dont't know. But it is something that doesn't happen when using gb.qt4. 
That's why I thought it has something to do with Dialog class.
Anyway, I'm sorry if I made a mistake, hope it will help to solve the bug.

Thanks

Original comment by ea7...@gmail.com on 5 Apr 2012 at 6:07

GoogleCodeExporter commented 9 years ago
Fixed in revision #4600.

Original comment by benoit.m...@gmail.com on 5 Apr 2012 at 9:36