summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2010-06-08 12:02:23 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2010-06-08 12:02:23 +0200
commit03dc74984749adf5b11482bf871a47086217845c (patch)
tree58eaa299c0d87d6d678fe635fddaab42177328cf /util
parentdfd7c876263310c03d8b64033749efe2b6b1e081 (diff)
parent0cd433404210fdaa6b21a98ef5768c9b761ed024 (diff)
downloadqt4-tools-03dc74984749adf5b11482bf871a47086217845c.tar.gz
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebKit/qt/Api/qwebpage.cpp src/3rdparty/webkit/WebKit/qt/ChangeLog src/gui/painting/qpainter.cpp src/gui/painting/qtextureglyphcache.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp src/opengl/gl2paintengineex/qtextureglyphcache_gl_p.h src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def src/s60installs/eabi/QtNetworku.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qfontmetrics/tst_qfontmetrics.cpp tools/linguist/lupdate/main.cpp
Diffstat (limited to 'util')
-rw-r--r--util/s60theme/main.cpp4
-rw-r--r--util/s60theme/s60themeconvert.cpp25
2 files changed, 20 insertions, 9 deletions
diff --git a/util/s60theme/main.cpp b/util/s60theme/main.cpp
index 7f38d5c1cd..1234fd2c92 100644
--- a/util/s60theme/main.cpp
+++ b/util/s60theme/main.cpp
@@ -70,9 +70,9 @@ int main(int argc, char *argv[])
const QFileInfo inputInfo(input);
const QString output = QString::fromLatin1(argv[2]);
if (inputInfo.isDir())
- return S60ThemeConvert::convertDefaultThemeToBlob(input, output);
+ return S60ThemeConvert::convertDefaultThemeToBlob(input, output) ? 0 : 1;
else if (inputInfo.suffix().compare(QString::fromLatin1("tdf"), Qt::CaseInsensitive) == 0)
- return S60ThemeConvert::convertTdfToBlob(input, output);
+ return S60ThemeConvert::convertTdfToBlob(input, output) ? 0 : 1;
return help();
}
diff --git a/util/s60theme/s60themeconvert.cpp b/util/s60theme/s60themeconvert.cpp
index 7908055b5f..b1e80225eb 100644
--- a/util/s60theme/s60themeconvert.cpp
+++ b/util/s60theme/s60themeconvert.cpp
@@ -45,6 +45,8 @@
#include <QtWebKit>
static const int pictureSize = 256;
+static const char* const msgPartNotInTdf = " Warning: The .tdf file does not have a part for ";
+static const char* const msgSvgNotFound = " Fatal: Could not find part .svg ";
void dumpPartPictures(const QHash<QString, QPicture> &partPictures) {
foreach (const QString &partKey, partPictures.keys()) {
@@ -84,6 +86,7 @@ private:
WebKitSVGRenderer::WebKitSVGRenderer(QWidget *parent)
: QWebView(parent)
{
+
connect(this, SIGNAL(loadFinished(bool)), SLOT(loadFinishedSlot(bool)));
setFixedSize(pictureSize, pictureSize);
QPalette pal = palette();
@@ -202,11 +205,19 @@ bool loadThemeFromTdf(const QString &tdfFile,
return false;
const QString tdfBasePath = QFileInfo(tdfFile).absolutePath();
WebKitSVGRenderer renderer;
- foreach(const QString& partKey, parsedPartSvgs.keys()) {
- const QString tdfFullName =
- tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey);
- if (!QFile(tdfFullName).exists())
- qWarning() << "Could not find part:" << parsedPartSvgs.value(partKey);
+ foreach (const QString &partKey, QS60Style::partKeys()) {
+ qDebug() << partKey;
+ QString tdfFullName;
+ if (parsedPartSvgs.contains(partKey)) {
+ tdfFullName = tdfBasePath + QDir::separator() + parsedPartSvgs.value(partKey);
+ } else {
+ qWarning() << msgPartNotInTdf << partKey;
+ tdfFullName = tdfBasePath + QDir::separator() + partKey + QLatin1String(".svg");
+ }
+ if (!QFile(tdfFullName).exists()) {
+ qWarning() << msgSvgNotFound << QDir::toNativeSeparators(tdfFullName);
+ return false;
+ }
const QPicture partPicture = renderer.svgToQPicture(tdfFullName);
parsedPartPictures.insert(partKey, partPicture);
}
@@ -276,8 +287,8 @@ bool loadDefaultTheme(const QString &themePath,
const QString partFileName = partKey + QLatin1String(".svg");
const QString partFile(dir.absolutePath() + QDir::separator() + partFileName);
if (!QFile::exists(partFile)) {
- qWarning() << "Could not find part:" << partFileName;
- continue;
+ qWarning() << msgSvgNotFound << partFileName;
+ return false;
}
const QPicture partPicture = renderer.svgToQPicture(partFile);
partPictures.insert(partKey, partPicture);