[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1655
Date       : Thu Aug  3 12:00:19 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/errors.cpp
   M /Trunk/XaraLX/xarlib/Makefile.am

Include program version information in debug dumps
Build svnversion.h into xarlib (not used at the moment)
Remove generation of debugging files from xarlib makefiles.


Diff:
Index: Trunk/XaraLX/xarlib/Makefile.am
===================================================================
--- Trunk/XaraLX/xarlib/Makefile.am	(revision 1654)
+++ Trunk/XaraLX/xarlib/Makefile.am	(revision 1655)
@@ -105,6 +105,7 @@
 	../wxOil/mfccontainer.h \
 	../wxOil/pathname.h \
 	../wxOil/stdwx.h \
+	../wxOil/svnversion.h \
 	../wxOil/unicdman.h \
 	../wxOil/varstr.h \
 	../GDraw/gconsts.h \
@@ -149,6 +150,9 @@
 	../xarlib/ensure.h \
 	../xarlib/xarlib.h
 
+# These ones not got from TOPDIR
+BUILTXARLIBHEADERS = ../wxOil/svnversion.h
+
 INSTHEADERS = $(addprefix include/xarlib/, $(notdir $(XARLIBHEADERS)) )
 INSTCPP = $(notdir $(XARLIBCPP) )
 
@@ -158,10 +162,11 @@
 
 pkginclude_HEADERS = $(INSTHEADERS)
 
-BUILT_SOURCES = $(INSTHEADERS)
+BUILT_SOURCES = $(INSTHEADERS) svnversion.h
 #BUILT_SOURCES = $(INSTHEADERS) $(INSTCPP)
 
-MOSTLYCLEANFILES = $(INSTHEADERS)
+# Note this is OUR svnversion.h
+MOSTLYCLEANFILES = $(INSTHEADERS) svnversion.h
 #MOSTLYCLEANFILES = $(INSTHEADERS) $(INSTCPP)
 
 # Insert an additional dependency to get the headers and cpp files built
@@ -171,16 +176,19 @@
 # Generate a directory of includes which has "xarlib/" in the include path
 $(INSTHEADERS) : $(XARLIBHEADERS)
 	@mkdir -p include/xarlib && \
-	echo $(libXar_a_SOURCES) > /tmp/bar && \
 	j=xarlib/$(filter %/$(notdir $@), $(XARLIBHEADERS) ) && \
-	echo "Building xarlib header $@ from $(TOPDIR)/$$j" && \
-	perl -pe 's,^[ 	]*#include[ 	]+\",#include \"xarlib/,' <$(TOPDIR)/$$j >$@ 
+	s="$(if $(filter %/$(notdir $@),$(BUILTXARLIBHEADERS)),../$$j,$(TOPDIR)/$$j)" && \
+	echo "Building xarlib header $@ from $$s" && \
+	perl -pe 's,^[ 	]*#include[ 	]+\",#include \"xarlib/,' <$$s >$@ 
 
+# We need svnversion.h in the output directory
+svnversion.h : $(INSTHEADERS)
+	@cp include/xarlib/svnversion.h svnversion.h
+
 # Generate a directory of includes which has "xarlib/" in the include path
 # We have to muck around with the prefixes here to avoid partial matches (coord.cpp matching doccoord.cpp etc.)
 $(INSTCPP) : $(XARLIBCPP)
-	@echo $(INSTCPP) > /tmp/foo && \
-	j=$(filter %/$(notdir $@), $(addprefix xarlib/, $(XARLIBCPP)) ) && \
+	@j=$(filter %/$(notdir $@), $(addprefix xarlib/, $(XARLIBCPP)) ) && \
 	echo "Building xarlib CPP file $@ from $(TOPDIR)/$$j" && \
 	ls -la $(TOPDIR)/$$j && \
 	#perl -pe 's,^[ 	]*#include[ 	]+\",#include \"xarlib/,' <$(TOPDIR)/$$j >$@ 
Index: Trunk/XaraLX/wxOil/errors.cpp
===================================================================
--- Trunk/XaraLX/wxOil/errors.cpp	(revision 1654)
+++ Trunk/XaraLX/wxOil/errors.cpp	(revision 1655)
@@ -102,11 +102,12 @@
 */
 
 
-
 #include "camtypes.h"
 
 //#include "errors.h" - in camtypes.h [AUTOMATICALLY REMOVED]
 #include "camelot.h"
+#include "gdraw.h"
+#include "cversion.h"
 //#include "ensure.h" - in camtypes.h [AUTOMATICALLY REMOVED]
 #if !defined(EXCLUDE_FROM_XARLIB)
 //#include "tool.h" - in camtypes.h [AUTOMATICALLY REMOVED]
@@ -340,6 +341,30 @@
 
 #else
 
+class wxCamDebugReport : public wxDebugReport
+{
+public:
+	virtual void DoAddCustomContext(wxXmlNode * nodeRoot)
+	{
+		wxString			strMessage;
+
+#if FALSE == wxUSE_UNICODE
+		TCHAR*			pszCDrawVer = GDraw_GetSvnVersion();
+#else
+		TCHAR			pszCDrawVer[32];
+		camMbstowcs( pszCDrawVer, GDraw_GetSvnVersion(), 31 );
+#endif
+		// Add the applications version information
+		wxXmlNode *nodeVersion = new wxXmlNode(wxXML_ELEMENT_NODE, _T("camelot"));
+		nodeVersion->AddProperty(_T("xtremeversion"), wxString(g_pszAppVersion));
+		nodeVersion->AddProperty(_T("xtremerevision"), wxString(g_pszSvnVersion));
+		nodeVersion->AddProperty(_T("xaradrawversion"), wxString::Format(_T("%d.03d"), HIWORD(GDraw_GetVersion()), LOWORD(GDraw_GetVersion())));
+		nodeVersion->AddProperty(_T("xaradrawrevision"), pszCDrawVer);
+		nodeVersion->AddProperty(_T("builddate"), CAMELOT_BUILD_DATE);
+		nodeRoot->AddChild(nodeVersion);
+	}
+};
+
 class CamErrorDialog : public wxDialog
 {
 public:
@@ -373,7 +398,7 @@
 		else if (id == _R(IDS_ERRORBOX_DEBUGREPORT))
 		{
 #ifdef HAVE_DEBUGREPORT
-			wxDebugReport report;
+			wxCamDebugReport report;
 			wxDebugReportPreviewStd preview;
 		
 			report.AddAll();


Xara