Commit baf3b04a authored by Jan Möbius's avatar Jan Möbius

Don't create icons, when no gui is available

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15789 383ad7c9-94d9-4d36-a494-682f7c89f535
parent a1dcb213
......@@ -225,30 +225,32 @@ QIcon& typeIcon(DataType _id) {
/// Set the icon for a given dataType
void setTypeIcon( DataType _id , QString _icon ) {
std::map<DataType, unsigned int>::iterator index = typeToTypeInfo.find(_id);
if ( index != typeToTypeInfo.end() ) {
types[ index->second ].iconName = _icon;
types[ index->second ].icon = QIcon( OpenFlipper::Options::iconDirStr() + QDir::separator() + _icon );
} else
std::cerr << "Could not set icon for DataType. Type not found!" << std::endl;
if ( OpenFlipper::Options::gui() ) {
std::map<DataType, unsigned int>::iterator index = typeToTypeInfo.find(_id);
if ( index != typeToTypeInfo.end() ) {
types[ index->second ].iconName = _icon;
types[ index->second ].icon = QIcon( OpenFlipper::Options::iconDirStr() + QDir::separator() + _icon );
} else
std::cerr << "Could not set icon for DataType. Type not found!" << std::endl;
}
}
/// Set the icon for a given dataType
void setTypeIcon( QString _name , QString _icon ) {
std::map<QString, unsigned int>::iterator index = stringToTypeInfo.find( _name );
if ( OpenFlipper::Options::gui() ) {
std::map<QString, unsigned int>::iterator index = stringToTypeInfo.find( _name );
if ( index != stringToTypeInfo.end() ) {
types[ index->second ].iconName = _icon;
types[ index->second ].icon = QIcon( OpenFlipper::Options::iconDirStr() + QDir::separator() + _icon );
} else
std::cerr << "Could not set icon for DataType. Type not found!" << std::endl;
if ( index != stringToTypeInfo.end() ) {
types[ index->second ].iconName = _icon;
types[ index->second ].icon = QIcon( OpenFlipper::Options::iconDirStr() + QDir::separator() + _icon );
} else
std::cerr << "Could not set icon for DataType. Type not found!" << std::endl;
}
}
/// Get DataType Human readable name ( this name might change. Use the typeName insted! )
QString dataTypeName( DataType _id ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment