D13814: Speedup sort

Stefan BrĂ¼ns noreply at phabricator.kde.org
Wed Jul 11 00:38:56 BST 2018


bruns added inline comments.

INLINE COMMENTS

> kfileitemmodel.cpp:58
>  {
>      m_collator.setNumericMode(true);
>  

this causes the dirty state - maybe also do the forced (re)initialization here?

> kfileitemmodel.cpp:112
> +    // Workaround for bug https://bugreports.qt.io/browse/QTBUG-69361
> +    // Force the cleanup of QCollator in single thread to avoid thread safety problems in sort
> +    m_collator.compare(QStringLiteral("comparing"), QStringLiteral("anything"));

Maybe better:

  // Force initialization from the main thread. The collator is captured by reference and passed to the threads,
  // and if it is not in a clean state all threads will try to initialize it in parallel.

> kfileitemmodel.cpp:113
> +    // Force the cleanup of QCollator in single thread to avoid thread safety problems in sort
> +    m_collator.compare(QStringLiteral("comparing"), QStringLiteral("anything"));
>  }

`m_collator.compare(QString(), QString());` is sufficient

REPOSITORY
  R318 Dolphin

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

To: jtamate, #dolphin, #frameworks, markg, elvisangelaccio
Cc: elvisangelaccio, apol, bruns, markg, kfm-devel, spoorun, navarromorales, firef, andrebarros, emmanuelp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180710/c94776dc/attachment.html>


More information about the Kde-frameworks-devel mailing list