diff --git a/src/plugins/bazaar/bazaarsettings.cpp b/src/plugins/bazaar/bazaarsettings.cpp index 1b2840084cb..344bdc6a095 100644 --- a/src/plugins/bazaar/bazaarsettings.cpp +++ b/src/plugins/bazaar/bazaarsettings.cpp @@ -32,48 +32,37 @@ BazaarSettings::BazaarSettings() setDisplayName(Tr::tr("Bazaar")); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); - registerAspect(&binaryPath); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setDefaultValue(Constants::BAZAARDEFAULT); binaryPath.setDisplayName(Tr::tr("Bazaar Command")); binaryPath.setHistoryCompleter("Bazaar.Command.History"); binaryPath.setLabelText(Tr::tr("Command:")); - registerAspect(&diffIgnoreWhiteSpace); diffIgnoreWhiteSpace.setSettingsKey("diffIgnoreWhiteSpace"); - registerAspect(&diffIgnoreBlankLines); diffIgnoreBlankLines.setSettingsKey("diffIgnoreBlankLines"); - registerAspect(&logVerbose); logVerbose.setSettingsKey("logVerbose"); - registerAspect(&logFormat); logForward.setSettingsKey("logForward"); - registerAspect(&logIncludeMerges); logIncludeMerges.setSettingsKey("logIncludeMerges"); - registerAspect(&logFormat); logFormat.setDisplayStyle(StringAspect::LineEditDisplay); logFormat.setSettingsKey("logFormat"); logFormat.setDefaultValue("long"); - registerAspect(&userName); userName.setDisplayStyle(StringAspect::LineEditDisplay); userName.setLabelText(Tr::tr("Default username:")); userName.setToolTip(Tr::tr("Username to use by default on commit.")); - registerAspect(&userEmail); userEmail.setDisplayStyle(StringAspect::LineEditDisplay); userEmail.setLabelText(Tr::tr("Default email:")); userEmail.setToolTip(Tr::tr("Email to use by default on commit.")); - registerAspect(&logCount); logCount.setLabelText(Tr::tr("Log count:")); logCount.setToolTip(Tr::tr("The number of recent commit logs to show. Choose 0 to see all entries.")); - registerAspect(&logCount); timeout.setLabelText(Tr::tr("Timeout:")); timeout.setSuffix(Tr::tr("s")); diff --git a/src/plugins/bazaar/bazaarsettings.h b/src/plugins/bazaar/bazaarsettings.h index 24643a2d4cd..0e6cc0d8520 100644 --- a/src/plugins/bazaar/bazaarsettings.h +++ b/src/plugins/bazaar/bazaarsettings.h @@ -12,12 +12,12 @@ class BazaarSettings final : public VcsBase::VcsBaseSettings public: BazaarSettings(); - Utils::BoolAspect diffIgnoreWhiteSpace; - Utils::BoolAspect diffIgnoreBlankLines; - Utils::BoolAspect logVerbose; - Utils::BoolAspect logForward; - Utils::BoolAspect logIncludeMerges; - Utils::StringAspect logFormat; + Utils::BoolAspect diffIgnoreWhiteSpace{this}; + Utils::BoolAspect diffIgnoreBlankLines{this}; + Utils::BoolAspect logVerbose{this}; + Utils::BoolAspect logForward{this}; + Utils::BoolAspect logIncludeMerges{this}; + Utils::StringAspect logFormat{this}; }; BazaarSettings &settings(); diff --git a/src/plugins/cvs/cvssettings.cpp b/src/plugins/cvs/cvssettings.cpp index dbfd41e500c..e2247f7dbe0 100644 --- a/src/plugins/cvs/cvssettings.cpp +++ b/src/plugins/cvs/cvssettings.cpp @@ -33,25 +33,21 @@ CvsSettings::CvsSettings() setDisplayName(Tr::tr("CVS")); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); - registerAspect(&binaryPath); binaryPath.setDefaultValue("cvs" QTC_HOST_EXE_SUFFIX); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setHistoryCompleter(QLatin1String("Cvs.Command.History")); binaryPath.setDisplayName(Tr::tr("CVS Command")); binaryPath.setLabelText(Tr::tr("CVS command:")); - registerAspect(&cvsRoot); cvsRoot.setDisplayStyle(StringAspect::LineEditDisplay); cvsRoot.setSettingsKey("Root"); cvsRoot.setLabelText(Tr::tr("CVS root:")); - registerAspect(&diffOptions); diffOptions.setDisplayStyle(StringAspect::LineEditDisplay); diffOptions.setSettingsKey("DiffOptions"); diffOptions.setDefaultValue("-du"); diffOptions.setLabelText("Diff options:"); - registerAspect(&describeByCommitId); describeByCommitId.setSettingsKey("DescribeByCommitId"); describeByCommitId.setDefaultValue(true); describeByCommitId.setLabelText(Tr::tr("Describe all files matching commit id")); @@ -59,10 +55,8 @@ CvsSettings::CvsSettings() "displayed when clicking on a revision number in the annotation view " "(retrieved via commit ID). Otherwise, only the respective file will be displayed.")); - registerAspect(&diffIgnoreWhiteSpace); diffIgnoreWhiteSpace.setSettingsKey("DiffIgnoreWhiteSpace"); - registerAspect(&diffIgnoreBlankLines); diffIgnoreBlankLines.setSettingsKey("DiffIgnoreBlankLines"); setLayouter([this](QWidget *widget) { diff --git a/src/plugins/cvs/cvssettings.h b/src/plugins/cvs/cvssettings.h index 0c2e5442a62..ade9920b2ad 100644 --- a/src/plugins/cvs/cvssettings.h +++ b/src/plugins/cvs/cvssettings.h @@ -12,11 +12,11 @@ class CvsSettings : public VcsBase::VcsBaseSettings public: CvsSettings(); - Utils::StringAspect cvsRoot; - Utils::StringAspect diffOptions; - Utils::BoolAspect diffIgnoreWhiteSpace; - Utils::BoolAspect diffIgnoreBlankLines; - Utils::BoolAspect describeByCommitId; + Utils::StringAspect cvsRoot{this}; + Utils::StringAspect diffOptions{this}; + Utils::BoolAspect diffIgnoreWhiteSpace{this}; + Utils::BoolAspect diffIgnoreBlankLines{this}; + Utils::BoolAspect describeByCommitId{this}; QStringList addOptions(const QStringList &args) const; }; diff --git a/src/plugins/fossil/fossilsettings.cpp b/src/plugins/fossil/fossilsettings.cpp index 22adad3920d..d62f48f1566 100644 --- a/src/plugins/fossil/fossilsettings.cpp +++ b/src/plugins/fossil/fossilsettings.cpp @@ -33,72 +33,57 @@ FossilSettings::FossilSettings() setDisplayName(Tr::tr("Fossil")); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); - registerAspect(&binaryPath); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setDefaultValue(Constants::FOSSILDEFAULT); binaryPath.setDisplayName(Tr::tr("Fossil Command")); binaryPath.setHistoryCompleter("Fossil.Command.History"); binaryPath.setLabelText(Tr::tr("Command:")); - registerAspect(&defaultRepoPath); defaultRepoPath.setSettingsKey("defaultRepoPath"); defaultRepoPath.setExpectedKind(PathChooser::Directory); defaultRepoPath.setDisplayName(Tr::tr("Fossil Repositories")); defaultRepoPath.setLabelText(Tr::tr("Default path:")); defaultRepoPath.setToolTip(Tr::tr("Directory to store local repositories by default.")); - registerAspect(&userName); userName.setDisplayStyle(StringAspect::LineEditDisplay); userName.setLabelText(Tr::tr("Default user:")); userName.setToolTip(Tr::tr("Existing user to become an author of changes made to the repository.")); - registerAspect(&sslIdentityFile); sslIdentityFile.setSettingsKey("sslIdentityFile"); sslIdentityFile.setExpectedKind(PathChooser::File); sslIdentityFile.setDisplayName(Tr::tr("SSL/TLS Identity Key")); sslIdentityFile.setLabelText(Tr::tr("SSL/TLS identity:")); sslIdentityFile.setToolTip(Tr::tr("SSL/TLS client identity key to use if requested by the server.")); - registerAspect(&diffIgnoreAllWhiteSpace); diffIgnoreAllWhiteSpace.setSettingsKey("diffIgnoreAllWhiteSpace"); - registerAspect(&diffStripTrailingCR); diffStripTrailingCR.setSettingsKey("diffStripTrailingCR"); - registerAspect(&annotateShowCommitters); annotateShowCommitters.setSettingsKey("annotateShowCommitters"); - registerAspect(&annotateListVersions); annotateListVersions.setSettingsKey("annotateListVersions"); - registerAspect(&timelineWidth); timelineWidth.setSettingsKey("timelineWidth"); timelineWidth.setLabelText(Tr::tr("Log width:")); timelineWidth.setToolTip(Tr::tr("The width of log entry line (>20). " "Choose 0 to see a single line per entry.")); - registerAspect(&timelineLineageFilter); timelineLineageFilter.setSettingsKey("timelineLineageFilter"); - registerAspect(&timelineVerbose); timelineVerbose.setSettingsKey("timelineVerbose"); - registerAspect(&timelineItemType); timelineItemType.setDefaultValue("all"); timelineItemType.setSettingsKey("timelineItemType"); - registerAspect(&disableAutosync); disableAutosync.setSettingsKey("disableAutosync"); disableAutosync.setDefaultValue(true); disableAutosync.setLabelText(Tr::tr("Disable auto-sync")); disableAutosync.setToolTip(Tr::tr("Disable automatic pull prior to commit or update and " "automatic push after commit or tag or branch creation.")); - registerAspect(&timeout); timeout.setLabelText(Tr::tr("Timeout:")); timeout.setSuffix(Tr::tr("s")); - registerAspect(&logCount); logCount.setLabelText(Tr::tr("Log count:")); logCount.setToolTip(Tr::tr("The number of recent commit log entries to show. " "Choose 0 to see all entries.")); diff --git a/src/plugins/fossil/fossilsettings.h b/src/plugins/fossil/fossilsettings.h index 6b925357f06..8e56b1985cc 100644 --- a/src/plugins/fossil/fossilsettings.h +++ b/src/plugins/fossil/fossilsettings.h @@ -12,17 +12,17 @@ class FossilSettings : public VcsBase::VcsBaseSettings public: FossilSettings(); - Utils::FilePathAspect defaultRepoPath; - Utils::FilePathAspect sslIdentityFile; - Utils::BoolAspect diffIgnoreAllWhiteSpace; - Utils::BoolAspect diffStripTrailingCR; - Utils::BoolAspect annotateShowCommitters; - Utils::BoolAspect annotateListVersions; - Utils::IntegerAspect timelineWidth; - Utils::StringAspect timelineLineageFilter; - Utils::BoolAspect timelineVerbose; - Utils::StringAspect timelineItemType; - Utils::BoolAspect disableAutosync; + Utils::FilePathAspect defaultRepoPath{this}; + Utils::FilePathAspect sslIdentityFile{this}; + Utils::BoolAspect diffIgnoreAllWhiteSpace{this}; + Utils::BoolAspect diffStripTrailingCR{this}; + Utils::BoolAspect annotateShowCommitters{this}; + Utils::BoolAspect annotateListVersions{this}; + Utils::IntegerAspect timelineWidth{this}; + Utils::StringAspect timelineLineageFilter{this}; + Utils::BoolAspect timelineVerbose{this}; + Utils::StringAspect timelineItemType{this}; + Utils::BoolAspect disableAutosync{this}; }; FossilSettings &settings(); diff --git a/src/plugins/git/gitsettings.cpp b/src/plugins/git/gitsettings.cpp index 5f65fa2f1b8..6cbec254445 100644 --- a/src/plugins/git/gitsettings.cpp +++ b/src/plugins/git/gitsettings.cpp @@ -31,42 +31,32 @@ GitSettings::GitSettings() setId(VcsBase::Constants::VCS_ID_GIT); setDisplayName(Tr::tr("Git")); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); - setSettingsGroup("Git"); path.setDisplayStyle(StringAspect::LineEditDisplay); path.setLabelText(Tr::tr("Prepend to PATH:")); - registerAspect(&binaryPath); binaryPath.setDefaultValue("git"); - registerAspect(&pullRebase); pullRebase.setSettingsKey("PullRebase"); pullRebase.setLabelText(Tr::tr("Pull with rebase")); - registerAspect(&showTags); showTags.setSettingsKey("ShowTags"); - registerAspect(&omitAnnotationDate); omitAnnotationDate.setSettingsKey("OmitAnnotationDate"); - registerAspect(&ignoreSpaceChangesInDiff); ignoreSpaceChangesInDiff.setSettingsKey("SpaceIgnorantDiff"); ignoreSpaceChangesInDiff.setDefaultValue(true); - registerAspect(&ignoreSpaceChangesInBlame); ignoreSpaceChangesInBlame.setSettingsKey("SpaceIgnorantBlame"); ignoreSpaceChangesInBlame.setDefaultValue(true); - registerAspect(&blameMoveDetection); blameMoveDetection.setSettingsKey("BlameDetectMove"); blameMoveDetection.setDefaultValue(0); - registerAspect(&diffPatience); diffPatience.setSettingsKey("DiffPatience"); diffPatience.setDefaultValue(true); - registerAspect(&winSetHomeEnvironment); winSetHomeEnvironment.setSettingsKey("WinSetHomeEnvironment"); winSetHomeEnvironment.setDefaultValue(true); winSetHomeEnvironment.setLabelText(Tr::tr("Set \"HOME\" environment variable")); @@ -84,47 +74,37 @@ GitSettings::GitSettings() winSetHomeEnvironment.setVisible(false); } - registerAspect(&gitkOptions); gitkOptions.setDisplayStyle(StringAspect::LineEditDisplay); gitkOptions.setSettingsKey("GitKOptions"); gitkOptions.setLabelText(Tr::tr("Arguments:")); - registerAspect(&logDiff); logDiff.setSettingsKey("LogDiff"); logDiff.setToolTip(Tr::tr("Note that huge amount of commits might take some time.")); - registerAspect(&repositoryBrowserCmd); repositoryBrowserCmd.setSettingsKey("RepositoryBrowserCmd"); repositoryBrowserCmd.setExpectedKind(PathChooser::ExistingCommand); repositoryBrowserCmd.setHistoryCompleter("Git.RepoCommand.History"); repositoryBrowserCmd.setDisplayName(Tr::tr("Git Repository Browser Command")); repositoryBrowserCmd.setLabelText(Tr::tr("Command:")); - registerAspect(&instantBlame); instantBlame.setSettingsKey("Git Instant"); instantBlame.setDefaultValue(true); instantBlame.setLabelText(Tr::tr("Add instant blame annotations to editor")); instantBlame.setToolTip(Tr::tr("Directly annotate each line in the editor " "when scrolling through the document.")); - registerAspect(&graphLog); graphLog.setSettingsKey("GraphLog"); - registerAspect(&colorLog); colorLog.setSettingsKey("ColorLog"); colorLog.setDefaultValue(true); - registerAspect(&firstParent); firstParent.setSettingsKey("FirstParent"); - registerAspect(&followRenames); followRenames.setSettingsKey("FollowRenames"); followRenames.setDefaultValue(true); - registerAspect(&lastResetIndex); lastResetIndex.setSettingsKey("LastResetIndex"); - registerAspect(&refLogShowDate); refLogShowDate.setSettingsKey("RefLogShowDate"); timeout.setDefaultValue(Utils::HostOsInfo::isWindowsHost() ? 60 : 30); diff --git a/src/plugins/git/gitsettings.h b/src/plugins/git/gitsettings.h index 0b82146b042..df6cf56e4e8 100644 --- a/src/plugins/git/gitsettings.h +++ b/src/plugins/git/gitsettings.h @@ -20,24 +20,24 @@ class GitSettings : public VcsBase::VcsBaseSettings public: GitSettings(); - Utils::BoolAspect pullRebase; - Utils::BoolAspect showTags; - Utils::BoolAspect omitAnnotationDate; - Utils::BoolAspect ignoreSpaceChangesInDiff; - Utils::BoolAspect ignoreSpaceChangesInBlame; - Utils::IntegerAspect blameMoveDetection; - Utils::BoolAspect diffPatience; - Utils::BoolAspect winSetHomeEnvironment; - Utils::StringAspect gitkOptions; - Utils::BoolAspect logDiff; - Utils::FilePathAspect repositoryBrowserCmd; - Utils::BoolAspect graphLog; - Utils::BoolAspect colorLog; - Utils::BoolAspect firstParent; - Utils::BoolAspect followRenames; - Utils::IntegerAspect lastResetIndex; - Utils::BoolAspect refLogShowDate; - Utils::BoolAspect instantBlame; + Utils::BoolAspect pullRebase{this}; + Utils::BoolAspect showTags{this}; + Utils::BoolAspect omitAnnotationDate{this}; + Utils::BoolAspect ignoreSpaceChangesInDiff{this}; + Utils::BoolAspect ignoreSpaceChangesInBlame{this}; + Utils::IntegerAspect blameMoveDetection{this}; + Utils::BoolAspect diffPatience{this}; + Utils::BoolAspect winSetHomeEnvironment{this}; + Utils::StringAspect gitkOptions{this}; + Utils::BoolAspect logDiff{this}; + Utils::FilePathAspect repositoryBrowserCmd{this}; + Utils::BoolAspect graphLog{this}; + Utils::BoolAspect colorLog{this}; + Utils::BoolAspect firstParent{this}; + Utils::BoolAspect followRenames{this}; + Utils::IntegerAspect lastResetIndex{this}; + Utils::BoolAspect refLogShowDate{this}; + Utils::BoolAspect instantBlame{this}; mutable Utils::FilePath resolvedBinPath; mutable bool tryResolve = true; diff --git a/src/plugins/mercurial/mercurialsettings.cpp b/src/plugins/mercurial/mercurialsettings.cpp index 0b84187b1b4..0ced239122e 100644 --- a/src/plugins/mercurial/mercurialsettings.cpp +++ b/src/plugins/mercurial/mercurialsettings.cpp @@ -28,32 +28,24 @@ MercurialSettings::MercurialSettings() setId(VcsBase::Constants::VCS_ID_MERCURIAL); setDisplayName(Tr::tr("Mercurial")); setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); - setSettings(&settings()); - setSettingsGroup("Mercurial"); - setAutoApply(false); - registerAspect(&binaryPath); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setDefaultValue(Constants::MERCURIALDEFAULT); binaryPath.setDisplayName(Tr::tr("Mercurial Command")); binaryPath.setHistoryCompleter("Bazaar.Command.History"); binaryPath.setLabelText(Tr::tr("Command:")); - registerAspect(&userName); userName.setDisplayStyle(StringAspect::LineEditDisplay); userName.setLabelText(Tr::tr("Default username:")); userName.setToolTip(Tr::tr("Username to use by default on commit.")); - registerAspect(&userEmail); userEmail.setDisplayStyle(StringAspect::LineEditDisplay); userEmail.setLabelText(Tr::tr("Default email:")); userEmail.setToolTip(Tr::tr("Email to use by default on commit.")); - registerAspect(&diffIgnoreWhiteSpace); diffIgnoreWhiteSpace.setSettingsKey("diffIgnoreWhiteSpace"); - registerAspect(&diffIgnoreBlankLines); diffIgnoreBlankLines.setSettingsKey("diffIgnoreBlankLines"); setLayouter([this](QWidget *widget) { diff --git a/src/plugins/mercurial/mercurialsettings.h b/src/plugins/mercurial/mercurialsettings.h index 08c8fa41544..2102d7037d6 100644 --- a/src/plugins/mercurial/mercurialsettings.h +++ b/src/plugins/mercurial/mercurialsettings.h @@ -12,8 +12,8 @@ class MercurialSettings : public VcsBase::VcsBaseSettings public: MercurialSettings(); - Utils::StringAspect diffIgnoreWhiteSpace; - Utils::StringAspect diffIgnoreBlankLines; + Utils::StringAspect diffIgnoreWhiteSpace{this}; + Utils::StringAspect diffIgnoreBlankLines{this}; }; MercurialSettings &settings(); diff --git a/src/plugins/perforce/perforcesettings.cpp b/src/plugins/perforce/perforcesettings.cpp index ead7b6b07b3..ee02465530e 100644 --- a/src/plugins/perforce/perforcesettings.cpp +++ b/src/plugins/perforce/perforcesettings.cpp @@ -35,7 +35,6 @@ PerforceSettings::PerforceSettings() setSettingsGroup("Perforce"); setAutoApply(false); - registerAspect(&p4BinaryPath); p4BinaryPath.setDisplayStyle(StringAspect::PathChooserDisplay); p4BinaryPath.setSettingsKey("Command"); p4BinaryPath.setDefaultValue( @@ -45,28 +44,23 @@ PerforceSettings::PerforceSettings() p4BinaryPath.setDisplayName(Tr::tr("Perforce Command")); p4BinaryPath.setLabelText(Tr::tr("P4 command:")); - registerAspect(&p4Port); p4Port.setDisplayStyle(StringAspect::LineEditDisplay); p4Port.setSettingsKey("Port"); p4Port.setLabelText(Tr::tr("P4 port:")); - registerAspect(&p4Client); p4Client.setDisplayStyle(StringAspect::LineEditDisplay); p4Client.setSettingsKey("Client"); p4Client.setLabelText(Tr::tr("P4 client:")); - registerAspect(&p4User); p4User.setDisplayStyle(StringAspect::LineEditDisplay); p4User.setSettingsKey("User"); p4User.setLabelText(Tr::tr("P4 user:")); - registerAspect(&logCount); logCount.setSettingsKey("LogCount"); logCount.setRange(1000, 10000); logCount.setDefaultValue(1000); logCount.setLabelText(Tr::tr("Log count:")); - registerAspect(&customEnv); // The settings value has been stored with the opposite meaning for a while. // Avoid changing the stored value, but flip it on read/write: customEnv.setSettingsKey("Default"); @@ -74,14 +68,12 @@ PerforceSettings::PerforceSettings() customEnv.setFromSettingsTransformation(invertBoolVariant); customEnv.setToSettingsTransformation(invertBoolVariant); - registerAspect(&timeOutS); timeOutS.setSettingsKey("TimeOut"); timeOutS.setRange(1, 360); timeOutS.setDefaultValue(30); timeOutS.setLabelText(Tr::tr("Timeout:")); timeOutS.setSuffix(Tr::tr("s")); - registerAspect(&autoOpen); autoOpen.setSettingsKey("PromptToOpen"); autoOpen.setDefaultValue(true); autoOpen.setLabelText(Tr::tr("Automatically open files when editing")); diff --git a/src/plugins/perforce/perforcesettings.h b/src/plugins/perforce/perforcesettings.h index b632d153256..0801c310907 100644 --- a/src/plugins/perforce/perforcesettings.h +++ b/src/plugins/perforce/perforcesettings.h @@ -68,14 +68,14 @@ public: void clearTopLevel(); - Utils::StringAspect p4BinaryPath; - Utils::StringAspect p4Port; - Utils::StringAspect p4Client; - Utils::StringAspect p4User; - Utils::IntegerAspect logCount; - Utils::BoolAspect customEnv; - Utils::IntegerAspect timeOutS; - Utils::BoolAspect autoOpen; + Utils::StringAspect p4BinaryPath{this}; + Utils::StringAspect p4Port{this}; + Utils::StringAspect p4Client{this}; + Utils::StringAspect p4User{this}; + Utils::IntegerAspect logCount{this}; + Utils::BoolAspect customEnv{this}; + Utils::IntegerAspect timeOutS{this}; + Utils::BoolAspect autoOpen{this}; private: QStringList workingDirectoryArguments(const QString &workingDir) const; diff --git a/src/plugins/subversion/subversionsettings.cpp b/src/plugins/subversion/subversionsettings.cpp index 2a087883d7c..092c4ee1c05 100644 --- a/src/plugins/subversion/subversionsettings.cpp +++ b/src/plugins/subversion/subversionsettings.cpp @@ -32,43 +32,34 @@ SubversionSettings::SubversionSettings() setCategory(VcsBase::Constants::VCS_SETTINGS_CATEGORY); setSettingsGroup("Subversion"); - registerAspect(&binaryPath); binaryPath.setExpectedKind(PathChooser::ExistingCommand); binaryPath.setHistoryCompleter("Subversion.Command.History"); binaryPath.setDefaultValue("svn" QTC_HOST_EXE_SUFFIX); binaryPath.setDisplayName(Tr::tr("Subversion Command")); binaryPath.setLabelText(Tr::tr("Subversion command:")); - registerAspect(&useAuthentication); useAuthentication.setSettingsKey("Authentication"); useAuthentication.setLabelPlacement(BoolAspect::LabelPlacement::AtCheckBox); - registerAspect(&userName); userName.setSettingsKey("User"); userName.setDisplayStyle(StringAspect::LineEditDisplay); userName.setLabelText(Tr::tr("Username:")); - registerAspect(&password); password.setSettingsKey("Password"); password.setDisplayStyle(StringAspect::LineEditDisplay); password.setLabelText(Tr::tr("Password:")); - registerAspect(&spaceIgnorantAnnotation); spaceIgnorantAnnotation.setSettingsKey("SpaceIgnorantAnnotation"); spaceIgnorantAnnotation.setDefaultValue(true); spaceIgnorantAnnotation.setLabelText(Tr::tr("Ignore whitespace changes in annotation")); - registerAspect(&diffIgnoreWhiteSpace); diffIgnoreWhiteSpace.setSettingsKey("DiffIgnoreWhiteSpace"); - registerAspect(&logVerbose); logVerbose.setSettingsKey("LogVerbose"); - registerAspect(&logCount); logCount.setDefaultValue(1000); logCount.setLabelText(Tr::tr("Log count:")); - registerAspect(&timeout); timeout.setLabelText(Tr::tr("Timeout:")); timeout.setSuffix(Tr::tr("s")); diff --git a/src/plugins/subversion/subversionsettings.h b/src/plugins/subversion/subversionsettings.h index 49aaec171b1..c5bcb8e9cf5 100644 --- a/src/plugins/subversion/subversionsettings.h +++ b/src/plugins/subversion/subversionsettings.h @@ -14,11 +14,11 @@ public: bool hasAuthentication() const; - Utils::BoolAspect useAuthentication; - Utils::StringAspect password; - Utils::BoolAspect spaceIgnorantAnnotation; - Utils::BoolAspect diffIgnoreWhiteSpace; - Utils::BoolAspect logVerbose; + Utils::BoolAspect useAuthentication{this}; + Utils::StringAspect password{this}; + Utils::BoolAspect spaceIgnorantAnnotation{this}; + Utils::BoolAspect diffIgnoreWhiteSpace{this}; + Utils::BoolAspect logVerbose{this}; }; SubversionSettings &settings(); diff --git a/src/plugins/vcsbase/commonvcssettings.cpp b/src/plugins/vcsbase/commonvcssettings.cpp index 46c412011e5..e33de123790 100644 --- a/src/plugins/vcsbase/commonvcssettings.cpp +++ b/src/plugins/vcsbase/commonvcssettings.cpp @@ -20,8 +20,7 @@ using namespace Utils; -namespace VcsBase { -namespace Internal { +namespace VcsBase::Internal { // Return default for the ssh-askpass command (default to environment) static QString sshPasswordPromptDefault() @@ -39,7 +38,6 @@ CommonVcsSettings::CommonVcsSettings() setSettingsGroup("VCS"); setAutoApply(false); - registerAspect(&nickNameMailMap); nickNameMailMap.setSettingsKey("NickNameMailMap"); nickNameMailMap.setDisplayStyle(StringAspect::PathChooserDisplay); nickNameMailMap.setExpectedKind(PathChooser::File); @@ -48,7 +46,6 @@ CommonVcsSettings::CommonVcsSettings() nickNameMailMap.setToolTip(Tr::tr("A file listing nicknames in a 4-column mailmap format:\n" "'name alias '.")); - registerAspect(&nickNameFieldListFile); nickNameFieldListFile.setSettingsKey("NickNameFieldListFile"); nickNameFieldListFile.setDisplayStyle(StringAspect::PathChooserDisplay); nickNameFieldListFile.setExpectedKind(PathChooser::File); @@ -57,7 +54,6 @@ CommonVcsSettings::CommonVcsSettings() nickNameFieldListFile.setToolTip(Tr::tr("A simple file containing lines with field names like " "\"Reviewed-By:\" which will be added below the submit editor.")); - registerAspect(&submitMessageCheckScript); submitMessageCheckScript.setSettingsKey("SubmitMessageCheckScript"); submitMessageCheckScript.setDisplayStyle(StringAspect::PathChooserDisplay); submitMessageCheckScript.setExpectedKind(PathChooser::ExistingCommand); @@ -67,7 +63,6 @@ CommonVcsSettings::CommonVcsSettings() "in a temporary file as first argument. It should return with an exit != 0 and a message " "on standard error to indicate failure.")); - registerAspect(&sshPasswordPrompt); sshPasswordPrompt.setSettingsKey("SshPasswordPrompt"); sshPasswordPrompt.setDisplayStyle(StringAspect::PathChooserDisplay); sshPasswordPrompt.setExpectedKind(PathChooser::ExistingCommand); @@ -78,12 +73,10 @@ CommonVcsSettings::CommonVcsSettings() "for a password,\nshould a repository require SSH-authentication " "(see documentation on SSH and the environment variable SSH_ASKPASS).")); - registerAspect(&lineWrap); lineWrap.setSettingsKey("LineWrap"); lineWrap.setDefaultValue(true); lineWrap.setLabelText(Tr::tr("Wrap submit message at:")); - registerAspect(&lineWrapWidth); lineWrapWidth.setSettingsKey("LineWrapWidth"); lineWrapWidth.setSuffix(Tr::tr(" characters")); lineWrapWidth.setDefaultValue(72); @@ -152,5 +145,4 @@ CommonOptionsPage::CommonOptionsPage() setWidgetCreator([this] { return new CommonSettingsWidget(this); }); } -} // namespace Internal -} // namespace VcsBase +} // VcsBase::Internal diff --git a/src/plugins/vcsbase/commonvcssettings.h b/src/plugins/vcsbase/commonvcssettings.h index b1cf09ac14a..44bf03c5776 100644 --- a/src/plugins/vcsbase/commonvcssettings.h +++ b/src/plugins/vcsbase/commonvcssettings.h @@ -7,8 +7,7 @@ #include -namespace VcsBase { -namespace Internal { +namespace VcsBase::Internal { class CommonVcsSettings : public Utils::AspectContainer { @@ -17,16 +16,16 @@ class CommonVcsSettings : public Utils::AspectContainer public: CommonVcsSettings(); - Utils::StringAspect nickNameMailMap; - Utils::StringAspect nickNameFieldListFile; + Utils::StringAspect nickNameMailMap{this}; + Utils::StringAspect nickNameFieldListFile{this}; - Utils::StringAspect submitMessageCheckScript; + Utils::StringAspect submitMessageCheckScript{this}; // Executable run to graphically prompt for a SSH-password. - Utils::StringAspect sshPasswordPrompt; + Utils::StringAspect sshPasswordPrompt{this}; - Utils::BoolAspect lineWrap; - Utils::IntegerAspect lineWrapWidth; + Utils::BoolAspect lineWrap{this}; + Utils::IntegerAspect lineWrapWidth{this}; signals: void settingsChanged(); @@ -43,5 +42,4 @@ private: CommonVcsSettings m_settings; }; -} // namespace Internal -} // namespace VcsBase +} // VcsBase::Internal diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.cpp b/src/plugins/vcsbase/vcsbaseclientsettings.cpp index 7dfd8b3760b..170437864a0 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.cpp +++ b/src/plugins/vcsbase/vcsbaseclientsettings.cpp @@ -6,15 +6,7 @@ #include "vcsbasetr.h" #include -#include -#include #include -#include -#include -#include - -#include -#include using namespace Utils; @@ -22,27 +14,19 @@ namespace VcsBase { VcsBaseSettings::VcsBaseSettings() { - setAutoApply(false); - - registerAspect(&binaryPath); binaryPath.setSettingsKey("BinaryPath"); - registerAspect(&userName); userName.setSettingsKey("Username"); - registerAspect(&userEmail); userEmail.setSettingsKey("UserEmail"); - registerAspect(&logCount); logCount.setSettingsKey("LogCount"); logCount.setRange(0, 1000 * 1000); logCount.setDefaultValue(100); logCount.setLabelText(Tr::tr("Log count:")); - registerAspect(&path); path.setSettingsKey("Path"); - registerAspect(&timeout); timeout.setSettingsKey("Timeout"); timeout.setRange(0, 3600 * 24 * 365); timeout.setDefaultValue(30); diff --git a/src/plugins/vcsbase/vcsbaseclientsettings.h b/src/plugins/vcsbase/vcsbaseclientsettings.h index ec5ad3aab09..6e1f227f218 100644 --- a/src/plugins/vcsbase/vcsbaseclientsettings.h +++ b/src/plugins/vcsbase/vcsbaseclientsettings.h @@ -15,12 +15,12 @@ public: VcsBaseSettings(); ~VcsBaseSettings(); - Utils::FilePathAspect binaryPath; - Utils::StringAspect userName; - Utils::StringAspect userEmail; - Utils::IntegerAspect logCount; - Utils::IntegerAspect timeout; // Seconds - Utils::StringAspect path; + Utils::FilePathAspect binaryPath{this}; + Utils::StringAspect userName{this}; + Utils::StringAspect userEmail{this}; + Utils::IntegerAspect logCount{this}; + Utils::IntegerAspect timeout{this}; // Seconds + Utils::StringAspect path{this}; Utils::FilePaths searchPathList() const; };