CMakePM: Add new / existing source files to project

This will add the new added source files (.cpp, .h, .qrc, .ui) to the
corresponding CMake source file as last arguments for known CMake
functions like add_executable, add_library as well for the Qt
counterprarts qt_add_executable or qt_add_library.

For custom functions the code will insert a target_sources() call.
Subsequent calls will add the files to the last target_sources.

The previous copy to clipboard mechanism and settings have been removed.

Fixes: QTCREATORBUG-26006
Fixes: QTCREATORBUG-27213
Fixes: QTCREATORBUG-28493
Fixes: QTCREATORBUG-29006
Change-Id: Ia6e075e4e5718e4106c1236673d469139611a677
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Cristian Adam
2023-04-13 12:52:39 +02:00
parent d74c2369ee
commit d8be2491a5
17 changed files with 283 additions and 96 deletions

View File

@@ -30,16 +30,6 @@ CMakeSpecificSettings::CMakeSpecificSettings()
autorunCMake.setToolTip(::CMakeProjectManager::Tr::tr(
"Automatically run CMake after changes to CMake project files."));
registerAspect(&afterAddFileSetting);
afterAddFileSetting.setSettingsKey("ProjectPopupSetting");
afterAddFileSetting.setDefaultValue(AfterAddFileAction::AskUser);
afterAddFileSetting.addOption(::CMakeProjectManager::Tr::tr("Ask about copying file paths"));
afterAddFileSetting.addOption(::CMakeProjectManager::Tr::tr("Do not copy file paths"));
afterAddFileSetting.addOption(::CMakeProjectManager::Tr::tr("Copy file paths"));
afterAddFileSetting.setToolTip(::CMakeProjectManager::Tr::tr("Determines whether file paths are copied "
"to the clipboard for pasting to the CMakeLists.txt file when you "
"add new files to CMake projects."));
registerAspect(&ninjaPath);
ninjaPath.setSettingsKey("NinjaPath");
// never save this to the settings:
@@ -95,10 +85,6 @@ CMakeSpecificSettingsPage::CMakeSpecificSettingsPage()
CMakeSpecificSettings &s = *settings;
using namespace Layouting;
Column {
Group {
title(::CMakeProjectManager::Tr::tr("Adding Files")),
Column { s.afterAddFileSetting }
},
s.autorunCMake,
s.packageManagerAutoSetup,
s.askBeforeReConfigureInitialParams,