Exemplo n.º 1
0
void Configuration::load()
{
    readColors();
    readBools();
    readUints();
    readFonts();
    readShortcuts();
}
Exemplo n.º 2
0
/*!
  Load any font renderer plugins that are available and make the fonts
  that the plugins can read available.
*/
void FontDatabase::loadRenderers()
{
#ifndef QWS
    return;
#else

#ifndef QT_NO_COMPONENT
    if ( !factoryList )
	factoryList = new QValueList<FontFactory>;

    QValueList<FontFactory>::Iterator mit;
    for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) {
	qt_fontmanager->factories.setAutoDelete( false );
	qt_fontmanager->factories.removeRef( (*mit).factory );
	qt_fontmanager->factories.setAutoDelete( true );
	(*mit).interface->release();
	(*mit).library->unload();
	delete (*mit).library;
    }
    factoryList->clear();

    QString path = QPEApplication::qpeDir() + "plugins/fontfactories";
#ifdef Q_OS_MACX
    QDir dir( path, "lib*.dylib" );
#else
    QDir dir( path, "lib*.so" );
#endif

    if ( !dir.exists())
    	return;

    QStringList list = dir.entryList();
    QStringList::Iterator it;
    for ( it = list.begin(); it != list.end(); ++it ) {
	FontFactoryInterface *iface = 0;
	QLibrary *lib = new QLibrary( path + "/" + *it );
	if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) {
	    FontFactory factory;
	    factory.library = lib;
	    factory.interface = iface;
	    factory.factory = factory.interface->fontFactory();
	    factoryList->append( factory );
	    qt_fontmanager->factories.append( factory.factory );
	    readFonts( factory.factory );
	} else {
	    delete lib;
	}
    }
#endif
#endif
}