Author Topic: Scripted Plugin: FindBrokenFiles  (Read 23720 times)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Scripted Plugin: FindBrokenFiles
« Reply #15 on: December 30, 2011, 10:22:41 am »
OK, I've committed it to trunk...
BTW: Reminds me: I had an issue with this script the past time I used it: When removing files, some were left and you had to call the script several times to really remove all broken files. Is that still the case?
Yes it is.

The cause is that you loop forward through the files and remove them.

In general it's better to do this backwards if removing array members, because a removed index does not change the indexes following in the loop.

I fixed it in trunk and now it seems to work as expected.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Scripted Plugin: FindBrokenFiles
« Reply #16 on: December 30, 2011, 11:02:25 am »
I've tried it on the codeblocks-unix.cbp and it removed one file successfully :)
Note that this might not really be a missing file. some of the files are Windows only and are simple "disabled" in Unix.
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 MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Scripted Plugin: FindBrokenFiles
« Reply #17 on: December 30, 2011, 11:04:05 am »
In general it's better to do this backwards if removing array members, because a removed index does not change the indexes following in the loop.
I know, but it was really just a demo and I was to lazy to take care.

I fixed it in trunk and now it seems to work as expected.
Thanks! :)
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 LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Scripted Plugin: FindBrokenFiles
« Reply #18 on: January 02, 2012, 09:49:57 am »
Good year for C::B.
@jens
r7650 in 'src/scripts/plugin_find_broken_files.script',
line of code:
Quote
entries.Add(_T("Plugins/0:-Find broken files in project"), 1);
creates an entry 'Plugins' in the international versions !
I propose instead
Quote
entries.Add(_("&Plugins") + _T("/0:-") + _("Find broken files in project"), 1) ;
which also allows the translation.

Other hand, all the scripts in this directory can be prepared for the translation, I can send
a zip of changed files and 'scripts.pot', that works at home.

CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Scripted Plugin: FindBrokenFiles
« Reply #19 on: January 02, 2012, 05:08:15 pm »
As far as I can see you've not tested the change, have you?
I think so, because the correct line is:
Code
entries.Add(_("P&lugins") + _T("/0:-") + _("Find broken files in project"), 1);

Please verify my version of the line is correct and I'll commit it.

(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 LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Scripted Plugin: FindBrokenFiles
« Reply #20 on: January 02, 2012, 05:26:27 pm »
I tested and it works with my setup !
In r7650 (English) with '&Plugins', 'P&lugins', 'Plugins' it works !!
and French works as.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Scripted Plugin: FindBrokenFiles
« Reply #21 on: January 02, 2012, 05:36:28 pm »
So what is the correct line? Your last post is quite confusing.
(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 LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Scripted Plugin: FindBrokenFiles
« Reply #22 on: January 02, 2012, 05:39:29 pm »
The '&' is not taken into account.
Take 'Plugins' as 'Jens'.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Scripted Plugin: FindBrokenFiles
« Reply #23 on: January 02, 2012, 06:43:39 pm »
r7650 : In the source 'src\main.cpp:926'  found  _('P&lugins').
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Scripted Plugin: FindBrokenFiles
« Reply #24 on: January 02, 2012, 08:49:17 pm »
Yes, I know, that's why I've said that you've not tested your change, but if it doesn't matter I'll commit a version without the '&' character.
(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 LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Scripted Plugin: FindBrokenFiles
« Reply #25 on: January 03, 2012, 08:48:23 am »
@ofuscated
I am sorry but I tested all the possibilities on r7650, before posting:
Quote
'Plugins'
Quote
'&Plugins'
Quote
'P&lugins'

all work on my computer!

In addition, the menus, letters preceded by '&' are no different from others letters.
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl