Changeset - fba32897839a
[Not reviewed]
default
0 3 0
Michael Guravage - 15 years ago 2010-10-18 20:21:44
michael.guravage@cwi.nl
Translate image fname to native format. Let QImage guess the format
from the filename's suffix. Put uninstaller in root install directory.

--
user: Michael Guravage <michael.guravage@cwi.nl>
branch 'default'
changed src/ChangeLog
changed src/VirtualLeaf-install.nsi
changed src/mainbase.cpp
3 files changed with 13 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/ChangeLog
Show inline comments
 
2010-10-18    <guravage@caterpie.sen.cwi.nl>
 

	
 
	* mainbase.cpp (Save): QDir::toNativeSeparators(fname). Invoke
 
	save with format argument set to zero to force QImage to guess the
 
	format by looking at fileName's suffix.
 

	
 
	* VirtualLeaf-install.nsi: Put uninstaller in top directory.
 

	
 
	* VirtualLeaf.pro: MAXOSX, look for gpl3.txt in the ../doc directory.
 

	
 
	* Makefile (Makefile.libplugin): Removed -makefile qmake option.
 

	
 
	* VirtualLeaf.cpp (TIMESTEP): Removed getIterations().
 

	
src/VirtualLeaf-install.nsi
Show inline comments
 
@@ -115,13 +115,13 @@ installDir C:\VirtualLeaf
 
RequestExecutionLevel user
 

	
 
section "Virtual Leaf executable"
 
  #sectionIn RO
 
  # define the output path for the Virtual Leaf executable
 
  setOutPath $INSTDIR\bin
 
  writeUninstaller $INSTDIR\bin\uninstaller.exe
 
  writeUninstaller $INSTDIR\uninstaller.exe
 
  file ..\bin\VirtualLeaf.exe
 

	
 
  # Required DLLs
 
  setOutPath $INSTDIR\bin
 

	
 
  file ..\lib\libiconv\bin\libiconv-2.dll
src/mainbase.cpp
Show inline comments
 
@@ -26,12 +26,14 @@
 
#include "xmlwrite.h"
 

	
 
#include <sstream>
 
#include <string>
 

	
 
#include <QLocale>
 
#include <QDir>
 
#include <QDebug>
 

	
 
static const std::string _module_id("$Id$");
 

	
 
xmlNode *MainBase::XMLViewportTree(QTransform &transform) const {
 
  
 
  QLocale standardlocale(QLocale::C);
 
@@ -336,13 +338,16 @@ void MainBase::Save(const char *fname, c
 
  if (!QString(format).contains("pdf", Qt::CaseInsensitive)) {
 

	
 
    QImage *image = new QImage(QSize(sizex, sizey), QImage::Format_RGB32);
 
    image->fill(QColor(Qt::white).rgb());
 
    QPainter *painter=new QPainter(image);
 
    canvas.render(painter);
 
    if (!image->save(QString(fname))) {
 
#ifdef QDEBUG
 
    qDebug() << "Native Image Filename: " << QDir::toNativeSeparators(QString(fname)) << endl;
 
#endif
 
    if (!image->save(QDir::toNativeSeparators(QString(fname)), 0, -1)) {
 
      MyWarning::warning("Image not saved successfully. Is the disk full or the extension not recognized?");
 
    };
 
    delete painter;
 
    delete image;
 
  } else {
 
    QPrinter pdf(QPrinter::HighResolution);
0 comments (0 inline, 0 general)