Author Topic: Detection of invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] path  (Read 3875 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
I have a invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] setting in my config. To reproduce:
1) Create a new compiler in the compiler options
2) Leave the path empty and save the settings.

Now if you open codeblocks you get the AutoDetectCompilers dialog. Now if you scroll trough the entries all are valid, but the invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!] is "Not-Found" as all other default compilers that have no path set. This should not be the case. If the compiler is user added there should be a big red warning that this compiler has no path, or is invalid....

Now i looked into the code and found this:
sdk\autodetectcompilers.cpp:59
Code
            wxString path = compiler->GetMasterPath();
            wxString path_no_macros = compiler->GetMasterPath();
            Manager::Get()->GetMacrosManager()->ReplaceMacros(path_no_macros);

            int idx = list->GetItemCount() - 1;
            int highlight = 0;
            if (path.IsEmpty() && Manager::Get()->GetConfigManager(wxT("compiler"))->Exists(wxT("/sets/") + compiler->GetID() + wxT("/name")))
            {
                // Here, some user-interaction is required not to show this
                // dialog again on each new start-up of C::B.
                list->SetItem(idx, 1, _("Invalid"));
                // So we better clearly HIGHLIGHT this entry:
                highlight = 1;
            }
            else // The compiler is *probably* invalid, but at least a master-path is set
            {
                list->SetItem(idx, 1, _("Not found"));
                highlight = -1;
            }

what is
Code
Manager::Get()->GetConfigManager(wxT("compiler"))->Exists(wxT("/sets/") + compiler->GetID() + wxT("/name"))
. Why is there a differentiation? If the master path is empty this should be "invalid" or not?

can someone bring light to this?
thank you!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
WTF? Is there a auto insert thing for forum posts with "Detection of invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]" keyword? I did not added this
Quote
[YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]
thing xD

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Ok, this is going out of hand now with the title

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Yes, there is detection of the words i n v a l i d c o m p i l e r. And they are replaced with this message. There are too many people posting about it, so we had to take this measure.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]