[kdelibs/frameworks] knewstuff/src: Port knewstuff from KImageIO to QImageReader.

David Faure faure at kde.org
Sat May 9 12:15:47 UTC 2015


On Thursday 24 October 2013 09:15:26 Kevin Ottens wrote:
> On Thursday 24 October 2013 09:11:35 David Faure wrote:
> > On Thursday 24 October 2013 00:57:02 Jeremy Whiting wrote:
> > > +    QFileDialog dialog(q, i18n("Select preview image"));
> > > +    dialog.setMimeTypeFilters(filters);
> > > +    if (dialog.exec() == QDialog::Accepted)
> > > +    {
> > > +        QUrl url = dialog.selectedUrls().first();
> > 
> > Why do you use the URL method....
> > 
> > > +        previewFile1 = url;
> > > +        // qDebug() << "preview is: " << url.url();
> > > +        QPixmap preview(url.toLocalFile());
> > 
> > ... if you expect a local file anyway?
> > 
> > selectedFiles() seems simpler and more standard for QFileDialog
> > (unlike KFileDialog which indeed worked with URLs everywhere)
> > 
> > In fact... Kévin, I'm surprised that the non-modal use of QFileDialog
> > doesn't allow apps to specify whether they want only local files or URLs.
> > The user can navigate to a non-local URL and then selectedFiles() will
> > return, hmm, empty strings to the application?
> 
> Hmmm... indeed we lack a supportSchemes property on QFileDialog. Looks like
> it got forgotten along the way 

19 months later .... I finally implemented this in QFileDialog.
https://codereview.qt-project.org/112017

> (although we have the parameter just fine for the static methods).

Yeah, it was completely ignored though, ever since the removal of the old 
function-pointer hooks :-)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 173 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20150509/91fc57b3/attachment.sig>


More information about the Kde-frameworks-devel mailing list