summaryrefslogtreecommitdiff
path: root/library/fontdatabase.cpp
Unidiff
Diffstat (limited to 'library/fontdatabase.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/fontdatabase.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp
index 147134c..899d5cf 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -140,48 +140,52 @@ QValueList<int> FontDatabase::standardSizes()
140 140
141/*! 141/*!
142 Load any font renderer plugins that are available and make the fonts 142 Load any font renderer plugins that are available and make the fonts
143 that the plugins can read available. 143 that the plugins can read available.
144*/ 144*/
145void FontDatabase::loadRenderers() 145void FontDatabase::loadRenderers()
146{ 146{
147#ifndef QT_NO_COMPONENT 147#ifndef QT_NO_COMPONENT
148 if ( !factoryList ) 148 if ( !factoryList )
149 factoryList = new QValueList<FontFactory>; 149 factoryList = new QValueList<FontFactory>;
150 150
151 QValueList<FontFactory>::Iterator mit; 151 QValueList<FontFactory>::Iterator mit;
152 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) { 152 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) {
153 qt_fontmanager->factories.setAutoDelete( false ); 153 qt_fontmanager->factories.setAutoDelete( false );
154 qt_fontmanager->factories.removeRef( (*mit).factory ); 154 qt_fontmanager->factories.removeRef( (*mit).factory );
155 qt_fontmanager->factories.setAutoDelete( true ); 155 qt_fontmanager->factories.setAutoDelete( true );
156 (*mit).interface->release(); 156 (*mit).interface->release();
157 (*mit).library->unload(); 157 (*mit).library->unload();
158 delete (*mit).library; 158 delete (*mit).library;
159 } 159 }
160 factoryList->clear(); 160 factoryList->clear();
161 161
162 QString path = QPEApplication::qpeDir() + "/plugins/fontfactories"; 162 QString path = QPEApplication::qpeDir() + "/plugins/fontfactories";
163 QDir dir( path, "lib*.so" ); 163 QDir dir( path, "lib*.so" );
164
165 if ( !dir.exists())
166 return;
167
164 QStringList list = dir.entryList(); 168 QStringList list = dir.entryList();
165 QStringList::Iterator it; 169 QStringList::Iterator it;
166 for ( it = list.begin(); it != list.end(); ++it ) { 170 for ( it = list.begin(); it != list.end(); ++it ) {
167 FontFactoryInterface *iface = 0; 171 FontFactoryInterface *iface = 0;
168 QLibrary *lib = new QLibrary( path + "/" + *it ); 172 QLibrary *lib = new QLibrary( path + "/" + *it );
169 if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) { 173 if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) {
170 FontFactory factory; 174 FontFactory factory;
171 factory.library = lib; 175 factory.library = lib;
172 factory.interface = iface; 176 factory.interface = iface;
173 factory.factory = factory.interface->fontFactory(); 177 factory.factory = factory.interface->fontFactory();
174 factoryList->append( factory ); 178 factoryList->append( factory );
175 qt_fontmanager->factories.append( factory.factory ); 179 qt_fontmanager->factories.append( factory.factory );
176 readFonts( factory.factory ); 180 readFonts( factory.factory );
177 } else { 181 } else {
178 delete lib; 182 delete lib;
179 } 183 }
180 } 184 }
181#endif 185#endif
182} 186}
183 187
184/*! 188/*!
185 \internal 189 \internal
186*/ 190*/
187void FontDatabase::readFonts( QFontFactory *factory ) 191void FontDatabase::readFonts( QFontFactory *factory )