summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-21 12:39:51 (UTC)
committer sandman <sandman>2002-10-21 12:39:51 (UTC)
commit32817a02b4fae7010e7ef1212916168845a58831 (patch) (side-by-side diff)
tree9859d99a7e507859d06d6e9f2a03a3b8efb046a8
parentcdaf60fdf5dc19e88db4faa319daacfe4e879518 (diff)
downloadopie-32817a02b4fae7010e7ef1212916168845a58831.zip
opie-32817a02b4fae7010e7ef1212916168845a58831.tar.gz
opie-32817a02b4fae7010e7ef1212916168845a58831.tar.bz2
Get rid of the QDir::readDirEntries: Cannot read the directory:
/opt/QtPalmtop/plugins/fontfactories message if no fontfactories are installed -- this seems to confuse users
Diffstat (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 147134c..899d5cf 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -132,64 +132,68 @@ QValueList<int> FontDatabase::standardSizes()
int i = 0;
while( s[i] )
sList.append( s[i++] );
}
return sList;
}
#endif
/*!
Load any font renderer plugins that are available and make the fonts
that the plugins can read available.
*/
void FontDatabase::loadRenderers()
{
#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";
QDir dir( path, "lib*.so" );
+
+ 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
}
/*!
\internal
*/
void FontDatabase::readFonts( QFontFactory *factory )
{
// Load in font definition file
QString fn = fontDir() + "fontdir";
FILE* fontdef=fopen(fn.local8Bit(),"r");
if(!fontdef) {
QCString temp=fn.local8Bit();
qWarning("Cannot find font definition file %s - is $QTDIR set correctly?",
temp.data());