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

List:       amarok-bugs-dist
Subject:    [Bug 139394] Unable to use empty string in smart playlist's match
From:       Maximilian Kossick <maximilian.kossick () googlemail ! com>
Date:       2006-12-31 14:39:06
Message-ID: 20061231143906.25561.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=139394         




------- Additional Comments From maximilian.kossick googlemail com  2006-12-31 15:39 \
------- SVN commit 618193 by mkossick:

filtering for empty strings works for "is not" too
CCBUG: 139394

 M  +17 -20    collectiondb.cpp  


--- trunk/extragear/multimedia/amarok/src/collectiondb.cpp #618192:618193
 @ -7141,31 +7141,28  @
 void
 QueryBuilder::excludeFilter( int tables, Q_INT64 value, const QString& filter, int \
mode, bool exact )  {
-    if ( !filter.isEmpty() )
-    {
-        m_where += ANDslashOR() + " ( ";
+    m_where += ANDslashOR() + " ( ";
 
-        QString m, s;
-        if (mode == modeLess || mode == modeGreater)
-            s = ( mode == modeLess ? ">= '" : "<= '" ) + \
CollectionDB::instance()->escapeString( filter ) + "' "; +    QString m, s;
+    if (mode == modeLess || mode == modeGreater)
+        s = ( mode == modeLess ? ">= '" : "<= '" ) + \
CollectionDB::instance()->escapeString( filter ) + "' "; +    else
+    {
+        if (exact)
+            s = " <> '" + CollectionDB::instance()->escapeString( filter ) + "' ";
         else
-        {
-            if (exact)
-                s = " <> '" + CollectionDB::instance()->escapeString( filter ) + "' \
                ";
-            else
-                s = "NOT " + CollectionDB::instance()->likeCondition( filter, mode \
                != modeBeginMatch, mode != modeEndMatch ) + ' ';
-        }
+            s = "NOT " + CollectionDB::instance()->likeCondition( filter, mode != \
modeBeginMatch, mode != modeEndMatch ) + ' '; +    }
 
-        if( coalesceField( tables, value ) )
-            m_where += QString( "COALESCE(%1.%2,0) " ).arg( tableName( tables ) \
                ).arg( valueName( value ) ) + s;
-        else
-            m_where += QString( "%1.%2 " ).arg( tableName( tables ) ).arg( \
valueName( value ) ) + s; +    if( coalesceField( tables, value ) )
+        m_where += QString( "COALESCE(%1.%2,0) " ).arg( tableName( tables ) ).arg( \
valueName( value ) ) + s; +    else
+        m_where += QString( "%1.%2 " ).arg( tableName( tables ) ).arg( valueName( \
value ) ) + s;  
-        if ( !exact && (value & valName) && mode == modeNormal && i18n( \
                "Unknown").contains( filter, false ) )
-            m_where += QString( "AND %1.%2 <> '' " ).arg( tableName( tables ) ).arg( \
valueName( value ) ); +    if ( !exact && (value & valName) && mode == modeNormal && \
i18n( "Unknown").contains( filter, false ) ) +        m_where += QString( "AND %1.%2 \
<> '' " ).arg( tableName( tables ) ).arg( valueName( value ) );  
-        m_where += " ) ";
-    }
+    m_where += " ) ";
 
     m_linkTables |= tables;
 }
_______________________________________________
Amarok-bugs-dist mailing list
Amarok-bugs-dist@kde.org
https://mail.kde.org/mailman/listinfo/amarok-bugs-dist


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

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