r19175 by craig - Remove revision file processing, add svnheader.h creation and processing

scribus-commit scribus-commit at lists.scribus.net
Mon Jun 2 22:04:32 UTC 2014


Author: craig
Date: Mon Jun  2 22:04:32 2014
New Revision: 19175

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19175
Log:
Remove revision file processing, add svnheader.h creation and processing

Modified:
    trunk/Scribus/revision
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/ui/about.cpp

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19175&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Mon Jun  2 22:04:32 2014
@@ -1,3 +1,12 @@
+add_custom_target(svnheader ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/svnheader.h)
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/svnheader.h
+	COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
+						 -P ${CMAKE_MODULE_PATH}/getsvn.cmake)
+set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/svnversion.h
+	PROPERTIES GENERATED TRUE
+	HEADER_FILE_ONLY TRUE)
+
+
 IF(WIN32)
 	ADD_DEFINITIONS(-DQT_DLL)
 ENDIF(WIN32)
@@ -1038,6 +1047,7 @@
 
 INCLUDE_DIRECTORIES(
 	${CMAKE_SOURCE_DIR}
+	${CMAKE_CURRENT_BINARY_DIR}
 	${CMAKE_CURRENT_SOURCE_DIR}
 	${FREETYPE_INCLUDE_DIRS}
 )
@@ -1197,6 +1207,8 @@
 	"-framework CoreFoundation" )
 ENDIF(APPLE)
 
+add_dependencies(${EXE_NAME} svnheader)
+
 TARGET_LINK_LIBRARIES(${EXE_NAME}
 	${SCRIBUS_COLORMGMT_LIB}
 	${SCRIBUS_DESAXE_LIB}

Modified: trunk/Scribus/scribus/ui/about.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19175&path=/trunk/Scribus/scribus/ui/about.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/about.cpp (original)
+++ trunk/Scribus/scribus/ui/about.cpp Mon Jun  2 22:04:32 2014
@@ -25,14 +25,14 @@
 #include <QToolTip>
 #include <QWidget>
 
+#include <cairo.h>
+
 #include "about.h"
 #include "commonstrings.h"
 #include "scconfig.h"
 #include "scpaths.h"
 #include "sctextbrowser.h"
-
-#include <cairo.h>
-
+#include "svnversion.h"
 #include "util_ghostscript.h"
 #include "util_icon.h"
 #include "upgradechecker.h"
@@ -130,23 +130,10 @@
 	if (BUILD_NAME == "BleedingEdge")
 		built = tr("%3-%2-%1 %4 %5").arg(BUILD_DAY).arg(BUILD_MONTH).arg(BUILD_YEAR).arg(BUILD_TIME).arg(BUILD_TZ);
 
-
-	QFile revisionFile(ScPaths::instance().shareDir() + "/revision");
 	QString revText;
-	if (revisionFile.open(QIODevice::ReadOnly | QIODevice::Text))
-	{
-		QTextStream inRev(&revisionFile);
-		inRev.setCodec("UTF-8");
-		inRev.setAutoDetectUnicode(true);
-		while (!inRev.atEnd())
-		{
-			revText = inRev.readLine();
-			revText.replace("$Rev: ","SVN Revision: ");
-			revText.replace("$","");
-			built+=" - ";
-			built+=revText;
-		}
-	}
+	revText=QString("SVN Revision: %1").arg(SVNVERSION);
+	built+=" - ";
+	built+=revText;
 
 	QString bu;
 	bu += "C";




More information about the scribus-commit mailing list