コード例 #1
0
ファイル: safecode.cpp プロジェクト: vasi/kdelibs
QString SafeCode::propertyReversePropertyGetterDefinition( const Property* property, const ResourceClass* rc ) const
{
    QString s = propertyReversePropertyGetterDeclaration( property, rc, "Nepomuk" ) + '\n';

    s += QString( "{\n"
                  "    return convertResourceList<%2>( manager()->allResourcesWithProperty( QUrl::fromEncoded(\"%1\"), *this ) );\n"
                  "}\n" )
         .arg( property->uri().toString() )
         .arg( property->domain(true)->name() );

    return s;
}
コード例 #2
0
ファイル: safecode.cpp プロジェクト: KDE/nepomuk-core
QString SafeCode::propertyReversePropertyGetterDefinition( const Property* property, const ResourceClass* rc ) const
{
    QString s = propertyReversePropertyGetterDeclaration( property, rc, "Nepomuk2" ) + '\n';

    s += QString( "{\n"
                  //"    return convertResourceList<%2>( manager()->allResourcesWithProperty( QUrl::fromEncoded(\"%1\"), *this ) );\n"
                  "    QList<%2> rl;\n"
                  "    QList<Resource> l = ResourceManager::instance()->allResourcesWithProperty( QUrl::fromEncoded(\"%1\"), *this );\n"
                  "    for( QList<Resource>::const_iterator it = l.constBegin();\n"
                  "        it != l.constEnd(); ++it )\n"
                  "    rl.append( %2( *it ) );\n"
                  "    return rl;\n"
                  "}\n" )
         .arg( property->uri().toString() )
         .arg( property->domain(true)->name() );

    return s;
}