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

List:       kde-commits
Subject:    Re: KDE/kdebase/runtime/nepomuk/strigibackend
From:       André_Wöbbeking <Woebbeking () kde ! org>
Date:       2008-06-29 13:19:03
Message-ID: 200806291519.03747.Woebbeking () kde ! org
[Download RAW message or body]

On Sunday 29 June 2008, Sebastian Trueg wrote:
> SVN commit 825734 by trueg:
>
> Of course I also have to escape the escape char (the backslash).
>
>
>  M  +8 -2      sopranoindexreader.cpp
>
>
> ---
> trunk/KDE/kdebase/runtime/nepomuk/strigibackend/sopranoindexreader.cp
>p #825733:825734 @@ -180,6 +180,12 @@
>  }
>
>
> +static QString escapeLiteralForSparqlQuery( const QString& s )
> +{
> +    return QString( s ).replace( '\\', "\\\\" ).replace( '\"',
> "\\\"" ); +}
> +
> +
>  class Strigi::Soprano::IndexReader::Private
>  {
>  public:
> @@ -369,7 +375,7 @@
>  //    qDebug() << "IndexReader::getChildren in thread" <<
> QThread::currentThread(); QString query = QString( "select distinct
> ?path ?mtime where { ?r <%1> \"%2\"^^<%3> . ?r <%4> ?mtime . ?r <%5>
> ?path . }") .arg( Util::fieldUri(
> FieldRegister::parentLocationFieldName ).toString() ) -              
>      .arg( QString::fromUtf8( parent.c_str() ).replace( '\"', "\\\""
> ) ) +                    .arg( escapeLiteralForSparqlQuery(
> QString::fromUtf8( parent.c_str() ) ) ) .arg(
> Vocabulary::XMLSchema::string().toString() ) .arg( Util::fieldUri(
> FieldRegister::mtimeFieldName ).toString() ) .arg( Util::fieldUri(
> FieldRegister::pathFieldName ).toString() );

Shouldn't you use the multi arg() just in case one string contains 
something like "#1"?
[prev in list] [next in list] [prev in thread] [next in thread] 

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