Browse Source

common,eeschema,pcbnew: path cleanup

7.0
Sylwester Kocjan 3 years ago
committed by Mark Roszko
parent
commit
a234d5a2c8
  1. 4
      common/dialogs/dialog_global_lib_table_config.cpp
  2. 4
      common/project.cpp
  3. 13
      eeschema/dialogs/dialog_plot_schematic.cpp
  4. 4
      eeschema/files-io.cpp
  5. 4
      pagelayout_editor/files.cpp
  6. 4
      pcbnew/files.cpp

4
common/dialogs/dialog_global_lib_table_config.cpp

@ -24,7 +24,7 @@
#include <search_stack.h> #include <search_stack.h>
#include <systemdirsappend.h> #include <systemdirsappend.h>
#include <wx/stdpaths.h>
#include <kiplatform/environment.h>
DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG( wxWindow* aParent, DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG( wxWindow* aParent,
@ -114,7 +114,7 @@ bool DIALOG_GLOBAL_LIB_TABLE_CONFIG::TransferDataToWindow()
if( !templatePath.IsEmpty() ) if( !templatePath.IsEmpty() )
ss.AddPaths( templatePath, 0 ); ss.AddPaths( templatePath, 0 );
else else
templatePath = wxStandardPaths::Get().GetUserConfigDir();
templatePath = KIPLATFORM::ENV::GetUserConfigPath();
m_filePicker1->SetInitialDirectory( templatePath ); m_filePicker1->SetInitialDirectory( templatePath );

4
common/project.cpp

@ -22,7 +22,7 @@
*/ */
#include <wx/log.h> #include <wx/log.h>
#include <wx/stdpaths.h>
#include <kiplatform/environment.h>
#include <pgm_base.h> #include <pgm_base.h>
#include <confirm.h> #include <confirm.h>
@ -206,7 +206,7 @@ const wxString PROJECT::libTableName( const wxString& aLibTableName ) const
// to be re-thought out. // to be re-thought out.
#ifndef __WXMAC__ #ifndef __WXMAC__
fn.AssignDir( wxStandardPaths::Get().GetUserConfigDir() );
fn.AssignDir( KIPLATFORM::ENV::GetUserConfigPath() );
#else #else
// don't pollute home folder, temp folder seems to be more appropriate // don't pollute home folder, temp folder seems to be more appropriate
fn.AssignDir( wxStandardPaths::Get().GetTempDir() ); fn.AssignDir( wxStandardPaths::Get().GetTempDir() );

13
eeschema/dialogs/dialog_plot_schematic.cpp

@ -47,7 +47,7 @@
#include <wx/dirdlg.h> #include <wx/dirdlg.h>
#include <wx/msgdlg.h> #include <wx/msgdlg.h>
#include <wx/stdpaths.h>
#include <kiplatform/environment.h>
#include <wx/log.h> #include <wx/log.h>
@ -165,7 +165,7 @@ void DIALOG_PLOT_SCHEMATIC::OnOutputDirectoryBrowseClicked( wxCommandEvent& even
// project path is not defined so point to the users document path to save the plot files. // project path is not defined so point to the users document path to save the plot files.
if( Prj().IsNullProject() ) if( Prj().IsNullProject() )
{ {
path = wxStandardPaths::Get().GetDocumentsDir();
path = KIPLATFORM::ENV::GetDocumentsPath();
} }
else else
{ {
@ -405,8 +405,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
wxString extMsg; wxString extMsg;
wxFileName fn; wxFileName fn;
extMsg.Printf( _( "Falling back to user path '%s'." ),
wxStandardPaths::Get().GetDocumentsDir() );
extMsg.Printf( _( "Falling back to user path '%s'." ), KIPLATFORM::ENV::GetDocumentsPath() );
// Build the absolute path of current output directory to preselect it in the file browser. // Build the absolute path of current output directory to preselect it in the file browser.
std::function<bool( wxString* )> textResolver = std::function<bool( wxString* )> textResolver =
@ -454,7 +453,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
dlg.SetExtendedMessage( extMsg ); dlg.SetExtendedMessage( extMsg );
dlg.ShowModal(); dlg.ShowModal();
path = wxStandardPaths::Get().GetDocumentsDir();
path = KIPLATFORM::ENV::GetDocumentsPath();
} }
} }
else else
@ -467,7 +466,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
dlg.ShowModal(); dlg.ShowModal();
// Always fall back to user's document path if no other absolute path can be normalized. // Always fall back to user's document path if no other absolute path can be normalized.
path = wxStandardPaths::Get().GetDocumentsDir();
path = KIPLATFORM::ENV::GetDocumentsPath();
} }
} }
else else
@ -490,7 +489,7 @@ wxString DIALOG_PLOT_SCHEMATIC::getOutputPath()
dlg.SetExtendedMessage( extMsg ); dlg.SetExtendedMessage( extMsg );
dlg.ShowModal(); dlg.ShowModal();
path = wxStandardPaths::Get().GetDocumentsDir();
path = KIPLATFORM::ENV::GetDocumentsPath();
} }
} }

4
eeschema/files-io.cpp

@ -680,9 +680,7 @@ bool SCH_EDIT_FRAME::saveSchematicFile( SCH_SHEET* aSheet, const wxString& aSave
if( !IsWritable( schematicFileName ) ) if( !IsWritable( schematicFileName ) )
return false; return false;
wxStandardPaths& paths = wxStandardPaths::Get();
wxString tempFile = wxFileName::CreateTempFileName(
paths.GetTempDir() + wxFileName::GetPathSeparator() + wxT( "eeschema" ) );
wxString tempFile = wxFileName::CreateTempFileName( "eeschema" );
// Save // Save
wxLogTrace( traceAutoSave, "Saving file " + schematicFileName.GetFullPath() ); wxLogTrace( traceAutoSave, "Saving file " + schematicFileName.GetFullPath() );

4
pagelayout_editor/files.cpp

@ -293,9 +293,7 @@ bool PL_EDITOR_FRAME::SaveDrawingSheetFile( const wxString& aFullFileName )
{ {
if( !aFullFileName.IsEmpty() ) if( !aFullFileName.IsEmpty() )
{ {
wxStandardPaths& paths = wxStandardPaths::Get();
wxString tempFile = wxFileName::CreateTempFileName(
paths.GetTempDir() + wxFileName::GetPathSeparator() + wxT( "pledit" ) );
wxString tempFile = wxFileName::CreateTempFileName( "pledit" );
try try
{ {

4
pcbnew/files.cpp

@ -1064,9 +1064,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool addToHistory,
GetBoard()->SynchronizeNetsAndNetClasses(); GetBoard()->SynchronizeNetsAndNetClasses();
} }
wxStandardPaths& paths = wxStandardPaths::Get();
wxString tempFile = wxFileName::CreateTempFileName(
paths.GetTempDir() + wxFileName::GetPathSeparator() + wxT( "pcbnew" ) );
wxString tempFile = wxFileName::CreateTempFileName( "pcbnew" );
wxString upperTxt; wxString upperTxt;
wxString lowerTxt; wxString lowerTxt;

Loading…
Cancel
Save