Author Topic: Files order in virtual folders  (Read 12033 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Files order in virtual folders
« Reply #15 on: August 14, 2015, 08:20:37 pm »
Please post a real patch.  8)
(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!]

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: Files order in virtual folders
« Reply #16 on: August 20, 2015, 08:36:47 pm »
Not for the moment, I am working on
- my externel lexer loader for scintilla ( which works but will never be accepted by Neil )
- my enhanced OpenFilesList plugin

http://www.mediafire.com/view/qawkuoi05ac8qvu/2015.08.20-cb%20LexerExt%20OFL.png#
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: Files order in virtual folders
« Reply #17 on: January 16, 2016, 07:39:21 am »
trunk@svn10640 - ProjectTreeSortChildrenRecursive()@ProjectManagerUI.cpp : remove the red part and it is ok


static void ProjectTreeSortChildrenRecursive(cbTreeCtrl* tree, const wxTreeItemId& parent)
{
    wxTreeItemIdValue cookie = nullptr;

    tree->SortChildren(parent);

    wxTreeItemId current = tree->GetFirstChild(parent, cookie);
    while (current && tree->ItemHasChildren(current))
    {
        ProjectTreeSortChildrenRecursive(tree, current);
        current = tree->GetNextChild(parent, cookie);
    }
}


It breaks the recursion traveling ; current may not have children, but may have brothers :

while (...) loop :

                                  current ( = first child )
                                      |
                   +------------------------------------+
                   |                                    |
            has children                      dont have children
                   |                                    |
                   v                                    v
    - recursion on current's children    - missing loop on current's brothers
    - loop on current's brothers



You may put the optimization test on 'sterile' nodes inside the while (...) loop. Or code a recurse process differently.
« Last Edit: January 17, 2016, 07:06:09 am by earlgrey »
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Files order in virtual folders
« Reply #18 on: January 16, 2016, 11:53:38 am »
I guess you're proposing a fix for the original issue, right?
Can you post a tested patch?  ::)

(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!]

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: Files order in virtual folders
« Reply #19 on: January 17, 2016, 07:18:10 am »
Here it is, I did
Code
diff -au projectmanagerui.cpp@10648 projectmanagerui.cpp@earlgrey > projectmanagerui.cpp.patch
so you patch with
Code
patch projectmanagerui.cpp projectmanagerui.cpp.patch
I :
* added an optimization at method begin
* moved the misplaced original one.
-> bye bye, bug :)
« Last Edit: January 17, 2016, 07:26:07 am by earlgrey »
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Files order in virtual folders
« Reply #20 on: January 17, 2016, 11:00:45 am »
Here it is, I did
Code
diff -au projectmanagerui.cpp@10648 projectmanagerui.cpp@earlgrey > projectmanagerui.cpp.patch
This won't work on Windows (easily). Can you please just use SVN to create a patch file as suggested?
In your SVN working copy, please run: this command:
svn diff > my.patch
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Files order in virtual folders
« Reply #21 on: January 17, 2016, 11:07:49 am »
BTW: Morten have you tried to install git bash? It contains most of the unix tools, so it might have a working version of the patch tool.
(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!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Files order in virtual folders
« Reply #22 on: January 17, 2016, 12:16:41 pm »
BTW: Morten have you tried to install git bash? It contains most of the unix tools, so it might have a working version of the patch tool.
Sure and not only that, so I think I have plenty of versions of "patch", but you don't really want me to go to the command line on Windows, just to apply a patch, right? What frustrates me is that there is an easy way using SVN to create and apply patches, but we get them in so many different formats and for each format I need a special tool. I remember that previously even "patch" was not "patch" but you needed a special version...

Oh it could be that simple...  ;D
« Last Edit: January 17, 2016, 12:18:57 pm by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: Files order in virtual folders
« Reply #23 on: January 17, 2016, 04:48:22 pm »
Here it is
Code
$ cd codeblocks-code
$ svn diff > projectmanagerui.cpp@10668.svn-diff.patch
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline earlgrey

  • Multiple posting newcomer
  • *
  • Posts: 101
Re: Files order in virtual folders
« Reply #24 on: March 19, 2016, 07:59:43 am »
I see patch has not been yet applied ; If you are afraid of modifying core C::B's UI with not-well-tested patch, you shouldn't : bug was only a small inattention error.
* OS = Debian Buster - Linux 4.19.06 x64 SMP
* C::B = svn11267 wx-3.0.4 - Linux, unicode 64 bit

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Files order in virtual folders
« Reply #25 on: March 19, 2016, 02:57:25 pm »
In svn after some cleanup and simplification. Thanks.
(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!]