2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2016 Brian McGillion and Hugues Delorme
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
2011-02-28 13:40:04 +01:00
|
|
|
|
|
|
|
|
#include "vcsbaseclientsettings.h"
|
|
|
|
|
|
2017-09-20 12:53:30 +02:00
|
|
|
#include <utils/algorithm.h>
|
2012-08-21 14:45:42 +03:00
|
|
|
#include <utils/environment.h>
|
2014-07-15 23:32:11 +03:00
|
|
|
#include <utils/fileutils.h>
|
2012-09-27 20:38:57 +02:00
|
|
|
#include <utils/hostosinfo.h>
|
2013-10-11 15:26:15 +02:00
|
|
|
#include <utils/qtcassert.h>
|
2021-02-16 14:51:16 +01:00
|
|
|
#include <utils/qtcsettings.h>
|
2020-06-17 06:35:31 +02:00
|
|
|
#include <utils/stringutils.h>
|
2012-08-21 14:45:42 +03:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QSettings>
|
2013-03-25 11:36:51 +01:00
|
|
|
#include <QVariant>
|
2011-02-28 13:40:04 +01:00
|
|
|
|
2018-07-17 22:54:58 +03:00
|
|
|
using namespace Utils;
|
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
namespace VcsBase {
|
2011-09-14 09:13:44 +00:00
|
|
|
|
2021-03-16 06:00:25 +01:00
|
|
|
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("Log count:"));
|
|
|
|
|
|
|
|
|
|
registerAspect(&path);
|
|
|
|
|
path.setSettingsKey("Path");
|
|
|
|
|
|
|
|
|
|
registerAspect(&timeout);
|
|
|
|
|
timeout.setSettingsKey("Timeout");
|
|
|
|
|
timeout.setRange(0, 3600 * 24 * 365);
|
|
|
|
|
timeout.setDefaultValue(30);
|
|
|
|
|
timeout.setLabelText(tr("Timeout:"));
|
|
|
|
|
timeout.setSuffix(tr("s"));
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-22 13:05:45 +02:00
|
|
|
VcsBaseSettings::~VcsBaseSettings() = default;
|
|
|
|
|
|
2021-11-10 16:28:53 +01:00
|
|
|
FilePaths VcsBaseSettings::searchPathList() const
|
2021-03-16 06:00:25 +01:00
|
|
|
{
|
2021-11-10 16:28:53 +01:00
|
|
|
return Utils::transform(path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts),
|
|
|
|
|
&FilePath::fromUserInput);
|
2021-03-16 06:00:25 +01:00
|
|
|
}
|
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
} // namespace VcsBase
|