Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35947

On GTK2, initiallySelectedFiles of QGtk2FileDialogHelper are copied wrongly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.1
    • 5.2.0 Alpha, 5.2.0 Beta1 , 5.2.0 RC1, 5.2.0
    • None
    • Ubuntu 13.10
    • 7c03f00a4ea6da72e0064ecb659c4c4bc3c8083b

    Description

      QPlatformFileDialog's initiallySelectedFiles option hold a list of files that is set before the file dialog pops up. This is needed for example in OSX, because the filename cannot be changed after the dialog is created.

      In void QGtk2FileDialogHelper::applyOptions() QStrings are copied to QUrls because QGtk2FileDialogHelper::selectFile expects the parameter to be QUrl again (since 5.2).

      src/plugins/platformthemes/gtk2/qgtk2dialoghelpers.cpp
          foreach (const QUrl &filename, opts->initiallySelectedFiles())
              selectFile(filename.toLocalFile());
      

      Thus QString is copied into a QUrl in the wrong way. See https://gist.github.com/webmaster128/8256606 where END STATE 1 is what you want and END STATE 2 is what is done.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            webmaster128 Simon Warta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes