Hello,
i encountered a little issue while playing with Nepomuk::FileQuery.
Apparently the FILTER regex is not completely correct and this leads to no
results when including more than one folder.

I fixed with the little patch that i've attached.
Hope it is ok.

Regards
-- 
Alessandro Diaferia
KDE Developer
KDE e.V. member
Index: query/query.cpp
===================================================================
--- query/query.cpp	(revisione 1135402)
+++ query/query.cpp	(copia locale)
@@ -69,10 +69,10 @@ QString Nepomuk::Query::QueryPrivate::cr
         QString uriVarName = qbd->uniqueVarName();
         QString filter = resourceVarName + ' ' + Soprano::Node::resourceToN3( Nepomuk::Vocabulary::NIE::url() ) + ' ' + uriVarName + QLatin1String( " . " );
         if ( !m_includeFolders.isEmpty() ) {
-            filter += QString( " FILTER(REGEX(STR(%1), \"^%2/\")) ." ).arg( uriVarName ).arg( m_includeFolders.toStringList().join( "|" ) );
+            filter += QString( " FILTER(REGEX(STR(%1), \"^(%2/)\")) ." ).arg( uriVarName ).arg( m_includeFolders.toStringList().join( "|" ) );
         }
         if ( !m_excludeFolders.isEmpty() ) {
-            filter += QString( " FILTER(!REGEX(STR(%1), \"^%2/\")) ." ).arg( uriVarName ).arg( m_excludeFolders.toStringList().join( "|" ) );
+            filter += QString( " FILTER(!REGEX(STR(%1), \"^(%2/)\")) ." ).arg( uriVarName ).arg( m_excludeFolders.toStringList().join( "|" ) );
         }
         return filter;
     }
_______________________________________________
Nepomuk mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/nepomuk

Reply via email to