2016-01-15 14:57:40 +01:00
|
|
|
/****************************************************************************
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 Brian McGillion and Hugues Delorme
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2011-02-28 13:40:04 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
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(&promptOnSubmit);
|
|
|
|
|
promptOnSubmit.setSettingsKey("PromptOnSubmit");
|
|
|
|
|
promptOnSubmit.setDefaultValue(true);
|
|
|
|
|
promptOnSubmit.setLabelText(tr("Prompt on submit"));
|
|
|
|
|
|
|
|
|
|
registerAspect(&timeout);
|
|
|
|
|
timeout.setSettingsKey("Timeout");
|
|
|
|
|
timeout.setRange(0, 3600 * 24 * 365);
|
|
|
|
|
timeout.setDefaultValue(30);
|
|
|
|
|
timeout.setLabelText(tr("Timeout:"));
|
|
|
|
|
timeout.setSuffix(tr("s"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStringList VcsBaseSettings::searchPathList() const
|
|
|
|
|
{
|
|
|
|
|
return path.value().split(HostOsInfo::pathListSeparator(), Qt::SkipEmptyParts);
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-07 12:31:48 +01:00
|
|
|
} // namespace VcsBase
|