From a9547536d8e3be37e2cf98d03a46879befcb2401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20M=C3=BCller?= Date: Sun, 17 Sep 2023 10:44:14 +0200 Subject: [PATCH] 3rdparty: remove unused libmygpo-qt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The -qt5 library is still there, and seems to be used. Signed-off-by: Marcus Müller --- 3rdparty/libmygpo-qt/qjsonwrapper/Json.cpp | 128 --------------------- 3rdparty/libmygpo-qt/qjsonwrapper/Json.h | 36 ------ 2 files changed, 164 deletions(-) delete mode 100644 3rdparty/libmygpo-qt/qjsonwrapper/Json.cpp delete mode 100644 3rdparty/libmygpo-qt/qjsonwrapper/Json.h diff --git a/3rdparty/libmygpo-qt/qjsonwrapper/Json.cpp b/3rdparty/libmygpo-qt/qjsonwrapper/Json.cpp deleted file mode 100644 index 1b4a79065..000000000 --- a/3rdparty/libmygpo-qt/qjsonwrapper/Json.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright 2014, Uwe L. Korn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "Json.h" - -// Qt version specific includes -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - #include - #include -#else - #include - #include - #include -#endif - -namespace QJsonWrapper -{ - -QVariantMap -qobject2qvariant( const QObject* object ) -{ -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - QVariantMap map; - if ( object == NULL ) - { - return map; - } - - const QMetaObject* metaObject = object->metaObject(); - for ( int i = 0; i < metaObject->propertyCount(); ++i ) - { - QMetaProperty metaproperty = metaObject->property( i ); - if ( metaproperty.isReadable() ) - { - map[ QLatin1String( metaproperty.name() ) ] = object->property( metaproperty.name() ); - } - } - return map; -#else - return QJson::QObjectHelper::qobject2qvariant( object ); -#endif -} - - -void -qvariant2qobject( const QVariantMap& variant, QObject* object ) -{ -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - for ( QVariantMap::const_iterator iter = variant.begin(); iter != variant.end(); ++iter ) - { - QVariant property = object->property( iter.key().toLatin1() ); - Q_ASSERT( property.isValid() ); - if ( property.isValid() ) - { - QVariant value = iter.value(); - if ( value.canConvert( property.type() ) ) - { - value.convert( property.type() ); - object->setProperty( iter.key().toLatin1(), value ); - } else if ( QString( QLatin1String("QVariant") ).compare( QLatin1String( property.typeName() ) ) == 0 ) { - object->setProperty( iter.key().toLatin1(), value ); - } - } - } -#else - QJson::QObjectHelper::qvariant2qobject( variant, object ); -#endif -} - - -QVariant -parseJson( const QByteArray& jsonData, bool* ok ) -{ -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - QJsonParseError error; - QJsonDocument doc = QJsonDocument::fromJson( jsonData, &error ); - if ( ok != NULL ) - { - *ok = ( error.error == QJsonParseError::NoError ); - } - return doc.toVariant(); -#else - QJson::Parser p; - return p.parse( jsonData, ok ); -#endif -} - - -QByteArray -toJson( const QVariant &variant, bool* ok ) -{ -#if QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) - QJsonDocument doc = QJsonDocument::fromVariant( variant ); - if ( ok != NULL ) - { - *ok = !doc.isNull(); - } - return doc.toJson( QJsonDocument::Compact ); -#else - QJson::Serializer serializer; - QByteArray ret = serializer.serialize(variant); - if ( ok != NULL ) - { - *ok = !ret.isNull(); - } - return ret; -#endif -} - -} diff --git a/3rdparty/libmygpo-qt/qjsonwrapper/Json.h b/3rdparty/libmygpo-qt/qjsonwrapper/Json.h deleted file mode 100644 index 36d53a0f9..000000000 --- a/3rdparty/libmygpo-qt/qjsonwrapper/Json.h +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2014, Uwe L. Korn - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#pragma once -#ifndef QJSONWRAPPER_JSON_H -#define QJSONWRAPPER_JSON_H - -#include - -namespace QJsonWrapper -{ - QVariantMap qobject2qvariant( const QObject* object ); - void qvariant2qobject( const QVariantMap& variant, QObject* object ); - QVariant parseJson( const QByteArray& jsonData, bool* ok = 0 ); - QByteArray toJson( const QVariant &variant, bool* ok = 0 ); -} - -#endif // QJSONWRAPPER_JSON_H