Logo Search packages:      
Sourcecode: rosegarden version File versions

std::string Rosegarden::ColourMap::getNameByIndex ( unsigned int  item_num  )  const

Returns the string associated with the item_num passed in. If the item_num doesn't exist, it'll return "" (the same name as the default colour has - for internationalization reasons).

Definition at line 94 of file ColourMap.cpp.

    // Iterate over the m_map and if we find a match, return the name.
    // If we don't match, return the default colour's name.  m_map was
    // initialised with at least one item in the ctor, so this is
    // safe.
    std::string ret = (*m_map.begin()).second.second;

    for (RCMap::const_iterator position = m_map.begin();
       position != m_map.end(); ++position)
        if (position->first == item_num)
            ret = position->second.second;

    return ret;

Generated by  Doxygen 1.6.0   Back to index