Esempio n. 1
0
QVariant Browser::AbstractCategoryModel::data( const QModelIndex & index, int role) const
{
    if ( !index.isValid() )
        return QVariant();
    const QString name = indexToName( index );
    const int column = index.column();

    if ( role == Qt::DisplayRole ) {
        switch( column ) {
        case 0: return text(name);
        case 1: return i18ncp("@item:intable number of images with a specific tag.","1 image", "%1 images", m_images[name]);
        case 2: return i18ncp("@item:intable number of videos with a specific tag.","1 video", "%1 videos", m_videos[name]);
        }
    }

    else if ( role == Qt::DecorationRole && column == 0) {
        return icon( name );
    }

    else if ( role == Qt::ToolTipRole )
        return text(name);

    else if ( role == ItemNameRole )
        return name;

    else if ( role == ValueRole ) {
        switch ( column ) {
        case 0: return name; // Notice we sort by **None** rather than None, which makes it show up at the top for less than searches.
        case 1: return m_images[name];
        case 2: return m_videos[name];
        }
    }

    return QVariant();
}
Esempio n. 2
0
int executeDr( mips * pMips, const int * toDisplay, const int len )
{
    int i;
    uint v;

    for( i = 1; i <= len; i++ )
    {
	// display register name: register value
	if( toDisplay[i-1] < 32 )
	    v = pMips->registers[toDisplay[i-1]];
	else if( 32 == toDisplay[i-1] )
	    v = pMips->regPC;
	else if( 33 == toDisplay[i-1] )
	    v = pMips->regHI;
	else if( 34 == toDisplay[i-1] )
	    v = pMips->regLO;
	else if( 35 == toDisplay[i-1] )
	    v = pMips->regSR;
	    
	printf( "%s:\t0x%08x", indexToName( toDisplay[i-1] ), v );

	// compute if '\n' must be displayed
	if( 0 == i % 4 )
	    printf( "\n" );
	else
	    printf( "\t\t" );
    }

    printf( "\n" );

    return 0;
}
Esempio n. 3
0
std::string Card::getLongName() const
{
  return indexToName(getIndex());
}