[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [amarok] /: Bug 279559 - EditFilterDialog i18n AND/OR fix.
From:       Nikhil Marathe <nsm.nikhil () gmail ! com>
Date:       2011-08-27 9:15:01
Message-ID: 20110827091501.4A1CCA6078 () git ! kde ! org
[Download RAW message or body]

Git commit 318f6e3c4e07ae1006e1991dae8a2f0c30cb8dae by Nikhil Marathe.
Committed on 26/08/2011 at 12:53.
Pushed by nikhilm into branch 'master'.

Bug 279559 - EditFilterDialog i18n AND/OR fix.

Use combobox index to insert English separator instead.

BUG: 279559
REVIEW: 102443

M  +1    -1    src/dialogs/EditFilterDialog.h
M  +9    -4    src/dialogs/EditFilterDialog.cpp
M  +2    -0    ChangeLog

http://commits.kde.org/amarok/318f6e3c4e07ae1006e1991dae8a2f0c30cb8dae

diff --git a/ChangeLog b/ChangeLog
index 9125dca..37e3cf9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,8 @@ Version 2.4.4-Beta 1
     * Current track applet: show number of artists instead of genres. (BR 261077)
 
   BUGFIXES:
+    * Always use English AND/OR in Collection Filter even if translations are
+      in effect. (BR 279559)
     * Fix errors in the saved playlists view when removing a playlist. (BR 273358)
     * Fixed issue where the Context View wrench was not created when the
       Context View had no applets. (BR 280382)
diff --git a/src/dialogs/EditFilterDialog.cpp b/src/dialogs/EditFilterDialog.cpp
index eb59f27..91628ff 100644
--- a/src/dialogs/EditFilterDialog.cpp
+++ b/src/dialogs/EditFilterDialog.cpp
@@ -69,8 +69,8 @@ EditFilterDialog::EditFilterDialog( QWidget* parent, const QString &text )
     connect( this, SIGNAL( resetClicked() ), SLOT( slotReset() ) );
     connect( m_ui->cbInvert, SIGNAL( toggled( bool ) ),
              SLOT( slotInvert( bool ) ) );
-    connect( m_ui->cbAndOr, SIGNAL( currentIndexChanged( QString ) ),
-             SLOT( slotSeparatorChange( QString ) ) );
+    connect( m_ui->cbAndOr, SIGNAL( currentIndexChanged( int ) ),
+             SLOT( slotSeparatorChange( int ) ) );
     connect( m_dropTarget, SIGNAL( focusReceived( QWidget * ) ),
              SLOT( slotTokenSelected( QWidget * ) ) );
     connect( m_dropTarget, SIGNAL( changed() ),
@@ -143,9 +143,14 @@ EditFilterDialog::slotInvert( bool checked )
 }
 
 void
-EditFilterDialog::slotSeparatorChange( const QString &separator )
+EditFilterDialog::slotSeparatorChange( int index )
 {
-    m_separator = QString( " %1 " ).arg( separator );
+    // this depends on the order of combobox entries in EditFilterDialog.ui
+    // but fixes Bug 279559
+    if( index == 0 )
+        m_separator = QString( " AND " );
+    else
+        m_separator = QString( " OR " );
 
     m_ui->label->setText( filter() );
 }
diff --git a/src/dialogs/EditFilterDialog.h b/src/dialogs/EditFilterDialog.h
index 8a91505..c6f8d7b 100644
--- a/src/dialogs/EditFilterDialog.h
+++ b/src/dialogs/EditFilterDialog.h
@@ -51,7 +51,7 @@ class EditFilterDialog : public KDialog
         void slotTokenDropTargetChanged();
         void slotAttributeChanged( const MetaQueryWidget::Filter &filter );
         void slotInvert( bool checked );
-        void slotSeparatorChange( const QString &separator );
+        void slotSeparatorChange( int index );
         void slotReset();
         void accept();
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic