Initial upload of HyprArch releng configuration
This commit is contained in:
30
airootfs/usr/include/libcalamares/compat/CheckBox.h
Normal file
30
airootfs/usr/include/libcalamares/compat/CheckBox.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef CALAMARES_COMPAT_XML_H
|
||||
#define CALAMARES_COMPAT_XML_H
|
||||
|
||||
#include <QCheckBox>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 7, 0 )
|
||||
using checkBoxStateType = int;
|
||||
const auto checkBoxStateChangedSignal = &QCheckBox::stateChanged;
|
||||
constexpr checkBoxStateType checkBoxUncheckedValue = 0;
|
||||
#else
|
||||
using checkBoxStateType = Qt::CheckState;
|
||||
const auto checkBoxStateChangedSignal = &QCheckBox::checkStateChanged;
|
||||
constexpr checkBoxStateType checkBoxUncheckedValue = Qt::Unchecked;
|
||||
#endif
|
||||
|
||||
} // namespace Calamares
|
||||
|
||||
#endif
|
||||
30
airootfs/usr/include/libcalamares/compat/Mutex.h
Normal file
30
airootfs/usr/include/libcalamares/compat/Mutex.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2023 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef CALAMARES_COMPAT_MUTEX_H
|
||||
#define CALAMARES_COMPAT_MUTEX_H
|
||||
|
||||
#include <QMutexLocker>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
|
||||
/*
|
||||
* In Qt5, QMutexLocker is a class and operates implicitly on
|
||||
* QMutex but in Qt6 it is a template and needs a specialization.
|
||||
*/
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||
using MutexLocker = QMutexLocker;
|
||||
#else
|
||||
using MutexLocker = QMutexLocker< QMutex >;
|
||||
#endif
|
||||
|
||||
} // namespace Calamares
|
||||
|
||||
#endif
|
||||
23
airootfs/usr/include/libcalamares/compat/Size.h
Normal file
23
airootfs/usr/include/libcalamares/compat/Size.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef CALAMARES_COMPAT_SIZE_H
|
||||
#define CALAMARES_COMPAT_SIZE_H
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
/* Compatibility of size types (e.g. qsizetype, STL sizes, int) between Qt5 and Qt6 */
|
||||
|
||||
using NumberForTr = int;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
57
airootfs/usr/include/libcalamares/compat/Variant.h
Normal file
57
airootfs/usr/include/libcalamares/compat/Variant.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2023 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef CALAMARES_COMPAT_VARIANT_H
|
||||
#define CALAMARES_COMPAT_VARIANT_H
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
/* Compatibility of QVariant between Qt5 and Qt6 */
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||
const auto typeOf = []( const QVariant& v ) { return v.type(); };
|
||||
const auto ListVariantType = QVariant::List;
|
||||
const auto MapVariantType = QVariant::Map;
|
||||
const auto HashVariantType = QVariant::Hash;
|
||||
const auto StringVariantType = QVariant::String;
|
||||
const auto CharVariantType = QVariant::Char;
|
||||
const auto StringListVariantType = QVariant::StringList;
|
||||
const auto BoolVariantType = QVariant::Bool;
|
||||
const auto IntVariantType = QVariant::Int;
|
||||
const auto UIntVariantType = QVariant::UInt;
|
||||
const auto LongLongVariantType = QVariant::LongLong;
|
||||
const auto ULongLongVariantType = QVariant::ULongLong;
|
||||
const auto DoubleVariantType = QVariant::Double;
|
||||
#else
|
||||
const auto typeOf = []( const QVariant& v ) { return v.typeId(); };
|
||||
const auto ListVariantType = QMetaType::Type::QVariantList;
|
||||
const auto MapVariantType = QMetaType::Type::QVariantMap;
|
||||
const auto HashVariantType = QMetaType::Type::QVariantHash;
|
||||
const auto StringVariantType = QMetaType::Type::QString;
|
||||
const auto CharVariantType = QMetaType::Type::Char;
|
||||
const auto StringListVariantType = QMetaType::Type::QStringList;
|
||||
const auto BoolVariantType = QMetaType::Type::Bool;
|
||||
const auto IntVariantType = QMetaType::Type::Int;
|
||||
const auto UIntVariantType = QMetaType::Type::UInt;
|
||||
const auto LongLongVariantType = QMetaType::Type::LongLong;
|
||||
const auto ULongLongVariantType = QMetaType::Type::ULongLong;
|
||||
const auto DoubleVariantType = QMetaType::Type::Double;
|
||||
#endif
|
||||
|
||||
inline bool
|
||||
isIntegerVariantType( const QVariant& v )
|
||||
{
|
||||
const auto t = typeOf( v );
|
||||
return t == IntVariantType || t == UIntVariantType || t == LongLongVariantType || t == ULongLongVariantType;
|
||||
}
|
||||
|
||||
} // namespace Calamares
|
||||
|
||||
#endif
|
||||
42
airootfs/usr/include/libcalamares/compat/Xml.h
Normal file
42
airootfs/usr/include/libcalamares/compat/Xml.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2024 Adriaan de Groot <groot@kde.org>
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* Calamares is Free Software: see the License-Identifier above.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef CALAMARES_COMPAT_XML_H
|
||||
#define CALAMARES_COMPAT_XML_H
|
||||
|
||||
#include <QDomDocument>
|
||||
|
||||
namespace Calamares
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK( 6, 6, 0 )
|
||||
struct ParseResult
|
||||
{
|
||||
QString errorMessage;
|
||||
int errorLine = -1;
|
||||
int errorColumn = -1;
|
||||
};
|
||||
|
||||
[[nodiscard]] inline ParseResult
|
||||
setXmlContent( QDomDocument& doc, const QByteArray& ba )
|
||||
{
|
||||
ParseResult p;
|
||||
const bool r = doc.setContent( ba, &p.errorMessage, &p.errorLine, &p.errorColumn );
|
||||
return r ? ParseResult {} : p;
|
||||
}
|
||||
#else
|
||||
[[nodiscard]] inline QDomDocument::ParseResult
|
||||
setXmlContent( QDomDocument& doc, const QByteArray& ba )
|
||||
{
|
||||
return doc.setContent( ba );
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace Calamares
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user