summaryrefslogtreecommitdiff
path: root/library/fontdatabase.cpp
Unidiff
Diffstat (limited to 'library/fontdatabase.cpp') (more/less context) (ignore 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 c7a5211..2ad8e95 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -149,49 +149,53 @@ QValueList<int> FontDatabase::standardSizes()
149 that the plugins can read available. 149 that the plugins can read available.
150*/ 150*/
151void FontDatabase::loadRenderers() 151void FontDatabase::loadRenderers()
152{ 152{
153#ifndef QWS 153#ifndef QWS
154 return; 154 return;
155#else 155#else
156 156
157#ifndef QT_NO_COMPONENT 157#ifndef QT_NO_COMPONENT
158 if ( !factoryList ) 158 if ( !factoryList )
159 factoryList = new QValueList<FontFactory>; 159 factoryList = new QValueList<FontFactory>;
160 160
161 QValueList<FontFactory>::Iterator mit; 161 QValueList<FontFactory>::Iterator mit;
162 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) { 162 for ( mit = factoryList->begin(); mit != factoryList->end(); ++mit ) {
163 qt_fontmanager->factories.setAutoDelete( false ); 163 qt_fontmanager->factories.setAutoDelete( false );
164 qt_fontmanager->factories.removeRef( (*mit).factory ); 164 qt_fontmanager->factories.removeRef( (*mit).factory );
165 qt_fontmanager->factories.setAutoDelete( true ); 165 qt_fontmanager->factories.setAutoDelete( true );
166 (*mit).interface->release(); 166 (*mit).interface->release();
167 (*mit).library->unload(); 167 (*mit).library->unload();
168 delete (*mit).library; 168 delete (*mit).library;
169 } 169 }
170 factoryList->clear(); 170 factoryList->clear();
171 171
172 QString path = QPEApplication::qpeDir() + "/plugins/fontfactories"; 172 QString path = QPEApplication::qpeDir() + "/plugins/fontfactories";
173#ifdef Q_OS_MACX
174 QDir dir( path, "lib*.dylib" );
175#else
173 QDir dir( path, "lib*.so" ); 176 QDir dir( path, "lib*.so" );
177#endif
174 178
175 if ( !dir.exists()) 179 if ( !dir.exists())
176 return; 180 return;
177 181
178 QStringList list = dir.entryList(); 182 QStringList list = dir.entryList();
179 QStringList::Iterator it; 183 QStringList::Iterator it;
180 for ( it = list.begin(); it != list.end(); ++it ) { 184 for ( it = list.begin(); it != list.end(); ++it ) {
181 FontFactoryInterface *iface = 0; 185 FontFactoryInterface *iface = 0;
182 QLibrary *lib = new QLibrary( path + "/" + *it ); 186 QLibrary *lib = new QLibrary( path + "/" + *it );
183 if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) { 187 if ( lib->queryInterface( IID_FontFactory, (QUnknownInterface**)&iface ) == QS_OK ) {
184 FontFactory factory; 188 FontFactory factory;
185 factory.library = lib; 189 factory.library = lib;
186 factory.interface = iface; 190 factory.interface = iface;
187 factory.factory = factory.interface->fontFactory(); 191 factory.factory = factory.interface->fontFactory();
188 factoryList->append( factory ); 192 factoryList->append( factory );
189 qt_fontmanager->factories.append( factory.factory ); 193 qt_fontmanager->factories.append( factory.factory );
190 readFonts( factory.factory ); 194 readFonts( factory.factory );
191 } else { 195 } else {
192 delete lib; 196 delete lib;
193 } 197 }
194 } 198 }
195#endif 199#endif
196#endif 200#endif
197} 201}