mirror of https://github.com/cutefishos/calamares
Merge branch 'master' into issue-1287
commit
8c4b6e4804
@ -0,0 +1,24 @@
|
||||
|
||||
Copyright 2019 Adriaan de Groot <groot@kde.org>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
* Calamares 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.
|
||||
*
|
||||
* Calamares 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 Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* License-Filename: LICENSE
|
||||
*/
|
||||
|
||||
#include "GeoIPFixed.h"
|
||||
|
||||
namespace CalamaresUtils
|
||||
{
|
||||
namespace GeoIP
|
||||
{
|
||||
|
||||
GeoIPFixed::GeoIPFixed( const QString& attribute )
|
||||
: Interface( attribute.isEmpty() ? QStringLiteral( "Europe/Amsterdam" ) : attribute )
|
||||
{
|
||||
}
|
||||
|
||||
QString
|
||||
GeoIPFixed::rawReply( const QByteArray& )
|
||||
{
|
||||
return m_element;
|
||||
}
|
||||
|
||||
GeoIP::RegionZonePair
|
||||
GeoIPFixed::processReply( const QByteArray& data )
|
||||
{
|
||||
return splitTZString( rawReply( data ) );
|
||||
}
|
||||
|
||||
} // namespace GeoIP
|
||||
} // namespace CalamaresUtils
|
@ -0,0 +1,55 @@
|
||||
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
||||
*
|
||||
* SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||
*
|
||||
* Calamares 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.
|
||||
*
|
||||
* Calamares 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 Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
* License-Filename: LICENSE
|
||||
*/
|
||||
|
||||
#ifndef GEOIP_GEOIPFIXED_H
|
||||
#define GEOIP_GEOIPFIXED_H
|
||||
|
||||
#include "Interface.h"
|
||||
|
||||
namespace CalamaresUtils
|
||||
{
|
||||
namespace GeoIP
|
||||
{
|
||||
/** @brief GeoIP with a fixed return value
|
||||
*
|
||||
* The data is ignored entirely and the attribute value is returned unchanged.
|
||||
* Note that you still need to provide a usable URL for a successful GeoIP
|
||||
* lookup -- the URL's data is just ignored.
|
||||
*
|
||||
* @note This class is an implementation detail.
|
||||
*/
|
||||
class GeoIPFixed : public Interface
|
||||
{
|
||||
public:
|
||||
/** @brief Configure the value to return from rawReply()
|
||||
*
|
||||
* An empty string, which would not be a valid zone name, is
|
||||
* translated to "Europe/Amsterdam".
|
||||
*/
|
||||
explicit GeoIPFixed( const QString& value = QString() );
|
||||
|
||||
virtual RegionZonePair processReply( const QByteArray& ) override;
|
||||
virtual QString rawReply( const QByteArray& ) override;
|
||||
};
|
||||
|
||||
} // namespace GeoIP
|
||||
} // namespace CalamaresUtils
|
||||
#endif
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue