Recent Posts

Pages: 1 ... 5 6 7 8 9 [10]
91
Development / Re: event sequence question?
« Last post by ollydbg on January 15, 2022, 03:10:49 am »
I think it should be a core plugin.

But this plugin should be excluded from the normal C::B user.  It's mainly for developers.
92
Development / Re: event sequence question?
« Last post by AndrewCot on January 14, 2022, 09:36:57 pm »
It would be very useful. IMHO Worst case add it as a contrib plugin, but I agree is would be better as a core plugin.
93
Development / Re: event sequence question?
« Last post by Miguel Gimenez on January 14, 2022, 07:19:50 pm »
Should this plugin be added to the core plugins?. I think it can be very useful, not only for plugin developers but for core developers.

It might also be added to the plugins (not contrib), just like the headerguard-plugin for example, without being included in automake-system and contrib-plugins workspace.
94
Using Code::Blocks / Re: Can't add X11 to search directory
« Last post by BlueHazzard on January 14, 2022, 06:46:24 pm »
Quote
dl.flathub.org.
Is this a flatpak installation? So this could  be IS the reason... Flatpack and codeblocks do not like each other, because flatpack applications run in a sandbox and do not have access to system resources, where libraries and header are... This is the reason for your problems...

95
Using Code::Blocks / Re: Can't add X11 to search directory
« Last post by AzureZero on January 14, 2022, 05:48:31 pm »
I've run those commands (sudo) when setting up codeblocks and even used Synaptic package manager to re-install them encase something was corrupted.

And I can't run CodeBlocks as sudo in the terminal
Code
ryos@ZorinVM:~$ sudo codeblocks
sudo: codeblocks: command not found

Seems I must have a different version of code-blocks installed.

I'll try using the one from the Zorin repo using
Code
sudo apt-get install codeblocks
and the console project works now.

So their is an Issue with one from the software centre, Version: 20.03, Updated: 2021-12-06,  sourced from dl.flathub.org.
While the apt-get one works.
96
Using Code::Blocks / Re: Can't add X11 to search directory
« Last post by BlueHazzard on January 14, 2022, 04:56:07 pm »
Is there a way to get the IDE to run as Root, to test if it is a permission issue of some sort, or some other issue?

simply run codeblocks with "sudo codeblocks".

but then all created files will be owned by root.

Have you tried the commands i wrote? you can try them with root too.
97
Using Code::Blocks / Re: Can't add X11 to search directory
« Last post by AzureZero on January 14, 2022, 04:51:44 pm »
I tested with a NEW console project (Hello world) on my ZorinOS 16 Core Virtual Machine

only adding /usr/include in the search directories for Code::Blocks

and it fails on X11/Xmu/WinUtil.h

it sees other directories in the X11, but not the Xmu directory.
As I decided to manually re-type the include statement and the auto-fill did not list X11/Xmu
as I did not find it between Xmd.h and Xos.h

Yeah, this is a rare head scratcher of a problem.

--

Is there a way to get the IDE to run as Root, to test if it is a permission issue of some sort, or some other issue?
98
Development / Re: Config save bug query
« Last post by AndrewCot on January 14, 2022, 10:00:26 am »
Thanks and I would love your feedback.

BTW: I did a quick and dirty hack in removed the one call to MirrorCurrentSettings() and the config file ballooned in size with allot of extra info being written to it, but nothings "bad" occurred that I seen or occurred in the 30 to 40 minutes of testing I did. The extra info looking like some macro "stuff", but I  have not looked at it and won't get to it for a day or two as I am slowly installing and setting up a new Linux Mint 20.3 guest.

99
Development / Re: Config save bug query
« Last post by BlueHazzard on January 14, 2022, 09:17:05 am »
This could indeed be the right way to go...
I will also look into it a bit at the evening
100
Development / Config save bug query
« Last post by AndrewCot on January 14, 2022, 04:05:25 am »
Sorry for yet another huge post, but it gets a little bit complex and I have included a potential untested solution.

I am working on getting my code for ticket 1114 ready for a patch to be submitted as allot of changes have occurred since August 2021.

I am ironing out some config bugs and want to check if my assumptions and findings are right or wrong. If they are wrong please point me on where I went wrong so I can get to the final solution faster.

I have found the following:
1) In the void CompilerFactory::SaveSettings() calls the following:
Code
void CompilerFactory::SaveSettings()
{
    // clear old keys before saving
    Manager::Get()->GetConfigManager(_T("compiler"))->DeleteSubPath(_T("/sets"));
    Manager::Get()->GetConfigManager(_T("compiler"))->DeleteSubPath(_T("/user_sets"));

    for (size_t i = 0; i < Compilers.GetCount(); ++i)
    {
        wxString baseKey = Compilers[i]->GetParentID().IsEmpty() ? _T("/sets") : _T("/user_sets");
        Compilers[i]->SaveSettings(baseKey);

   Which deletes all of the compilers.. Ouch
   And then at first glance of the code saves the settings, BUT the Compiler::SaveSettings(const wxString& baseKey) code only saves the changes since the call to the Compiler::MirrorCurrentSettings() that occurs on loading.... another Ouch but even more worring

Snippet of code from  Compiler::SaveSettings(const wxString& baseKey) :
Code
    if (m_Mirror.CompilerOptions_ != m_CompilerOptions)
    {
        wxString key = GetStringFromArray(m_CompilerOptions);
        cfg->Write(tmp + _T("/compiler_options"), key, false);
    }

2) The Compiler::SaveSettings(...) does not flush the file to disk at the end. Another minor change.

My query is:
Does anyone know why the CompilerFactory::SaveSettings() removed the keys and then the Compiler::SaveSetting() only saves the changes, so that if this code is executed then you could end up with a bad config file.  This is occurring with me for the mods I am making.


Potential Conclusion:
This could be what is causing the corrupted (aka bad) config files that are reported a few times are year as it depends on the code path as to if the problem outlined above occurs.


Possible Untested Solution:
a) Change the CompilerFactory::SaveSettings() to be:
Code
void CompilerFactory::SaveSettings()
{
    for (size_t i = 0; i < Compilers.GetCount(); ++i)
    {
        if (Compilers[i]->IsValid())
        {
            // Only save valid compiler configuration settings
            wxString baseKey = Compilers[i]->GetParentID().IsEmpty() ? _T("/sets") : _T("/user_sets");
            Compilers[i]->SaveSettings(baseKey);

            CodeBlocksEvent event(cbEVT_COMPILER_SETTINGS_CHANGED);
            event.SetString(Compilers[i]->GetID());
            event.SetInt(static_cast<int>(i));
            event.SetClientData(static_cast<void*>(Compilers[i]));
            Manager::Get()->ProcessEvent(event);
        }
    }
}
     The delete keys are moved into the SaveSettings(...) as it already deleted the old style keys
     This way only valid compiler data is saved instead of partial data for invalid compilers
c) Update the Compiler::SaveSettings(const wxString& baseKey) to do the following:
    1) Add the DeleteSubPath and the first comment line (the rest are exisiting lines)
Code
    // delete old keys before saving
    tmp.Printf(_T("%s/%s"), baseKey.c_str(), m_ID.c_str());
    cfg->DeleteSubPath(tmp);

    cfg->Write(tmp + _T("/name"),   m_Name);
    cfg->Write(tmp + _T("/parent"), m_ParentID, true);
  2) Change the code to save all of the config data instead of checking if it has changed
  3) Add a  cfg->Flush(); at the end of the function.

d) Remove the MirrorCurrentSettings() and the associated m_Mirror variables

What do people think about these changes? An I going on a tangent to a proper solution? Is this too much? Have I missed something?

The reason I am posting this is so that I do not go and spend a few days on this and find out that it was waste of time for some reason that someone else may know about.
Pages: 1 ... 5 6 7 8 9 [10]