bugGNU TeXmacs - Bugs: bug #38566, cannot insert images due to cork...


You are not allowed to post comments on this tracker with your current authentication level.

bug #38566: cannot insert images due to cork encoding

Submitted by:  Darcy Shen <sadhen>
Submitted on:  Fri Mar 22 09:02:20 2013  
Category: File ManagerPriority: 5 - Normal
Item Group: ErrorStatus: Fixed
Privacy: PublicAssigned to: Miguel de Benito <mdbenito>
Originator Name: Open/Closed: Closed
Release: Release: None
Fixed Release: NoneFixed Release: SVN 7243

(Jump to the original submission Jump to the original submission)

Thu Sep 5 15:04:59 2013, comment #11:

Great, it works!

This bug is fixed for me. Thanks a lot.

Francois Poulain <fpoulain>
Project Member
Thu Sep 5 12:26:54 2013, comment #10:

Your welcome. I test this as soon as I find proper Internet with ssh working on it. :)

Francois Poulain <fpoulain>
Project Member
Thu Sep 5 09:54:27 2013, comment #9:

Ooops! Indeed, I forgot one file. Sorry for the sloppy commit :(

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Thu Sep 5 07:17:40 2013, comment #8:

I got this compilation error:

./Plugins/Qt/qt_chooser_widget.cpp: In member function ‘void qt_chooser_widget_rep::perform_dialog()’:
./Plugins/Qt/qt_chooser_widget.cpp:241:13: error: ‘class QTMFileDialog’ has no member named ‘setNameFilters’

Did you add all in svn?

Francois Poulain <fpoulain>
Project Member
Wed Sep 4 22:14:45 2013, comment #7:

Oops, fixed and fixed. Also added a default "All files (.)" to avoid getting in the way.

I'm closing this bug. Please reopen if problems appear.

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Wed Sep 4 13:49:57 2013, comment #6:

Also, I see weird filters, like e.g. "..tex" in place of "*.tex"; anyway it seems to work as expected.

Francois Poulain <fpoulain>
Project Member
Wed Sep 4 13:41:52 2013, comment #5:

Wooot! Thanks. Works for me when I load pictures. :)

Anyway, when I open a TeXmacs file, the filter is too strict: only directories are shown.

Francois Poulain <fpoulain>
Project Member
Tue Sep 3 21:16:57 2013, comment #4:

Indeed, that ifdef was pretty ugly. I rewrote that code and now:

- File formats and extensions are not hardcoded anymore
- Images are also resized when using native dialogs (Mac/Win) (defaults to 1/3 of page width)
- filename encoding conversion is consistently done (but possibly wrong!)

Please test.

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Tue Sep 3 12:43:02 2013, comment #3:

Here is a patch you can try.

I let Miguel reviewing it and pushing it, since he is the original author of this part.

Miguel, don't you think that the big "#if (defined(Q_WS_MAC) || defined(Q_WS_WIN))" is a little too big?

(file #28992)

Francois Poulain <fpoulain>
Project Member
Tue Sep 3 09:31:27 2013, comment #2:

Hi Darcy, I can reproduce the bug. I will look at it.


Francois Poulain <fpoulain>
Project Member
Sat Apr 13 15:15:49 2013, comment #1:

I was wrong.Today I carefully read the source code and find that
in file: qt_chooser_widget.cpp
if (fileNames.count() > 0) {
file = from_qstring (fileNames[0]);
url u = url_system (scm_unquote (file));
cerr << "Debugging"<<u;
QByteArray arr= to_qstring (as_string (u)).toLocal8Bit ();
const char* cstr= arr.constData ();
string localname = string ((char*) cstr);
if (type == "image")
file = "(list (system->url " *
scm_quote (as_string (u)) *
") " * imgdialog->getParamsAsString () * ")";
file = "(system->url " * scm_quote (localname) * ")";

here from_qstring is actually changing the encoding to cork
and I try to load a file named 你好.tm , It works. But when I try to insert a image with Chinese in the filename, it failed.

I find that there is as_string, I guess something gets wrong in url.cpp, but currently I haven't found it.

Darcy Shen <sadhen>
Project Member
Fri Mar 22 09:02:20 2013, original submission:

I have a image file named "你好.png". When I try to insert the image by Insert->Image->Insert Image... , it failed to load because of the encoding problem.

I think making minor changes in src/src/System/Files/images_files.cpp before calling the function load_string will fix the bug.

Darcy Shen <sadhen>
Project Member


Attached Files
file #28992:  qt_chooser_widget.diff added by fpoulain (585B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mdbenito (Posted a comment)
  • -unavailable- added by sadhen (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 12 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Sep 4 22:14:45 2013mdbenitoStatusIn Progress=>Fixed
      Fixed ReleaseSVN 7233=>SVN 7243
    Wed Sep 4 13:41:52 2013fpoulainStatusReady For Test=>In Progress
    Tue Sep 3 21:16:57 2013mdbenitoItem GroupNone=>Error
      StatusWorks For Me=>Ready For Test
      Fixed Release=>SVN 7233
    Tue Sep 3 12:43:02 2013fpoulainAttached File-=>Added qt_chooser_widget.diff, #28992
      StatusConfirmed=>Works For Me
      Assigned tofpoulain=>mdbenito
    Tue Sep 3 09:31:27 2013fpoulainStatusNone=>Confirmed
      Assigned toNone=>fpoulain

    Back to the top

    Powered by Savane 3.1-cleanup1