1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00
Commit Graph

8 Commits

Author SHA1 Message Date
Alexander Wilms
1b85abb508 Use auto instead of redundant type in initializations using new
grep -r --include \*.h --include \*.cpp "=" * | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return\|{\|}\|= \"\|= tr(\|virtual\|void" | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "float\|nullptr" | grep "new" | grep -v "AI/FuzzyLite" | grep \( | grep "= new" > redundant_types.txt

import re

with open("redundant_types.txt") as f:
    for line in f:
        line = line.strip()
        path = line.split(":", 1)[0]
        original_code = line.split(":")[1].strip()
        if "new " in original_code:

            cpp_type = original_code.split(" ")[0]
            if original_code.count(cpp_type) == 2:
                print()
                print(path)
                print(original_code)
                new_code = "auto "+" ".join(original_code.split(" ")[1:])
                print(new_code)

                with open(path, "r") as f:
                    filedata = f.read()

                filedata = filedata.replace(original_code, new_code)

                with open(path, "w") as f:
                    f.write(filedata)
2024-01-16 21:40:53 +00:00
Ivan Savenko
8010bff866 Formatting 2022-12-29 16:37:38 +02:00
Ivan Savenko
cd6a894417 Call method from parent class after processing event 2022-12-28 17:58:39 +02:00
Ivan Savenko
1696db8a3c Launcher translation upgrade, still WIP:
- launcher can be re-translated without restart
- mod info (name/description/etc) can have localized versions
2022-12-25 13:19:16 +02:00
Konstantin
1a6ee0d697
Launcher: Qt6 support. Qt 5.12 required (#746)
* Launcher: Qt6 support. Qt 5.12 required
2022-05-28 16:32:20 +03:00
Arseniy Shestakov
9da3f48274 Code style: formatting and refactoring of launcher code 2018-04-13 15:23:35 +07:00
Arseniy Shestakov
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
Ivan Savenko
791099ab33 - added *_moc suffix to imageviewer files 2014-03-29 12:46:41 +00:00