Beispiel #1
0
void ZAddAppDlg::addApp(QString name, QString icon, int i)
{
	#ifdef FIX_LISTBOX
	ZListBoxItem* listitem = new ZListBoxItem( lbAppList, QString ( "%I%M" ) );
	#else
	ZSettingItem* listitem = new ZSettingItem( lbAppList, QString ( "%I%M" ) );	
	#endif
	listitem->appendSubItem ( 1, name , true );
	QPixmap pm;
	
	#ifndef NEW_PLATFORM
	if (icon.right(2)==".g")
	#else
	if ( (icon.right(2)==".g") || (icon.right(2)==".k") )
	#endif
	{
		RES_ICON_Reader res;
		pm = res.getIcon(icon);
	} else
	{
		if ( !QFile::exists(icon) )		
			icon = settings->getProgramDir() + QString ( "/img/run_app.png" );
		pm.load( icon );
	}
	imgSetMaxSize(&pm, 19);	
	listitem->setPixmap ( 0, pm );
	listitem->setReservedData ( i );
	lbAppList->insertItem ( listitem,-1,true );
}