Exemplo n.º 1
0
bool AliasUnit::disableAlias( QString & name )
{
    bool found = false;
    QMap<QString, TAlias *>::const_iterator it = mLookupTable.find( name );
    while( it != mLookupTable.end() && it.key() == name )
    {
        TAlias * pT = it.value();
        pT->setIsActive( false );
        ++it;
        found = true;
    }
    return found;
}
Exemplo n.º 2
0
bool AliasUnit::killAlias( QString & name )
{
    typedef list<TAlias *>::const_iterator I;
    for( I it = mAliasRootNodeList.begin(); it != mAliasRootNodeList.end(); it++)
    {
        TAlias * pChild = *it;
        if( pChild->getName() == name )
        {
            // only temporary Aliass can be killed
            if( ! pChild->isTempAlias() )
            {
                return false;
            }
            else
            {
                pChild->setIsActive( false );
                markCleanup( pChild );
                return true;
            }
        }
    }
    return false;
}
Exemplo n.º 3
0
void XMLimport::readAliasGroup( TAlias * pParent )
{
    TAlias * pT;
    if( pParent )
    {
        pT = new TAlias( pParent, mpHost );
    }
    else
    {
        pT = new TAlias( 0, mpHost );
    }

    mpHost->getAliasUnit()->registerAlias( pT );
    pT->setIsActive( ( attributes().value("isActive") == "yes" ) );
    pT->mIsFolder = ( attributes().value("isFolder") == "yes" );
    if (module)
        pT->mModuleMember = true;

    while( ! atEnd() )
    {
        readNext();
        if( isEndElement() ) break;

        if( isStartElement() )
        {
            if( name() == "name" )
            {
                pT->setName( readElementText() );
                continue;
            }
            else if( name() == "packageName")
            {
                pT->mPackageName = readElementText();
                continue;
            }
            else if( name() == "script")
            {
                QString script = readElementText();
                pT->setScript( script );
                continue;
            }
            else if( name() == "command")
            {
                pT->mCommand = readElementText();
                continue;
            }
            else if( name() == "regex")
            {
                pT->setRegexCode( readElementText() );
                continue;
            }
            else if( name() == "AliasGroup" )
            {
                readAliasGroup( pT );
            }
            else if( name() == "Alias" )
            {
                readAliasGroup( pT );
            }
            else
            {
                readUnknownAliasElement();
            }
        }
    }


}