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

[XaraXtreme-commits] Commit Complete



Commit by  : luke
Repository : xara
Revision   : 1581
Date       : Fri Jul 28 10:52:14 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/camelot.cpp
   M /Trunk/XaraLX/wxOil/tmplmngr.cpp
   M /Trunk/XaraLX/wxOil/xrc/EN/resimmap-strings.xrc

Make template path determination more robust


Diff:
Index: Trunk/XaraLX/wxOil/camelot.cpp
===================================================================
--- Trunk/XaraLX/wxOil/camelot.cpp	(revision 1580)
+++ Trunk/XaraLX/wxOil/camelot.cpp	(revision 1581)
@@ -567,7 +567,7 @@
 
 	// Check the resource dir exists
 	Camelot.DeclarePref( NULL, TEXT("ResourceDir"), &m_strResourceDirPath );
-	if( bFirstRun || m_strResourceDirPath == _T("") )
+	if( bFirstRun || m_strResourceDirPath == _T("") || !wxDir::Exists( (PCTSTR)m_strResourceDirPath ) )
 	{
 #if !defined(RESOURCE_DIR)
 		std::auto_ptr<char> pszDataPath( br_find_data_dir( "/usr/share" ) );
Index: Trunk/XaraLX/wxOil/xrc/EN/resimmap-strings.xrc
===================================================================
--- Trunk/XaraLX/wxOil/xrc/EN/resimmap-strings.xrc	(revision 1580)
+++ Trunk/XaraLX/wxOil/xrc/EN/resimmap-strings.xrc	(revision 1581)
@@ -457,7 +457,7 @@
 			<object class="sizeritem">
 				<flag>wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE</flag>
 				<object class="wxStaticText" name="IDS_NEWTEMPLATES_RELATIVEPATH">
-					<label>Templates/</label>
+					<label>/Templates/</label>
 				</object>
 			</object>
 			<object class="sizeritem">
Index: Trunk/XaraLX/wxOil/tmplmngr.cpp
===================================================================
--- Trunk/XaraLX/wxOil/tmplmngr.cpp	(revision 1580)
+++ Trunk/XaraLX/wxOil/tmplmngr.cpp	(revision 1581)
@@ -264,16 +264,14 @@
 	GetApplication()->DeclareSection(TEXT("Templates"), 2);
 	GetApplication()->DeclarePref(TEXT("Templates"), TEXT("Path"), &m_TemplatesPath);
 	GetApplication()->DeclarePref(TEXT("Templates"), TEXT("LocalPath"), &m_LocalTemplatesPath);
-
+	
 	//Graham 21/10/97: If it is blank, then we should use the
 	//exe path with "	emplates\" on the end
 	if( m_TemplatesPath.IsEmpty() || !SGLibOil::DirExists( m_TemplatesPath ) )
 	{
 		// Put the path name into a string
-		PathName ModulePath( CCamApp::GetResourceDirectory() );
+		m_TemplatesPath = CCamApp::GetResourceDirectory();
 
-		m_TemplatesPath = ModulePath.GetLocation(TRUE);
-
 		//And add "templates\" to the end
 		String_256 strRelativePath(_R(IDS_NEWTEMPLATES_RELATIVEPATH));
 


Xara