[QGIS Commit] r8733 - in trunk/qgis: src/gui tests/src/core tests/src/gui

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jul 8 06:15:38 EDT 2008


Author: timlinux
Date: 2008-07-08 06:15:38 -0400 (Tue, 08 Jul 2008)
New Revision: 8733

Modified:
   trunk/qgis/src/gui/qgsquickprint.cpp
   trunk/qgis/tests/src/core/CMakeLists.txt
   trunk/qgis/tests/src/gui/CMakeLists.txt
Log:
fix divide by zero bug in quickprint. Fix issue preventing quickprint test from running

Modified: trunk/qgis/src/gui/qgsquickprint.cpp
===================================================================
--- trunk/qgis/src/gui/qgsquickprint.cpp	2008-07-08 09:54:15 UTC (rev 8732)
+++ trunk/qgis/src/gui/qgsquickprint.cpp	2008-07-08 10:15:38 UTC (rev 8733)
@@ -227,6 +227,8 @@
   // so we can restore it properly
   //
   int myOriginalDpi = mpMapRender->outputDpi();
+  //sensible default to prevent divide by zero
+  if (0==myOriginalDpi) myOriginalDpi=96; 
   QSize myOriginalSize = mpMapRender->outputSize();
   int mySymbolScalingAmount = myPrintResolutionDpi / myOriginalDpi; 
 

Modified: trunk/qgis/tests/src/core/CMakeLists.txt
===================================================================
--- trunk/qgis/tests/src/core/CMakeLists.txt	2008-07-08 09:54:15 UTC (rev 8732)
+++ trunk/qgis/tests/src/core/CMakeLists.txt	2008-07-08 10:15:38 UTC (rev 8733)
@@ -76,9 +76,26 @@
 ADD_EXECUTABLE(qgis_applicationtest ${qgis_applicationtest_SRCS})
 ADD_DEPENDENCIES(qgis_applicationtest qgis_applicationtestmoc)
 TARGET_LINK_LIBRARIES(qgis_applicationtest ${QT_LIBRARIES} qgis_core)
+  #No relinking and full RPATH for the install tree
+  #See: http://www.cmake.org/Wiki/CMake_RPATH_handling#No_relinking_and_full_RPATH_for_the_install_tree
 SET_TARGET_PROPERTIES(qgis_applicationtest 
+  # skip the full RPATH for the build tree
+  PROPERTIES SKIP_BUILD_RPATH  TRUE
+  )
+SET_TARGET_PROPERTIES(qgis_applicationtest 
+  # when building, use the install RPATH already
+  # (so it doesn't need to relink when installing)
+  PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE 
+  )
+SET_TARGET_PROPERTIES(qgis_applicationtest 
+  # the RPATH to be used when installing
   PROPERTIES INSTALL_RPATH ${QGIS_LIB_DIR}
-  INSTALL_RPATH_USE_LINK_PATH true)
+  )
+SET_TARGET_PROPERTIES(qgis_applicationtest 
+  # add the automatically determined parts of the RPATH
+  # which point to directories outside the build tree to the install RPATH
+  PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE
+  )
 IF (APPLE)
   # For Mac OS X, the executable must be at the root of the bundle's executable folder
   INSTALL(TARGETS qgis_applicationtest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})

Modified: trunk/qgis/tests/src/gui/CMakeLists.txt
===================================================================
--- trunk/qgis/tests/src/gui/CMakeLists.txt	2008-07-08 09:54:15 UTC (rev 8732)
+++ trunk/qgis/tests/src/gui/CMakeLists.txt	2008-07-08 10:15:38 UTC (rev 8733)
@@ -87,7 +87,7 @@
   ADD_TEST(qgis_quickprinttest ${CMAKE_INSTALL_PREFIX}/qgis_quickprinttest)
 ELSE (APPLE)
   INSTALL(TARGETS qgis_quickprinttest RUNTIME DESTINATION ${QGIS_BIN_DIR})
-  ADD_TEST(qgis_quickprinttest ${QGIS_BIN_DIR}/qgis_quickprinttest)
+  ADD_TEST(qgis_quickprinttest ${CMAKE_INSTALL_PREFIX}/bin/qgis_quickprinttest)
 ENDIF (APPLE)
 
 



More information about the QGIS-commit mailing list