#!/usr/bin/env python3 """ Korrektur der Include-Pfade für asb, ppm_gui_combobox und request_helper """ import os import re from pathlib import Path base_dir = Path("/home/torsten/swy/sandbox/qt-migration-legatus/qt6-after/qt6-migrated-legatus") # Alle .h und .cpp Dateien finden files = list(base_dir.rglob("*.h")) + list(base_dir.rglob("*.cpp")) count = 0 for file_path in files: try: content = file_path.read_text(encoding='utf-8') original = content # Ersetze Plugins/AdvancedSymbology/ durch AdvancedSymbology/ content = content.replace( "Plugins/AdvancedSymbology/", "AdvancedSymbology/" ) # Ersetze Plugins/ParticipantManagement/ durch ParticipantManagement/ content = content.replace( "Plugins/ParticipantManagement/", "ParticipantManagement/" ) # Ersetze LtsUtilsGuiDds/ durch LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/ content = content.replace( "LtsUtilsGuiDds/", "LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/" ) if content != original: file_path.write_text(content, encoding='utf-8') count += 1 print(f"Fixed: {file_path.relative_to(base_dir)}") except Exception as e: print(f"Error processing {file_path}: {e}") print(f"\n{count} Dateien aktualisiert")