D24602: New design for extended search options

Elvis Angelaccio noreply at phabricator.kde.org
Sun Oct 20 12:25:41 BST 2019


elvisangelaccio requested changes to this revision.
elvisangelaccio added a comment.
This revision now requires changes to proceed.


  Just minor issues, code and UI change look good otherwise :)

INLINE COMMENTS

> dolphinfacetswidget.cpp:121
>  
> -    foreach (const QString& subTerm, subTerms) {
> +    for (const QString& subTerm : subTerms) {
>          if (subTerm.startsWith(QLatin1String("rating>="))) {

Unrelated change, please move it to another commit.

> dolphinfacetswidget.cpp:139
>  
> -    foreach (const QString& subTerm, subTerms) {
> +    for (const QString& subTerm : subTerms) {
>          if (subTerm.startsWith(QLatin1String("modified>="))) {

Unrelated change, please move it to another commit.

(and `subTerms` should be made `const` to avoid a detach).

> dolphinfacetswidget.cpp:154
>  {
> -    if (type == QLatin1String("Folder")) {
> -        m_folders->setChecked(true);
> -    } else if (type == QLatin1String("Document")) {
> -        m_documents->setChecked(true);
> -    } else if (type == QLatin1String("Image")) {
> -        m_images->setChecked(true);
> -    } else if (type == QLatin1String("Audio")) {
> -        m_audio->setChecked(true);
> -    } else if (type == QLatin1String("Video")) {
> -        m_videos->setChecked(true);
> -    } else {
> -        m_anyType->setChecked(true);
> +    for ( int index = 1; index <= m_typeSelector->count(); index++ ) {
> +        if (type == m_typeSelector->itemData(index).toString()) {

Coding style: no space after/before ()

> dolphinfacetswidget.cpp:164
>  {
> -    switch (stars) {
> -    case 5:
> -        m_maxRating->setChecked(true);
> -        break;
> -
> -    case 4:
> -        m_fourOrMore->setChecked(true);
> -        break;
> -
> -    case 3:
> -        m_threeOrMore->setChecked(true);
> -        break;
> -
> -    case 2:
> -        m_twoOrMore->setChecked(true);
> -        break;
> -
> -    case 1:
> -        m_oneOrMore->setChecked(true);
> -        break;
> -
> -    default:
> -        m_anyRating->setChecked(true);
> +    if (stars<0 || stars>5) {
> +        return;

Coding style: add space before/after comparison operators.

> dolphinfacetswidget.cpp:176
> +    m_dateSelector->setCurrentIndex(0);
> +    for ( int index = 1; index <= m_dateSelector->count(); index++ ) {
> +        if (date >= m_dateSelector->itemData(index).toDate()) {

Unrelated change, please move it to another commit.

REPOSITORY
  R318 Dolphin

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

To: iasensio, elvisangelaccio, #dolphin, #vdg
Cc: ndavis, ngraham, kfm-devel, iasensio, fprice, MrPepe, fbampaloukas, alexde, Codezela, feverfew, meven, spoorun, navarromorales, firef, andrebarros, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20191020/2c2653ae/attachment.htm>


More information about the kfm-devel mailing list