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
e66e4ad4
Commit
e66e4ad4
authored
Aug 19, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove PART_LIBS sorting.
parent
12229246
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
80 deletions
+2
-80
class_library.cpp
eeschema/class_library.cpp
+2
-66
class_library.h
eeschema/class_library.h
+0
-14
No files found.
eeschema/class_library.cpp
View file @
e66e4ad4
...
...
@@ -53,51 +53,6 @@
"This may cause some unexpected behavior when loading components into a schematic." )
bool
operator
==
(
const
PART_LIB
&
aLibrary
,
const
wxString
&
aName
)
{
// See our header class_libentry.h for function Cmp_KEEPCASE().
return
Cmp_KEEPCASE
(
aLibrary
.
GetName
(),
aName
)
==
0
;
}
bool
operator
!=
(
const
PART_LIB
&
aLibrary
,
const
wxString
&
aName
)
{
return
!
(
aLibrary
==
aName
);
}
wxArrayString
PART_LIBS
::
s_libraryListSortOrder
;
bool
operator
<
(
const
PART_LIB
&
aItem1
,
const
PART_LIB
&
aItem2
)
{
// The cache library always is sorted to the end of the library list.
if
(
aItem2
.
IsCache
()
)
return
true
;
if
(
aItem1
.
IsCache
()
)
return
false
;
// If the sort order array isn't set, then sort alphabetically except.
if
(
PART_LIBS
::
GetSortOrder
().
IsEmpty
()
)
return
Cmp_KEEPCASE
(
aItem1
.
GetName
(),
aItem2
.
GetName
()
)
<
0
;
int
i1
=
PART_LIBS
::
GetSortOrder
().
Index
(
aItem1
.
GetName
(),
false
);
int
i2
=
PART_LIBS
::
GetSortOrder
().
Index
(
aItem2
.
GetName
(),
false
);
if
(
i1
==
wxNOT_FOUND
&&
i2
==
wxNOT_FOUND
)
return
true
;
if
(
i1
==
wxNOT_FOUND
&&
i2
!=
wxNOT_FOUND
)
return
false
;
if
(
i1
!=
wxNOT_FOUND
&&
i2
==
wxNOT_FOUND
)
return
true
;
return
(
i1
-
i2
)
<
0
;
}
PART_LIB
::
PART_LIB
(
int
aType
,
const
wxString
&
aFileName
)
:
// start @ != 0 so each additional library added
// is immediately detectable, zero would not be.
...
...
@@ -873,19 +828,11 @@ void PART_LIBS::RemoveLibrary( const wxString& aName )
PART_LIB
*
PART_LIBS
::
FindLibrary
(
const
wxString
&
aName
)
{
#if 0
BOOST_FOREACH( PART_LIB& lib, *this )
{
if( lib == aName )
return &lib;
}
#else
for
(
PART_LIBS
::
iterator
it
=
begin
();
it
!=
end
();
++
it
)
{
if
(
*
it
==
aName
)
if
(
it
->
GetName
()
==
aName
)
return
&*
it
;
}
#endif
return
NULL
;
}
...
...
@@ -1057,7 +1004,6 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR )
wxFileName
fn
;
wxString
filename
;
wxString
libs_not_found
;
wxArrayString
sortOrder
;
SEARCH_STACK
*
lib_search
=
aProject
->
SchSearchS
();
#if defined(DEBUG) && 1
...
...
@@ -1147,18 +1093,8 @@ void PART_LIBS::LoadAllLibraries( PROJECT* aProject ) throw( IO_ERROR )
UTF8
(
libs_not_found
),
0
,
0
);
}
// Put the libraries in the correct order.
PART_LIBS
::
SetSortOrder
(
sortOrder
);
sort
();
#if defined(DEBUG) && 1
printf
(
"%s: sort order:
\n
"
,
__func__
);
for
(
size_t
i
=
0
;
i
<
sortOrder
.
GetCount
();
i
++
)
printf
(
" %s
\n
"
,
TO_UTF8
(
sortOrder
[
i
]
)
);
printf
(
"%s: actual order:
\n
"
,
__func__
);
printf
(
"%s: lib_names:
\n
"
,
__func__
);
for
(
PART_LIBS
::
const_iterator
it
=
begin
();
it
<
end
();
++
it
)
printf
(
" %s
\n
"
,
TO_UTF8
(
it
->
GetName
()
)
);
...
...
eeschema/class_library.h
View file @
e66e4ad4
...
...
@@ -103,8 +103,6 @@ typedef boost::ptr_vector< PART_LIB > PART_LIBS_BASE;
*/
class
PART_LIBS
:
public
PART_LIBS_BASE
,
public
PROJECT
::
_ELEM
{
static
wxArrayString
s_libraryListSortOrder
;
public
:
static
int
s_modify_generation
;
///< helper for GetModifyHash()
...
...
@@ -226,21 +224,9 @@ public:
int
GetLibraryCount
()
{
return
size
();
}
static
void
SetSortOrder
(
const
wxArrayString
&
aSortOrder
)
{
s_libraryListSortOrder
=
aSortOrder
;
}
static
wxArrayString
&
GetSortOrder
()
{
return
s_libraryListSortOrder
;
}
};
bool
operator
<
(
const
PART_LIB
&
item1
,
const
PART_LIB
&
item2
);
/**
* Class PART_LIB
* is used to load, save, search, and otherwise manipulate
...
...
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