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

            Bug ID: 376365
           Summary: KFileWidget does not support : in filenames
           Product: frameworks-kio
           Version: 5.29.0
          Platform: openSUSE RPMs
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: fa...@kde.org
          Reporter: fab...@ritter-vogt.de
                CC: kdelibs-b...@kde.org
  Target Milestone: ---

KFileWidget treats filenames as complete urls, which causes
https://github.com/openSUSE/kmozillahelper/issues/7 ('Save file dialog does not
prefill filename when title have "xxx : xxx"')

This quick snippet has a default filename filled in without the KDE platform
theme but with it, the filename input is empty and this message appears:

"this is a test with a colon : hi.file"  is not a correct argument for
setSelection!
"this is a test with a colon : hi.file"  is not a correct argument for
setSelection!

#include <QApplication>
#include <QFileDialog>

int main(int argc, char *argv[])
{
        QApplication a(argc, argv);
        QUrl defaultUrl = QUrl::fromLocalFile("file:///tmp/this is a test with
a colon : hi.file");
        QFileDialog dialog(nullptr, "Broken", defaultUrl.path());
        // Does not work
        dialog.selectFile(defaultUrl.fileName());
        // Does not work either
        //dialog.selectUrl(defaultUrl);
        dialog.show();
        return a.exec();
}

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to