aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/fossil/fossilsettings.h
blob: 8e56b1985cca8e4ce9a25bda198ea13d9ea6f5f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2018 Artur Shepilko
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#pragma once

#include <vcsbase/vcsbaseclientsettings.h>

namespace Fossil::Internal {

class FossilSettings : public VcsBase::VcsBaseSettings
{
public:
    FossilSettings();

    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();

struct RepositorySettings
{
    enum AutosyncMode {AutosyncOff, AutosyncOn, AutosyncPullOnly};

    QString user;
    QString sslIdentityFile;
    AutosyncMode autosync = AutosyncOn;

    friend bool operator==(const RepositorySettings &lh, const RepositorySettings &rh)
    {
        return lh.user == rh.user
            && lh.sslIdentityFile == rh.sslIdentityFile
            && lh.autosync == rh.autosync;
    }
};

} // Fossil::Internal