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

 
 

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

bug #38566: cannot insert images due to cork encoding

Submitted by:  Darcy Shen <sadhen>
Submitted on:  Fri 22 Mar 2013 09:02:20 AM UTC  
 
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
Keywords: 

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

Thu 05 Sep 2013 03:04:59 PM UTC, comment #11:

Great, it works!

This bug is fixed for me. Thanks a lot.

Francois Poulain <fpoulain>
Project Member
Thu 05 Sep 2013 12:26:54 PM UTC, 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 05 Sep 2013 09:54:27 AM UTC, comment #9:

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

Miguel de Benito <mdbenito>
Project MemberIn charge of this item.
Thu 05 Sep 2013 07:17:40 AM UTC, 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 04 Sep 2013 10:14:45 PM UTC, 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 04 Sep 2013 01:49:57 PM UTC, 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 04 Sep 2013 01:41:52 PM UTC, 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 03 Sep 2013 09:16:57 PM UTC, 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 03 Sep 2013 12:43:02 PM UTC, 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 03 Sep 2013 09:31:27 AM UTC, comment #2:

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

François

Francois Poulain <fpoulain>
Project Member
Sat 13 Apr 2013 03:15:49 PM UTC, 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 () * ")";
else
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 22 Mar 2013 09:02:20 AM UTC, 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 04 Sep 2013 10:14:45 PM UTCmdbenitoStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseSVN 7233=>SVN 7243
    Wed 04 Sep 2013 01:41:52 PM UTCfpoulainStatusReady For Test=>In Progress
    Tue 03 Sep 2013 09:16:57 PM UTCmdbenitoItem GroupNone=>Error
      StatusWorks For Me=>Ready For Test
      Fixed Release=>SVN 7233
    Tue 03 Sep 2013 12:43:02 PM UTCfpoulainAttached File-=>Added qt_chooser_widget.diff, #28992
      StatusConfirmed=>Works For Me
      Assigned tofpoulain=>mdbenito
    Tue 03 Sep 2013 09:31:27 AM UTCfpoulainStatusNone=>Confirmed
      Assigned toNone=>fpoulain

    Back to the top


    Powered by Savane 3.1-cleanup