2015-07-15 09:16:59 +02:00
|
|
|
/************************************************************************
|
|
|
|
**
|
|
|
|
** @file vtapesettings.cpp
|
|
|
|
** @author Roman Telezhynskyi <dismine(at)gmail.com>
|
|
|
|
** @date 15 7, 2015
|
|
|
|
**
|
|
|
|
** @brief
|
|
|
|
** @copyright
|
2017-10-05 11:20:01 +02:00
|
|
|
** This source code is part of the Valentina project, a pattern making
|
2015-07-15 09:16:59 +02:00
|
|
|
** program, whose allow create and modeling patterns of clothing.
|
|
|
|
** Copyright (C) 2015 Valentina project
|
2020-01-31 07:00:05 +01:00
|
|
|
** <https://gitlab.com/smart-pattern/valentina> All Rights Reserved.
|
2015-07-15 09:16:59 +02:00
|
|
|
**
|
|
|
|
** Valentina is free software: you can redistribute it and/or modify
|
|
|
|
** it under the terms of the GNU General Public License as published by
|
|
|
|
** the Free Software Foundation, either version 3 of the License, or
|
|
|
|
** (at your option) any later version.
|
|
|
|
**
|
|
|
|
** Valentina is distributed in the hope that it will be useful,
|
|
|
|
** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
** GNU General Public License for more details.
|
|
|
|
**
|
|
|
|
** You should have received a copy of the GNU General Public License
|
|
|
|
** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
**
|
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
#include "vtapesettings.h"
|
|
|
|
|
2016-08-08 13:44:49 +02:00
|
|
|
#include <QStaticStringData>
|
|
|
|
#include <QStringData>
|
|
|
|
#include <QStringDataPtr>
|
|
|
|
#include <QVariant>
|
2018-03-14 14:39:15 +01:00
|
|
|
#include <QGlobalStatic>
|
2015-07-18 14:39:33 +02:00
|
|
|
|
2018-03-14 14:39:15 +01:00
|
|
|
namespace
|
|
|
|
{
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingDataBaseGeometry, (QLatin1String("database/geometry"))) // NOLINT
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchHistoryTape, (QLatin1String("searchHistory/tape"))) // NOLINT
|
2021-11-22 14:24:48 +01:00
|
|
|
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsTapeUseUnicodeProperties, // NOLINT
|
2021-11-22 14:24:48 +01:00
|
|
|
(QLatin1String("searchOptions/tapeUseUnicodeProperties")))
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsTapeWholeWord, // NOLINT
|
2021-11-22 14:24:48 +01:00
|
|
|
(QLatin1String("searchOptions/tapeWholeWord")))
|
2022-08-12 17:50:13 +02:00
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsTapeRegexp, (QLatin1String("searchOptions/tapeRegexp"))) // NOLINT
|
|
|
|
Q_GLOBAL_STATIC_WITH_ARGS(const QString, settingSearchOptionsTapeMatchCase, // NOLINT
|
2021-11-22 14:24:48 +01:00
|
|
|
(QLatin1String("searchOptions/tapeMatchCase")))
|
|
|
|
} // namespace
|
2015-12-12 12:11:39 +01:00
|
|
|
|
2015-07-15 09:16:59 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
VTapeSettings::VTapeSettings(Format format, Scope scope, const QString &organization, const QString &application,
|
|
|
|
QObject *parent)
|
|
|
|
:VCommonSettings(format, scope, organization, application, parent)
|
|
|
|
{
|
|
|
|
}
|
2015-07-18 14:39:33 +02:00
|
|
|
|
2015-08-01 19:09:10 +02:00
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
2022-08-12 17:50:13 +02:00
|
|
|
auto VTapeSettings::GetDataBaseGeometry() const -> QByteArray
|
2015-08-01 19:09:10 +02:00
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
return value(*settingDataBaseGeometry).toByteArray();
|
2015-08-01 19:09:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetDataBaseGeometry(const QByteArray &value)
|
|
|
|
{
|
2018-03-14 14:39:15 +01:00
|
|
|
setValue(*settingDataBaseGeometry, value);
|
2015-08-01 19:09:10 +02:00
|
|
|
}
|
2021-11-22 14:24:48 +01:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
auto VTapeSettings::GetTapeSearchHistory() const -> QStringList
|
|
|
|
{
|
|
|
|
return value(*settingSearchHistoryTape).toStringList();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetTapeSearchHistory(const QStringList &history)
|
|
|
|
{
|
|
|
|
setValue(*settingSearchHistoryTape, history);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
auto VTapeSettings::GetTapeSearchOptionUseUnicodeProperties() const -> bool
|
|
|
|
{
|
|
|
|
return value(*settingSearchOptionsTapeUseUnicodeProperties, false).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetTapeSearchOptionUseUnicodeProperties(bool value)
|
|
|
|
{
|
|
|
|
setValue(*settingSearchOptionsTapeUseUnicodeProperties, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
auto VTapeSettings::GetTapeSearchOptionWholeWord() const -> bool
|
|
|
|
{
|
|
|
|
return value(*settingSearchOptionsTapeWholeWord, false).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetTapeSearchOptionWholeWord(bool value)
|
|
|
|
{
|
|
|
|
setValue(*settingSearchOptionsTapeWholeWord, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
auto VTapeSettings::GetTapeSearchOptionRegexp() const -> bool
|
|
|
|
{
|
|
|
|
return value(*settingSearchOptionsTapeRegexp, false).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetTapeSearchOptionRegexp(bool value)
|
|
|
|
{
|
|
|
|
setValue(*settingSearchOptionsTapeRegexp, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
auto VTapeSettings::GetTapeSearchOptionMatchCase() const -> bool
|
|
|
|
{
|
|
|
|
return value(*settingSearchOptionsTapeMatchCase, false).toBool();
|
|
|
|
}
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------
|
|
|
|
void VTapeSettings::SetTapeSearchOptionMatchCase(bool value)
|
|
|
|
{
|
|
|
|
setValue(*settingSearchOptionsTapeMatchCase, value);
|
|
|
|
}
|