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
031ab96f
Commit
031ab96f
authored
Dec 13, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
github_plugin.cpp was erroneously affected by rev 4552 patching.
parent
7f12513c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
github_plugin.cpp
pcbnew/github/github_plugin.cpp
+18
-13
No files found.
pcbnew/github/github_plugin.cpp
View file @
031ab96f
...
...
@@ -63,12 +63,15 @@
#include <macros.h>
#include <fp_lib_table.h> // ExpandSubstitutions()
using
namespace
std
;
static
const
char
*
PRETTY_DIR
=
"allow_pretty_writing_to_this_dir"
;
typedef
boost
::
ptr_map
<
st
d
::
string
,
wxZipEntry
>
MODULE_MAP
;
typedef
MODULE_MAP
::
iterator
MODULE_ITER
;
typedef
MODULE_MAP
::
const_iterator
MODULE_CITER
;
typedef
boost
::
ptr_map
<
st
ring
,
wxZipEntry
>
MODULE_MAP
;
typedef
MODULE_MAP
::
iterator
MODULE_ITER
;
typedef
MODULE_MAP
::
const_iterator
MODULE_CITER
;
/**
...
...
@@ -163,7 +166,7 @@ MODULE* GITHUB_PLUGIN::FootprintLoad( const wxString& aLibraryPath,
}
}
st
d
::
st
ring
fp_name
=
TO_UTF8
(
aFootprintName
);
string
fp_name
=
TO_UTF8
(
aFootprintName
);
MODULE_CITER
it
=
m_gh_cache
->
find
(
fp_name
);
...
...
@@ -230,7 +233,7 @@ void GITHUB_PLUGIN::FootprintSave( const wxString& aLibraryPath,
// IsFootprintLibWritable() to determine if calling FootprintSave() is
// even legal, so I spend no time on internationalization here:
st
d
::
st
ring
msg
=
StrPrintf
(
"Github library
\n
'%s'
\n
is only writable if you set option '%s' in Library Tables dialog."
,
string
msg
=
StrPrintf
(
"Github library
\n
'%s'
\n
is only writable if you set option '%s' in Library Tables dialog."
,
(
const
char
*
)
TO_UTF8
(
aLibraryPath
),
PRETTY_DIR
);
THROW_IO_ERROR
(
msg
);
...
...
@@ -272,7 +275,7 @@ void GITHUB_PLUGIN::FootprintDelete( const wxString& aLibraryPath, const wxStrin
// IsFootprintLibWritable() to determine if calling FootprintSave() is
// even legal, so I spend no time on internationalization here:
st
d
::
st
ring
msg
=
StrPrintf
(
"Github library
\n
'%s'
\n
is only writable if you set option '%s' in Library Tables dialog."
,
string
msg
=
StrPrintf
(
"Github library
\n
'%s'
\n
is only writable if you set option '%s' in Library Tables dialog."
,
(
const
char
*
)
TO_UTF8
(
aLibraryPath
),
PRETTY_DIR
);
THROW_IO_ERROR
(
msg
);
...
...
@@ -353,7 +356,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
if
(
aProperties
)
{
st
d
::
string
pretty_dir
;
st
ring
pretty_dir
;
if
(
aProperties
->
Value
(
PRETTY_DIR
,
&
pretty_dir
)
)
{
...
...
@@ -406,7 +409,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
if
(
fn
.
GetExt
()
==
kicad_mod
)
{
st
d
::
st
ring
fp_name
=
TO_UTF8
(
fn
.
GetName
()
);
// omit extension & path
string
fp_name
=
TO_UTF8
(
fn
.
GetName
()
);
// omit extension & path
m_gh_cache
->
insert
(
fp_name
,
entry
);
}
...
...
@@ -417,7 +420,7 @@ void GITHUB_PLUGIN::cacheLib( const wxString& aLibraryPath, const PROPERTIES* aP
}
bool
GITHUB_PLUGIN
::
repoURL_zipURL
(
const
wxString
&
aRepoURL
,
st
d
::
st
ring
*
aZipURL
)
bool
GITHUB_PLUGIN
::
repoURL_zipURL
(
const
wxString
&
aRepoURL
,
string
*
aZipURL
)
{
// e.g. "https://github.com/liftoff-sr/pretty_footprints"
//D(printf("aRepoURL:%s\n", TO_UTF8( aRepoURL ) );)
...
...
@@ -457,7 +460,7 @@ bool GITHUB_PLUGIN::repoURL_zipURL( const wxString& aRepoURL, std::string* aZipU
void
GITHUB_PLUGIN
::
remote_get_zip
(
const
wxString
&
aRepoURL
)
throw
(
IO_ERROR
)
{
st
d
::
string
zip_url
;
st
ring
zip_url
;
if
(
!
repoURL_zipURL
(
aRepoURL
,
&
zip_url
)
)
{
...
...
@@ -475,7 +478,7 @@ void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR )
try
{
std
::
ostringstream
os
;
ostringstream
os
;
h
.
open
(
zip_url
);
// only one file, therefore do it synchronously.
os
<<
&
h
;
...
...
@@ -492,8 +495,10 @@ void GITHUB_PLUGIN::remote_get_zip( const wxString& aRepoURL ) throw( IO_ERROR )
// https "GET" has faild, report this to API caller.
wxString
fmt
(
_
(
"Cannot GET zip: '%s'
\n
for lib-path: '%s'.
\n
What: '%s'"
)
);
std
::
string
msg
=
StrPrintf
(
TO_UTF8
(
fmt
),
zip_url
.
c_str
(),
TO_UTF8
(
aRepoURL
),
e
.
what
()
);
string
msg
=
StrPrintf
(
TO_UTF8
(
fmt
),
zip_url
.
c_str
(),
TO_UTF8
(
aRepoURL
),
e
.
what
()
);
THROW_IO_ERROR
(
msg
);
}
...
...
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