D17738: Use KFileWidget instead of QFileDialog

David Edmundson noreply at phabricator.kde.org
Sat Dec 22 18:50:04 GMT 2018


davidedmundson added a comment.


  > https://phabricator.kde.org/D17677 will be still needed.
  
  My rule about working round KDE code still applies.
  
  Does this work: https://phabricator.kde.org/P285 on KIO  for the remaining case?

INLINE COMMENTS

> filechooser.cpp:289
> +        QUrl url = fileDialog->m_fileWidget->baseUrl();
> +        fileDialog->m_fileWidget->setSelectedUrl(QUrl::fromLocalFile(QStringLiteral("%1/%2").arg(url.toDisplayString(QUrl::StripTrailingSlash)).arg(currentName)));
>      }

.arg(QString,QString)   not arg(QString).arg(QString)

It can change behaviour if the first inserted string contains the literal "%2"

> filechooser.cpp:304
>  
>      if (fileDialog->exec() == QDialog::Accepted) {
>          QStringList files;

https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0

> filechooser.cpp:306
>          QStringList files;
> -        for (const QString &filename : fileDialog->selectedFiles()) {
> -           QUrl url = QUrl::fromLocalFile(filename);
> -           files << url.toDisplayString();
> -        }
> +        QUrl url = QUrl::fromLocalFile(fileDialog->m_fileWidget->selectedFile());
> +        files << url.toDisplayString();

const

REPOSITORY
  R838 Flatpak Support: KDE Portal for XDG Desktop

REVISION DETAIL
  https://phabricator.kde.org/D17738

To: jgrulich, davidedmundson
Cc: plasma-devel, GB_2, ragreen, Pitel, ZrenBot, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20181222/f24e2446/attachment-0001.html>


More information about the Plasma-devel mailing list