Review Request 120274: Add Qsort comparator (for Strings) which uses Collator.
Michal Poteralski
michalpoteralskiKDE at gmail.com
Sat Sep 20 00:21:16 BST 2014
> On Sept. 18, 2014, 10:46 p.m., Jarosław Staniek wrote:
> > libs/db/tableviewdata.cpp, line 156
> > <https://git.reviewboard.kde.org/r/120274/diff/1/?file=313294#file313294line156>
> >
> > - use kWarning() << ...
> > - don't you want to return false here?
I don't want return false because it's not critical.
Please see: https://qt.gitorious.org/qt/qtbase/source/81ba16cad933981f55218964a89ed1446022efba:src/corelib/tools/qcollator_icu.cpp
There is not even a warning, thus it's sufficient.
> On Sept. 18, 2014, 10:46 p.m., Jarosław Staniek wrote:
> > libs/db/tableviewdata.cpp, line 195
> > <https://git.reviewboard.kde.org/r/120274/diff/1/?file=313294#file313294line195>
> >
> > when you port to K_GLOBAL_STATIC you will use m_collator->exists() here
I've used !_collator.isDestroyed() (what's pretty hacky) because exists():
Thread-safety notice: this function is thread-safe in the sense that it may be called from any thread at any time and will always return a valid reply. But due to the non-atomic nature of construction, this function may return false for a short time after the construction has completed.
> On Sept. 18, 2014, 10:46 p.m., Jarosław Staniek wrote:
> > libs/db/tableviewdata.cpp, line 56
> > <https://git.reviewboard.kde.org/r/120274/diff/1/?file=313294#file313294line56>
> >
> > use K_GLOBAL_STATIC (from KGlobal) so the object gets destroyed on app's exit
>
> Michal Poteralski wrote:
> Collator is abstract type ‘icu_52::Collator’, so as far as I know I cannot use K_GLOBAL_STATIC.
> However, can I use K_GLOBAL_STATIC inside class?
>
> Jarosław Staniek wrote:
> Please add a class that encapsulates code from initCollator() in the constructor.
>
> > However, can I use K_GLOBAL_STATIC inside class?
> Yes, it expands to a set of static members http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/kglobal_8h_source.html#l00221
Please check, I'm not sure.
- Michal
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120274/#review66867
-----------------------------------------------------------
On Sept. 19, 2014, 9:58 p.m., Michal Poteralski wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120274/
> -----------------------------------------------------------
>
> (Updated Sept. 19, 2014, 9:58 p.m.)
>
>
> Review request for Calligra, Andrius da Costa Ribas, Oleg Kukharchuk, Adam Pigg, Jarosław Staniek, Dimitrios Tanis, Tomasz Olszak, Radosław Wicik, and Wojciech Kosowicz.
>
>
> Bugs: 338808
> http://bugs.kde.org/show_bug.cgi?id=338808
>
>
> Repository: calligra
>
>
> Description
> -------
>
> Add Qsort comparator (for Strings) which uses Collator.
>
> Actualy there is only unicode string comparator for Strings.
> The patch implements String comparator which uses Collator.
>
>
> Diffs
> -----
>
> libs/db/CMakeLists.txt aad1c25
> libs/db/tableviewdata.cpp a87c1b2
>
> Diff: https://git.reviewboard.kde.org/r/120274/diff/
>
>
> Testing
> -------
>
> I've tested on Kexi and works well.
>
>
> Thanks,
>
> Michal Poteralski
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20140919/6eec8497/attachment.htm>
More information about the calligra-devel
mailing list