summaryrefslogtreecommitdiff
authorzecke <zecke>2002-11-06 21:46:09 (UTC)
committer zecke <zecke>2002-11-06 21:46:09 (UTC)
commit86a2bf4747f46a9915dffac376b888faa5400ec8 (patch) (side-by-side diff)
tree247946d61e915e1c238ce87a7ee14f014fc6e804
parent7a0e2678368c1cbb036085aaa594801e93e0b1c1 (diff)
downloadopie-86a2bf4747f46a9915dffac376b888faa5400ec8.zip
opie-86a2bf4747f46a9915dffac376b888faa5400ec8.tar.gz
opie-86a2bf4747f46a9915dffac376b888faa5400ec8.tar.bz2
Some ugly ifdefs inside fontdatabase for now :(
This temp. helps the x11 port
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/fontdatabase.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/library/fontdatabase.cpp b/library/fontdatabase.cpp
index 899d5cf..c7a5211 100644
--- a/library/fontdatabase.cpp
+++ b/library/fontdatabase.cpp
@@ -49,14 +49,14 @@ static QString fontFamily( const QString& key )
//bool italic = key.mid(u2-1,1) == "i";
// #### ignores _t and _I fields
return family;
}
#endif
-QValueList<FontFactory> *FontDatabase::factoryList = 0;
+QValueList<FontFactory> *FontDatabase::factoryList = 0;
/*!
\class FontDatabase fontdatabase.h
\brief The FontDatabase class provides information about available fonts.
Most often you will simply want to query the database for the
available font families().
@@ -89,12 +89,17 @@ FontDatabase::FontDatabase()
*/
QStringList FontDatabase::families() const
{
#ifndef QT_NO_FONTDATABASE
return QFontDatabase::families();
#else
+
+#ifndef QWS
+ QStringList list;
+ return list;
+#else
QStringList list;
QDict<void> familyDict;
QDiskFont *qdf;
for ( qdf=qt_fontmanager->diskfonts.first(); qdf!=0;
qdf=qt_fontmanager->diskfonts.next()) {
QString familyname = qdf->name;
@@ -112,12 +117,13 @@ QStringList FontDatabase::families() const
list.append( familyname );
}
}
return list;
#endif
+#endif
}
#ifdef QT_NO_FONTDATABASE
/*!
Returns a list of standard fontsizes.
*/
@@ -141,12 +147,16 @@ QValueList<int> FontDatabase::standardSizes()
/*!
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 ) {
@@ -180,19 +190,23 @@ void FontDatabase::loadRenderers()
readFonts( factory.factory );
} else {
delete lib;
}
}
#endif
+#endif
}
/*!
\internal
*/
void FontDatabase::readFonts( QFontFactory *factory )
{
+#ifndef QWS
+return;
+#else
// 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?",
@@ -227,8 +241,9 @@ void FontDatabase::readFonts( QFontFactory *factory )
}
}
}
fgets(buf,200,fontdef);
}
fclose(fontdef);
+#endif
}