Patch #843 2006-02-18 16:28

afb

envsetdlg calls associations, on non-Win (it shouldn't)
Download
843-envsetdlg_calls.patch (728 bytes)
Category
Platform-Specific
Status
Accepted
Close date
2006-02-18 17:55
Assigned to
 
Index: src/src/environmentsettingsdlg.cpp
===================================================================
--- src/src/environmentsettingsdlg.cpp    (revision 2029)
+++ src/src/environmentsettingsdlg.cpp    (arbetskopia)
@@ -253,15 +253,19 @@
 
 void EnvironmentSettingsDlg::OnSetAssocs(wxCommandEvent& event)
 {
+#ifdef __WXMSW__
     Associations::SetCore();
     //cbMessageBox(_("Code::Blocks associated with C/C++ files."), _("Information"), wxICON_INFORMATION);
+#endif
 }
 
 void EnvironmentSettingsDlg::OnManageAssocs(wxCommandEvent& event)
 {
+#ifdef __WXMSW__
     ManageAssocsDialog dlg(this);
     PlaceWindow(&dlg);
     dlg.ShowModal();
+#endif
 }
 
 void EnvironmentSettingsDlg::OnChooseColor(wxCommandEvent& event)
thomasdenk 2006-02-18 16:45

Thanks for pointing this out, but you're not entirely right ;)

I did not put any #ifdefs in there on purpose because they are not necessary and they make the code less readable.

While it is true that it *would* call these functions if the respective events were received, those events can never be generated, since the respective controls which could fire them are disabled in a non-Windows build.

afb 2006-02-18 17:03

Well, I just went the same route as the header inclusion:

#ifdef __WXMSW__

#include "associations.h"

#endif

Just trying to make it compile... (it was missing symbols)

thomasdenk 2006-02-18 17:55

I have to apologize. I did not account for the fact that associations.cpp is not compiled under Linux at all!

That means that your patch *is* valid. Not for runtime, but for being able to compile at all. You're perfectly right.