[yast-commit] r48661 - in /trunk/ldap-server/src: agent/SlapdConfigAgent.cc lib/slapd-config.h
Author: rhafer
Date: Fri Jun 27 16:01:21 2008
New Revision: 48661
URL: http://svn.opensuse.org/viewcvs/yast?rev=48661&view=rev
Log:
Fixed compiler warnings
Modified:
trunk/ldap-server/src/agent/SlapdConfigAgent.cc
trunk/ldap-server/src/lib/slapd-config.h
Modified: trunk/ldap-server/src/agent/SlapdConfigAgent.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/agent/SlapdConfigAgent.cc?rev=48661&r1=48660&r2=48661&view=diff
==============================================================================
--- trunk/ldap-server/src/agent/SlapdConfigAgent.cc (original)
+++ trunk/ldap-server/src/agent/SlapdConfigAgent.cc Fri Jun 27 16:01:21 2008
@@ -476,24 +476,33 @@
y2milestone("Component %s ", dbComponent.c_str());
if ( dbComponent == "indexes" )
{
- IndexMap idx = (*i)->getDatabaseIndexes();
- IndexMap::const_iterator j = idx.begin();
- for ( ; j != idx.end(); j++ )
- {
- YCPMap ycpIdx;
- y2milestone("indexed Attribute: \"%s\"", j->first.c_str() );
- std::vector<IndexType>::const_iterator k = j->second.begin();
- for ( ; k != j->second.end(); k++ )
+ boost::shared_ptr<OlcBdbDatabase> bdb =
+ boost::dynamic_pointer_cast<OlcBdbDatabase>(*i);
+ if ( bdb == 0 )
+ {
+ y2milestone("Database doesn't provide indexing\n");
+ }
+ else
+ {
+ IndexMap idx = bdb->getDatabaseIndexes();
+ IndexMap::const_iterator j = idx.begin();
+ for ( ; j != idx.end(); j++ )
{
- if ( *k == Eq ){
- ycpIdx.add(YCPString("eq"), YCPBoolean(true) );
- } else if ( *k == Present ){
- ycpIdx.add(YCPString("pres"), YCPBoolean(true) );
- } else if ( *k == Sub ){
- ycpIdx.add(YCPString("sub"), YCPBoolean(true) );
+ YCPMap ycpIdx;
+ y2milestone("indexed Attribute: \"%s\"", j->first.c_str() );
+ std::vector<IndexType>::const_iterator k = j->second.begin();
+ for ( ; k != j->second.end(); k++ )
+ {
+ if ( *k == Eq ){
+ ycpIdx.add(YCPString("eq"), YCPBoolean(true) );
+ } else if ( *k == Present ){
+ ycpIdx.add(YCPString("pres"), YCPBoolean(true) );
+ } else if ( *k == Sub ){
+ ycpIdx.add(YCPString("sub"), YCPBoolean(true) );
+ }
}
+ resMap.add( YCPString(j->first), ycpIdx );
}
- resMap.add( YCPString(j->first), ycpIdx );
}
return resMap;
}
@@ -791,28 +800,38 @@
y2milestone("Component '%s'", dbComponent.c_str());
if ( dbComponent == "index" )
{
- std::vector<IndexType> idx;
- std::string attr( arg->asMap()->value(YCPString("name"))->asString()->value_cstr() );
- y2milestone("Edit Index for Attribute: '%s'", attr.c_str() );
- if ( arg->asMap()->value(YCPString("pres"))->asBoolean()->value() == true )
+ boost::shared_ptr<OlcBdbDatabase> bdb =
+ boost::dynamic_pointer_cast<OlcBdbDatabase>(*i);
+ if ( bdb == 0 )
{
- idx.push_back(Present);
+ y2milestone("Database doesn't provide indexing\n");
+ ret = false;
}
- if ( arg->asMap()->value(YCPString("eq"))->asBoolean()->value() == true )
- {
- idx.push_back(Eq);
- }
- if ( arg->asMap()->value(YCPString("sub"))->asBoolean()->value() == true )
+ else
{
- idx.push_back(Sub);
- }
- if ( ( idx.empty()) || ( ! (*i)->getDatabaseIndex(attr).empty() ) ) {
- (*i)->deleteIndex( attr );
- }
- if ( ! idx.empty() ) {
- (*i)->addIndex(attr, idx);
+ std::vector<IndexType> idx;
+ std::string attr( arg->asMap()->value(YCPString("name"))->asString()->value_cstr() );
+ y2milestone("Edit Index for Attribute: '%s'", attr.c_str() );
+ if ( arg->asMap()->value(YCPString("pres"))->asBoolean()->value() == true )
+ {
+ idx.push_back(Present);
+ }
+ if ( arg->asMap()->value(YCPString("eq"))->asBoolean()->value() == true )
+ {
+ idx.push_back(Eq);
+ }
+ if ( arg->asMap()->value(YCPString("sub"))->asBoolean()->value() == true )
+ {
+ idx.push_back(Sub);
+ }
+ if ( ( idx.empty()) || ( ! bdb->getDatabaseIndex(attr).empty() ) ) {
+ bdb->deleteIndex( attr );
+ }
+ if ( ! idx.empty() ) {
+ bdb->addIndex(attr, idx);
+ }
+ ret = true;
}
- ret = true;
}
else if (dbComponent == "ppolicy" )
{
Modified: trunk/ldap-server/src/lib/slapd-config.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/lib/slapd-config.h?rev=48661&r1=48660&r2=48661&view=diff
==============================================================================
--- trunk/ldap-server/src/lib/slapd-config.h (original)
+++ trunk/ldap-server/src/lib/slapd-config.h Fri Jun 27 16:01:21 2008
@@ -127,10 +127,6 @@
const std::string getType() const;
//virtual std::map
participants (1)
-
rhafer@svn.opensuse.org