eeschema: Bug and assertion failure when changing plot output directory

Bug #1478131 reported by Ben Kempke
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Unassigned

Bug Description

There are three issues mentioned here. They are somewhat interrelated, so I will list them here in one bug:

1) Upon closing the 'Plot Schematic' dialog after changing the output directory and plotting the schematics, a full path is passed to wxFileDialog, causing the aforementioned assert (assert causing no adverse effects)

2) The output directory information is not saved to the project config file unless a plot command is issued (bug)

3) IMO I don't think the project file dialog should be displayed at all upon closing the plot schematic dialog (personal preference)

I've attached a patch which corrects the aforementioned issues.

ASSERT INFO:
../src/common/filename.cpp(568): assert "volDummy.empty() && pathDummy.empty()" failed in Assign(): the file name shouldn't contain the path

BACKTRACE:
[1] wxFileName::Assign(wxString const&, wxString const&, wxPathFormat)
[2] wxFileDialog::Create(wxWindow*, wxString const&, wxString const&, wxString const&, wxString const&, long, wxPoint const&, wxSize const&, wxString const&)
[3] wxFileDialog::wxFileDialog(wxWindow*, wxString const&, wxString const&, wxString const&, wxString const&, long, wxPoint const&, wxSize const&, wxString const&)
[4] wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const
[5] wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&)
[6] wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*)
[7] wxEvtHandler::TryHereOnly(wxEvent&)
[8] wxEvtHandler::DoTryChain(wxEvent&)
[9] wxEvtHandler::ProcessEvent(wxEvent&)
[10] wxWindowBase::TryAfter(wxEvent&)
[11] wxEvtHandler::SafelyProcessEvent(wxEvent&)
[12] wxMenuBase::SendEvent(int, int)
[13] g_closure_invoke
[14] g_signal_emit_valist
[15] g_signal_emit
[16] g_main_context_dispatch
[17] g_main_loop_run
[18] gtk_main
[19] wxGUIEventLoop::DoRun()
[20] wxEventLoopBase::Run()
[21] wxAppConsoleBase::MainLoop()
[22] APP_KICAD::OnRun() /home/user/repos/kicad-bpkempke/kicad/kicad.cpp:274
[23] wxEntry(int&, wchar_t**)
[24] main /home/user/repos/kicad-bpkempke/kicad/kicad.cpp:306
[25] __libc_start_main
[26] _start

Application: kicad
Version: (2015-07-24 BZR 5989, Git 9b9c794)-product debug build
wxWidgets: Version 3.0.2 (debug,wchar_t,compiler with C++ ABI 1002,GCC 4.9.2,wx containers,compatible with 2.8)
Platform: Linux 3.19.0-23-generic x86_64, 64 bit, Little endian, wxGTK
Boost version: 1.54.0
         USE_WX_GRAPHICS_CONTEXT=OFF
         USE_WX_OVERLAY=OFF
         KICAD_SCRIPTING=OFF
         KICAD_SCRIPTING_MODULES=OFF
         KICAD_SCRIPTING_WXPYTHON=OFF
         USE_FP_LIB_TABLE=HARD_CODED_ON
         BUILD_GITHUB_PLUGIN=ON

Revision history for this message
Ben Kempke (bpkempke) wrote :

I had forgotten that the output directory can be changed without selecting 'Browse'. Therefore, it makes sense to pull that logic into a OnText event handler instead. I've updated the patch accordingly.

Revision history for this message
Ben Kempke (bpkempke) wrote :
Changed in kicad:
importance: Undecided → Low
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Since you patch is so old, I didn't attempt to merge it even though it may have merged cleanly.

As for the bugs:

1) I am not seeing this assert so I am assuming it's already been fixed.

2) I'm going to disagree with your assertion that the settings should be saved even when the plot dialog is canceled. This is pretty common behavior throughout KiCad. I did not fix this.

3) I agree that the user should not be prompted to save the project file when the plot settings change. We don't do this anywhere else in KiCad so doing it here doesn't make any sense either. I fixed this.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 39b27e39a9af79e051b85687fd477f7fba99cbc4
https://git.launchpad.net/kicad/patch/?id=39b27e39a9af79e051b85687fd477f7fba99cbc4

Changed in kicad:
status: New → Fix Committed
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.