2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
2022-12-21 10:12:09 +01:00
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2017-11-15 14:14:38 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2017-11-15 16:19:16 +01:00
|
|
|
#include <utils/settingsaccessor.h>
|
2017-11-15 14:14:38 +01:00
|
|
|
|
|
|
|
|
#include <QHash>
|
|
|
|
|
|
|
|
|
|
namespace ProjectExplorer {
|
|
|
|
|
|
|
|
|
|
class Project;
|
|
|
|
|
|
|
|
|
|
namespace Internal {
|
2017-12-12 17:38:23 +01:00
|
|
|
|
|
|
|
|
class UserFileAccessor : public Utils::MergingSettingsAccessor
|
2017-11-15 14:14:38 +01:00
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
UserFileAccessor(Project *project);
|
|
|
|
|
|
|
|
|
|
Project *project() const;
|
|
|
|
|
|
2017-12-12 12:23:03 +01:00
|
|
|
virtual QVariant retrieveSharedSettings() const;
|
|
|
|
|
|
2019-05-28 13:49:26 +02:00
|
|
|
Utils::FilePath projectUserFile() const;
|
|
|
|
|
Utils::FilePath externalUserFile() const;
|
|
|
|
|
Utils::FilePath sharedFile() const;
|
2017-12-12 17:38:23 +01:00
|
|
|
|
2017-11-15 14:14:38 +01:00
|
|
|
protected:
|
2023-08-24 12:41:45 +02:00
|
|
|
Utils::Store postprocessMerge(const Utils::Store &main,
|
|
|
|
|
const Utils::Store &secondary,
|
|
|
|
|
const Utils::Store &result) const final;
|
2017-12-12 17:38:23 +01:00
|
|
|
|
2023-08-24 12:41:45 +02:00
|
|
|
Utils::Store preprocessReadSettings(const Utils::Store &data) const final;
|
|
|
|
|
Utils::Store prepareToWriteSettings(const Utils::Store &data) const final;
|
2017-11-15 14:14:38 +01:00
|
|
|
|
2017-12-12 17:38:23 +01:00
|
|
|
Utils::SettingsMergeResult merge(const SettingsMergeData &global,
|
|
|
|
|
const SettingsMergeData &local) const final;
|
2017-11-15 14:14:38 +01:00
|
|
|
private:
|
2023-08-24 16:14:26 +02:00
|
|
|
Utils::SettingsMergeFunction userStickyTrackerFunction(Utils::KeyList &stickyKeys) const;
|
2017-12-12 17:38:23 +01:00
|
|
|
|
2017-11-15 14:14:38 +01:00
|
|
|
Project *m_project;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace ProjectExplorer
|