Lines 1-66
Link Here
|
1 |
commit 6e14443b30ce2c8e284617840bc49e249c63afc1 |
|
|
2 |
Author: oconrad <conrad@geowiss.uni-hamburg.de> |
3 |
Date: Fri Dec 8 10:16:47 2017 +0100 |
4 |
|
5 |
saga_gui, loading tool description from file: wxgtk issue reported in [saga-gis-developer] SAGA GIS on FreeBSD: fails to build with wxgtk30 - 3.0.3.1 |
6 |
--- |
7 |
saga-gis/src/saga_core/saga_gui/wksp_tool.cpp | 25 ++++++++----------------- |
8 |
saga-gis/src/saga_core/saga_gui/wksp_tool.h | 2 -- |
9 |
2 files changed, 8 insertions(+), 19 deletions(-) |
10 |
|
11 |
--- src/saga_core/saga_gui/wksp_tool.cpp.orig 2017-09-01 15:57:36 UTC |
12 |
+++ src/saga_core/saga_gui/wksp_tool.cpp |
13 |
@@ -135,34 +135,25 @@ wxString CWKSP_Tool::Get_Name(void) |
14 |
} |
15 |
|
16 |
//--------------------------------------------------------- |
17 |
-wxString CWKSP_Tool::Get_File_Name(void) |
18 |
-{ |
19 |
- return( m_pTool->Get_File_Name().c_str() ); |
20 |
-} |
21 |
- |
22 |
-//--------------------------------------------------------- |
23 |
wxString CWKSP_Tool::Get_Description(void) |
24 |
{ |
25 |
//----------------------------------------------------- |
26 |
- if( !Get_File_Name().IsEmpty() ) |
27 |
+ if( !m_pTool->Get_File_Name().is_Empty() ) |
28 |
{ |
29 |
+ CSG_String Lib_Name = SG_File_Get_Name(m_pTool->Get_File_Name(), false); |
30 |
+ CSG_String File_Path = SG_File_Make_Path(SG_File_Get_Path(m_pTool->Get_File_Name()), Lib_Name, ""); |
31 |
+ |
32 |
+ File_Path = SG_File_Make_Path(File_Path, CSG_String::Format("%s_%02d", Lib_Name.c_str(), Get_Index())); |
33 |
+ |
34 |
CSG_String Description; |
35 |
CSG_File Stream; |
36 |
|
37 |
- wxFileName FileName(Get_File_Name()); |
38 |
- FileName.AppendDir (FileName.GetName()); |
39 |
- FileName.SetName (wxString::Format("%s_%02d", FileName.GetName().c_str(), Get_Index())); |
40 |
- |
41 |
- FileName.SetExt ("html"); |
42 |
- |
43 |
- if( Stream.Open(FileName.GetFullPath().wc_str(), SG_FILE_R) && Stream.Read(Description, Stream.Length()) ) |
44 |
+ if( SG_File_Set_Extension(File_Path, "html") && Stream.Open(File_Path, SG_FILE_R) && Stream.Read(Description, Stream.Length()) ) |
45 |
{ |
46 |
return( Description.c_str() ); |
47 |
} |
48 |
|
49 |
- FileName.SetExt ("htm"); |
50 |
- |
51 |
- if( Stream.Open(FileName.GetFullPath().wc_str(), SG_FILE_R) && Stream.Read(Description, Stream.Length()) ) |
52 |
+ if( SG_File_Set_Extension(File_Path, "htm" ) && Stream.Open(File_Path, SG_FILE_R) && Stream.Read(Description, Stream.Length()) ) |
53 |
{ |
54 |
return( Description.c_str() ); |
55 |
} |
56 |
--- src/saga_core/saga_gui/wksp_tool.h.orig 2017-05-24 13:15:53 UTC |
57 |
+++ src/saga_core/saga_gui/wksp_tool.h |
58 |
@@ -103,8 +103,6 @@ class CWKSP_Tool : public CWKSP_Base_Item (public) |
59 |
void Set_Menu_ID (int Menu_ID); |
60 |
int Get_Menu_ID (void) { return( m_Menu_ID ); } |
61 |
|
62 |
- wxString Get_File_Name (void); |
63 |
- |
64 |
bool is_Interactive (void); |
65 |
bool is_Executing (void); |
66 |
|