summaryrefslogtreecommitdiffstats
path: root/mandriva/2010.2/other/ksplash-engine-moodin/moodin-external_svgrender.patch
diff options
context:
space:
mode:
authorTim Williams <tmw@autotrain.org>2011-10-17 18:47:27 +0100
committerTim Williams <tmw@autotrain.org>2011-10-17 18:47:27 +0100
commit76ef832ce5348d12a871223d4c034c7daeaddb82 (patch)
tree7024a1f39a6114daa8c5ed24bb31a8687c832b9a /mandriva/2010.2/other/ksplash-engine-moodin/moodin-external_svgrender.patch
parentec2515f058c60d2478a549f58376db628ba556b9 (diff)
downloadtde-packaging-76ef832ce5348d12a871223d4c034c7daeaddb82.tar.gz
tde-packaging-76ef832ce5348d12a871223d4c034c7daeaddb82.zip
Adding the remaining Mandriva patches and spec files
Diffstat (limited to 'mandriva/2010.2/other/ksplash-engine-moodin/moodin-external_svgrender.patch')
-rw-r--r--mandriva/2010.2/other/ksplash-engine-moodin/moodin-external_svgrender.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/mandriva/2010.2/other/ksplash-engine-moodin/moodin-external_svgrender.patch b/mandriva/2010.2/other/ksplash-engine-moodin/moodin-external_svgrender.patch
new file mode 100644
index 000000000..6c0a5e900
--- /dev/null
+++ b/mandriva/2010.2/other/ksplash-engine-moodin/moodin-external_svgrender.patch
@@ -0,0 +1,51 @@
+diff -p -up moodin/src/cache.cpp.external_svgrender moodin/src/cache.cpp
+--- moodin/src/cache.cpp.external_svgrender 2007-12-20 15:15:29.000000000 -0200
++++ moodin/src/cache.cpp 2007-12-20 16:12:35.000000000 -0200
+@@ -13,9 +13,9 @@
+ #include <kstandarddirs.h>
+ #include <kconfig.h>
+
+-#ifdef HAVE_LIBART
+-#include <ksvgiconengine.h>
+-#endif
++// for external svg rendering
++#include <ktempfile.h>
++#include <kprocess.h>
+
+ #include <qfileinfo.h>
+ #include <qdatetime.h>
+@@ -49,22 +49,18 @@ QImage* Cache::cacheFile(const QString&
+ {
+ QImage *i;
+ if (file.endsWith(".svg") || file.endsWith(".svgz")) {
+-#ifdef HAVE_LIBART
+- KSVGIconEngine* svgEngine = new KSVGIconEngine();
+- QSize size = mScaler->targetResolution();
+- if (svgEngine->load(size.width(), size.height(), file )) {
+- QImage *image = svgEngine->image();
+- i = new QImage(*image);
+- delete image;
+- i->save(cachedFile.name(), QImage::imageFormat(file));
+- } else {
+- kdWarning() << "failed to load SVG file " << file << endl;
+- }
+- delete svgEngine;
+-#else
+- kdWarning() << k_funcinfo
+- << "tried to load SVG file but libart not installed" << endl;
+-#endif
++ QSize size = mScaler->targetResolution();
++ KProcess proc;
++ proc << "moodin_svgrender";
++ KTempFile tmp("/tmp/moodin_cache", ".png");
++ tmp.setAutoDelete(false);
++ tmp.close();
++ proc << QString::number(size.width()) << QString::number(size.height()) << file << tmp.name();
++ proc.start(KProcess::Block);
++
++ i = new QImage(tmp.name());
++ if (i->save(cachedFile.name(), "PNG"))
++ QFile(tmp.name()).remove();
+ }
+ else
+ {