diff --git a/eeschema/dialogs/panel_sym_lib_table.cpp b/eeschema/dialogs/panel_sym_lib_table.cpp index a82cafdd5d..0f69ee0929 100644 --- a/eeschema/dialogs/panel_sym_lib_table.cpp +++ b/eeschema/dialogs/panel_sym_lib_table.cpp @@ -3,7 +3,7 @@ * * Copyright (C) 2017 Wayne Stambaugh * Copyright (C) 2021 CERN - * Copyright (C) 2017-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2017-2022 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -505,12 +505,11 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) wxString detailedMsg = _( "One of the nicknames will need to be changed after " "adding this library." ); - wxArrayString files; - dlg.GetFilenames( files ); + wxArrayString filePathsList; + dlg.GetPaths( filePathsList ); - for( const wxString& file : files ) + for( const wxString& filePath : filePathsList ) { - wxString filePath = dlg.GetDirectory() + wxFileName::GetPathSeparator() + file; wxFileName fn( filePath ); wxString nickname = LIB_ID::FixIllegalChars( fn.GetName(), true ); bool doAdd = true; @@ -556,7 +555,7 @@ void PANEL_SYM_LIB_TABLE::browseLibrariesHandler( wxCommandEvent& event ) } } - if( !files.IsEmpty() ) + if( !filePathsList.IsEmpty() ) { m_cur_grid->MakeCellVisible( m_cur_grid->GetNumberRows() - 1, 0 ); m_cur_grid->SetGridCursor( m_cur_grid->GetNumberRows() - 1, 1 );