[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [kfile] [Bug 387481] New: Save file dialog doesn't return selected filter properly
From:       Alexander <bugzilla_noreply () kde ! org>
Date:       2017-11-30 21:18:21
Message-ID: bug-387481-17878 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=387481

            Bug ID: 387481
           Summary: Save file dialog doesn't return selected filter
                    properly
           Product: kfile
           Version: unspecified
          Platform: openSUSE RPMs
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: kdelibs-bugs@kde.org
          Reporter: ashaduri@gmail.com
  Target Milestone: ---

I'm using plain Qt5 applications and since I'm running Plasma, KDE dialogs 
automatically replace Qt's built-in dialogs.

The problem is with the Save dialog (QFileDialog::getSaveFileName()).
If the "filter" parameter contains 2 filters with the same extensions, the
"selectedFilter" parameter is always set to the first one, no matter which one
the user selected.

Example code:
--------------------------
QString selectedFilter;
QString fileName = QFileDialog::getSaveFileName(this,
      "QFileDialog::getSaveFileName()",
      "hello.txt",
      "All Files (*);;UTF-16 Files (*.txt);;UTF-8 Files (*.txt)",
      &selectedFilter);
qWarning() << "selectedFilter: " << selectedFilter;
--------------------------

If the user selects "UTF-8 Files (*.txt)", "UTF-16 Files (*.txt)" is printed
instead.

Qt's built-in dialog don't have this problem.

Thanks

-- 
You are receiving this mail because:
You are watching all bug changes.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic