From 6894bf6e861fe66d173e4c987fc4244bacf95dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 15 Jul 2010 18:59:26 +0000 Subject: [PATCH] Intel drivers add a whitespace at the end of the renderer string which makes it impossible to get a good blacklist with equal comparison. So let's switch to a contains check, which makes it easier to have a blacklist, e.g. just GeForce. CCBUG: 243181 CCBUG: 242985 svn path=/trunk/KDE/kdebase/workspace/; revision=1150353 --- lib/kwineffects.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/kwineffects.cpp b/lib/kwineffects.cpp index 3e1ac7e96f..fb2373d47a 100644 --- a/lib/kwineffects.cpp +++ b/lib/kwineffects.cpp @@ -393,8 +393,7 @@ bool EffectsHandler::checkDriverBlacklist( const KConfigGroup& blacklist ) { QString vendor = QString((const char*)glGetString( GL_VENDOR )); QString renderer = QString((const char*)glGetString( GL_RENDERER )); - renderer.append( ":-:" ); - renderer.append((const char*)glGetString( GL_VERSION )); + QString version = QString((const char*)glGetString( GL_VERSION )); foreach( const QString& key, blacklist.keyList() ) { // the key is a word in the renderer string or vendor referrencing the vendor in case of mesa @@ -403,9 +402,15 @@ bool EffectsHandler::checkDriverBlacklist( const KConfigGroup& blacklist ) { // the value for current key contains a string list of driver versions which have to be blacklisted QStringList versions = blacklist.readEntry< QStringList >( key, QStringList() ); - foreach( const QString& version, versions ) + foreach( const QString& entry, versions ) { - if( version == renderer ) + QStringList parts = entry.split( ":-:" ); + if( parts.size() != 2 ) + { + continue; + } + if( renderer.contains(parts[0], Qt::CaseInsensitive) && + version.contains(parts[1], Qt::CaseInsensitive) ) { // the version matches the renderer string - this driver is blacklisted, return return true;