summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@nokia.com>2010-09-08 19:03:05 (GMT)
committerAlessandro Portale <alessandro.portale@nokia.com>2010-09-08 19:58:02 (GMT)
commitc207a85d9d8e541a30f7dd7f0721f204757650e1 (patch)
tree60c2f4d4ac34044cdf1d5c5cdb137d3b916ccbed
parent0c49838016ab77d596f53774d8432f9f4d6b1188 (diff)
downloadQt-c207a85d9d8e541a30f7dd7f0721f204757650e1.zip
Qt-c207a85d9d8e541a30f7dd7f0721f204757650e1.tar.gz
Qt-c207a85d9d8e541a30f7dd7f0721f204757650e1.tar.bz2
Moved font list getter to qfontdatabase_s60.cpp. Reusable.
Preparations for Application font support on Symbian Task-Number: QTBUG-6611
-rw-r--r--src/gui/text/qfont_s60.cpp13
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp15
2 files changed, 19 insertions, 9 deletions
diff --git a/src/gui/text/qfont_s60.cpp b/src/gui/text/qfont_s60.cpp
index 2d547a9..d39f30a 100644
--- a/src/gui/text/qfont_s60.cpp
+++ b/src/gui/text/qfont_s60.cpp
@@ -49,16 +49,11 @@ QT_BEGIN_NAMESPACE
#ifdef QT_NO_FREETYPE
Q_GLOBAL_STATIC(QMutex, lastResortFamilyMutex);
+extern QStringList qt_symbian_fontFamiliesOnFontServer(); // qfontdatabase_s60.cpp
Q_GLOBAL_STATIC_WITH_INITIALIZER(QStringList, fontFamiliesOnFontServer, {
- QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
- const int numTypeFaces = S60->screenDevice()->NumTypefaces();
- for (int i = 0; i < numTypeFaces; i++) {
- TTypefaceSupport typefaceSupport;
- S60->screenDevice()->TypefaceSupport(typefaceSupport, i);
- const QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length());
- x->append(familyName);
- }
- lock.relock();
+ // We are only interested in the initial font families. No Application fonts.
+ // Therefore, we are allowed to cache the list.
+ x->append(qt_symbian_fontFamiliesOnFontServer());
});
#endif // QT_NO_FREETYPE
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index f9d8d31..b73555f 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -58,6 +58,21 @@
QT_BEGIN_NAMESPACE
+QStringList qt_symbian_fontFamiliesOnFontServer() // Also used in qfont_s60.cpp
+{
+ QStringList result;
+ QSymbianFbsHeapLock lock(QSymbianFbsHeapLock::Unlock);
+ const int numTypeFaces = S60->screenDevice()->NumTypefaces();
+ for (int i = 0; i < numTypeFaces; i++) {
+ TTypefaceSupport typefaceSupport;
+ S60->screenDevice()->TypefaceSupport(typefaceSupport, i);
+ const QString familyName((const QChar *)typefaceSupport.iTypeface.iName.Ptr(), typefaceSupport.iTypeface.iName.Length());
+ result.append(familyName);
+ }
+ lock.relock();
+ return result;
+}
+
QFileInfoList alternativeFilePaths(const QString &path, const QStringList &nameFilters,
QDir::Filters filters = QDir::NoFilter, QDir::SortFlags sort = QDir::NoSort,
bool uniqueFileNames = true)