Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
90dc2908
Commit
90dc2908
authored
Feb 26, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Unix notation for paths and filenames in .pro files
parent
08f3c56d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
7 deletions
+80
-7
projet_config.cpp
common/projet_config.cpp
+55
-1
cfg.cpp
cvpcb/cfg.cpp
+1
-1
eeschema_config.cpp
eeschema/eeschema_config.cpp
+4
-4
param_config.h
include/param_config.h
+19
-0
pcbnew_config.cpp
pcbnew/pcbnew_config.cpp
+1
-1
No files found.
common/projet_config.cpp
View file @
90dc2908
...
...
@@ -696,6 +696,50 @@ void PARAM_CFG_WXSTRING::SaveParam( wxConfigBase* aConfig )
}
PARAM_CFG_FILENAME
::
PARAM_CFG_FILENAME
(
const
wxChar
*
ident
,
wxString
*
ptparam
,
const
wxChar
*
group
)
:
PARAM_CFG_BASE
(
ident
,
PARAM_FILENAME
,
group
)
{
m_Pt_param
=
ptparam
;
}
/** ReadParam
* read the value of parameter this stored in aConfig
* @param aConfig = the wxConfigBase that store the parameter
*/
void
PARAM_CFG_FILENAME
::
ReadParam
(
wxConfigBase
*
aConfig
)
{
if
(
m_Pt_param
==
NULL
||
aConfig
==
NULL
)
return
;
wxString
prm
=
aConfig
->
Read
(
m_Ident
);
// filesnames are stored using Unix notation
// under Window we must use \ instead of /
// mainly if there is a server name in path (something like \\server\kicad)
#ifdef __WINDOWS__
prm
.
Replace
(
wxT
(
"/"
),
wxT
(
"
\\
"
));
#endif
*
m_Pt_param
=
prm
;
}
/** SaveParam
* save the value of parameter this stored in aConfig
* @param aConfig = the wxConfigBase that can store the parameter
*/
void
PARAM_CFG_FILENAME
::
SaveParam
(
wxConfigBase
*
aConfig
)
{
if
(
m_Pt_param
==
NULL
||
aConfig
==
NULL
)
return
;
wxString
prm
=
*
m_Pt_param
;
// filenames are stored using Unix notation
prm
.
Replace
(
wxT
(
"
\\
"
),
wxT
(
"/"
)
);
aConfig
->
Write
(
m_Ident
,
prm
);
}
PARAM_CFG_LIBNAME_LIST
::
PARAM_CFG_LIBNAME_LIST
(
const
wxChar
*
ident
,
wxArrayString
*
ptparam
,
const
wxChar
*
group
)
:
...
...
@@ -725,6 +769,12 @@ void PARAM_CFG_LIBNAME_LIST::ReadParam( wxConfigBase* aConfig )
libname
=
aConfig
->
Read
(
id_lib
,
wxT
(
""
)
);
if
(
libname
.
IsEmpty
()
)
break
;
// filesnames are stored using Unix notation
// under Window we must use \ instead of /
// mainly if there is a server name in path (something like \\server\kicad)
#ifdef __WINDOWS__
libname
.
Replace
(
wxT
(
"/"
),
wxT
(
"
\\
"
));
#endif
libname_list
->
Add
(
libname
);
}
}
...
...
@@ -742,12 +792,16 @@ void PARAM_CFG_LIBNAME_LIST::SaveParam( wxConfigBase* aConfig )
unsigned
indexlib
=
0
;
wxString
configkey
;
wxString
libname
;
for
(
;
indexlib
<
libname_list
->
GetCount
();
indexlib
++
)
{
configkey
=
m_Ident
;
// We use indexlib+1 because first lib name is LibName1
configkey
<<
(
indexlib
+
1
);
aConfig
->
Write
(
configkey
,
libname_list
->
Item
(
indexlib
)
);
libname
=
libname_list
->
Item
(
indexlib
);
// filenames are stored using Unix notation
libname
.
Replace
(
wxT
(
"
\\
"
),
wxT
(
"/"
)
);
aConfig
->
Write
(
configkey
,
libname
);
}
}
cvpcb/cfg.cpp
View file @
90dc2908
...
...
@@ -40,7 +40,7 @@ PARAM_CFG_ARRAY& CVPCB_MAINFRAME::GetProjectFileParameters( void )
GROUPEQU
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_WXSTRING
(
wxT
(
"NetIExt"
),
&
m_NetlistFileExtension
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_
WXSTRING
(
wxT
(
"LibDir"
),
m_projectFileParams
.
push_back
(
new
PARAM_CFG_
FILENAME
(
wxT
(
"LibDir"
),
&
m_UserLibraryPath
,
GROUPLIB
)
);
...
...
eeschema/eeschema_config.cpp
View file @
90dc2908
/**
****************/
/** eeconfig.cpp **/
/*****************
*/
/**
* @file eeschema_config.cpp
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
...
...
@@ -265,7 +265,7 @@ PARAM_CFG_ARRAY& SCH_EDIT_FRAME::GetProjectFileParameters( void )
if
(
!
m_projectFileParams
.
empty
()
)
return
m_projectFileParams
;
m_projectFileParams
.
push_back
(
new
PARAM_CFG_
WXSTRING
(
wxT
(
"LibDir"
),
m_projectFileParams
.
push_back
(
new
PARAM_CFG_
FILENAME
(
wxT
(
"LibDir"
),
&
m_UserLibraryPath
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_LIBNAME_LIST
(
wxT
(
"LibName"
),
&
m_ComponentLibFiles
,
...
...
include/param_config.h
View file @
90dc2908
...
...
@@ -20,6 +20,7 @@ enum paramcfg_id
PARAM_BOOL
,
PARAM_LIBNAME_LIST
,
PARAM_WXSTRING
,
PARAM_FILENAME
,
PARAM_COMMAND_ERASE
,
PARAM_FIELDNAME_LIST
};
...
...
@@ -174,6 +175,24 @@ public:
virtual
void
SaveParam
(
wxConfigBase
*
aConfig
);
};
/**
* Configuration parameter - PARAM_CFG_FILENAME Class
* Same as PARAM_CFG_WXSTRING, but stores "\" as "/".
* and replace "/" by "\" under Windows.
* Used to store paths and filenames in config files
*/
class
PARAM_CFG_FILENAME
:
public
PARAM_CFG_BASE
{
public
:
wxString
*
m_Pt_param
;
///< Pointer to the parameter value
public
:
PARAM_CFG_FILENAME
(
const
wxChar
*
ident
,
wxString
*
ptparam
,
const
wxChar
*
group
=
NULL
);
virtual
void
ReadParam
(
wxConfigBase
*
aConfig
);
virtual
void
SaveParam
(
wxConfigBase
*
aConfig
);
};
class
PARAM_CFG_LIBNAME_LIST
:
public
PARAM_CFG_BASE
{
...
...
pcbnew/pcbnew_config.cpp
View file @
90dc2908
...
...
@@ -202,7 +202,7 @@ PARAM_CFG_ARRAY& WinEDA_PcbFrame::GetProjectFileParameters()
if
(
!
m_projectFileParams
.
empty
()
)
return
m_projectFileParams
;
m_projectFileParams
.
push_back
(
new
PARAM_CFG_
WXSTRING
(
wxT
(
"LibDir"
),
&
g_UserLibDirBuffer
,
m_projectFileParams
.
push_back
(
new
PARAM_CFG_
FILENAME
(
wxT
(
"LibDir"
),
&
g_UserLibDirBuffer
,
GROUPLIB
)
);
m_projectFileParams
.
push_back
(
new
PARAM_CFG_LIBNAME_LIST
(
wxT
(
"LibName"
),
&
g_LibName_List
,
GROUPLIB
)
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment