mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
Merge branch 'reduce-warnings'
This commit is contained in:
commit
fd5097c466
52 changed files with 124 additions and 96 deletions
|
@ -208,6 +208,8 @@ if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
set( CMAKE_TOOLCHAIN_PREFIX "llvm-" )
|
set( CMAKE_TOOLCHAIN_PREFIX "llvm-" )
|
||||||
|
|
||||||
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
|
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
|
||||||
|
|
||||||
|
set( CALAMARES_AUTOMOC_OPTIONS "-butils/moc-warnings.h" )
|
||||||
else()
|
else()
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" )
|
||||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" )
|
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--fatal-warnings -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type" )
|
||||||
|
@ -509,6 +511,7 @@ install(
|
||||||
"CMakeModules/CalamaresAddLibrary.cmake"
|
"CMakeModules/CalamaresAddLibrary.cmake"
|
||||||
"CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
|
"CMakeModules/CalamaresAddBrandingSubdirectory.cmake"
|
||||||
"CMakeModules/CalamaresAddTranslations.cmake"
|
"CMakeModules/CalamaresAddTranslations.cmake"
|
||||||
|
"CMakeModules/CalamaresAutomoc.cmake"
|
||||||
"CMakeModules/CMakeColors.cmake"
|
"CMakeModules/CMakeColors.cmake"
|
||||||
DESTINATION
|
DESTINATION
|
||||||
"${CMAKE_INSTALL_CMAKEDIR}"
|
"${CMAKE_INSTALL_CMAKEDIR}"
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
# flag (i.e. `-D`) so only state the name (optionally, also the value)
|
# flag (i.e. `-D`) so only state the name (optionally, also the value)
|
||||||
# without a `-D` prefixed to it. Pass in a CMake list as needed.
|
# without a `-D` prefixed to it. Pass in a CMake list as needed.
|
||||||
include( CMakeParseArguments )
|
include( CMakeParseArguments )
|
||||||
|
include( CalamaresAutomoc )
|
||||||
|
|
||||||
function(calamares_add_library)
|
function(calamares_add_library)
|
||||||
# parse arguments (name needs to be saved before passing ARGN into the macro)
|
# parse arguments (name needs to be saved before passing ARGN into the macro)
|
||||||
|
@ -81,9 +82,7 @@ function(calamares_add_library)
|
||||||
add_library(${target} SHARED ${LIBRARY_SOURCES})
|
add_library(${target} SHARED ${LIBRARY_SOURCES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# definitions - can this be moved into set_target_properties below?
|
calamares_automoc(${target})
|
||||||
add_definitions(${QT_DEFINITIONS})
|
|
||||||
set_target_properties(${target} PROPERTIES AUTOMOC TRUE)
|
|
||||||
|
|
||||||
if(LIBRARY_EXPORT_MACRO)
|
if(LIBRARY_EXPORT_MACRO)
|
||||||
set_target_properties(${target} PROPERTIES COMPILE_DEFINITIONS ${LIBRARY_EXPORT_MACRO})
|
set_target_properties(${target} PROPERTIES COMPILE_DEFINITIONS ${LIBRARY_EXPORT_MACRO})
|
||||||
|
|
36
CMakeModules/CalamaresAutomoc.cmake
Normal file
36
CMakeModules/CalamaresAutomoc.cmake
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
#
|
||||||
|
# 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+
|
||||||
|
# License-Filename: LICENSE
|
||||||
|
#
|
||||||
|
###
|
||||||
|
#
|
||||||
|
# Helper function for doing automoc on a target.
|
||||||
|
#
|
||||||
|
# Sets AUTOMOC TRUE for a target.
|
||||||
|
#
|
||||||
|
# If the global variable CALAMARES_AUTOMOC_OPTIONS is set, uses that
|
||||||
|
# as well to set options passed to MOC. This can be used to add
|
||||||
|
# libcalamares/utils/moc-warnings.h file to the moc, which in turn
|
||||||
|
# reduces compiler warnings in generated MOC code.
|
||||||
|
#
|
||||||
|
|
||||||
|
function(calamares_automoc TARGET)
|
||||||
|
set_target_properties( ${TARGET} PROPERTIES AUTOMOC TRUE )
|
||||||
|
if ( CALAMARES_AUTOMOC_OPTIONS )
|
||||||
|
set_target_properties( ${TARGET} PROPERTIES AUTOMOC_MOC_OPTIONS "${CALAMARES_AUTOMOC_OPTIONS}" )
|
||||||
|
endif()
|
||||||
|
endfunction()
|
|
@ -38,10 +38,10 @@ set( final_src ${calamaresSources} ${calamaresRc} ${trans_outfile} )
|
||||||
add_executable( calamares_bin ${final_src} )
|
add_executable( calamares_bin ${final_src} )
|
||||||
set_target_properties(calamares_bin
|
set_target_properties(calamares_bin
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
AUTOMOC TRUE
|
|
||||||
ENABLE_EXPORTS TRUE
|
ENABLE_EXPORTS TRUE
|
||||||
RUNTIME_OUTPUT_NAME calamares
|
RUNTIME_OUTPUT_NAME calamares
|
||||||
)
|
)
|
||||||
|
calamares_automoc( calamares_bin )
|
||||||
|
|
||||||
if( WITH_KF5Crash )
|
if( WITH_KF5Crash )
|
||||||
set( LINK_LIBRARIES
|
set( LINK_LIBRARIES
|
||||||
|
|
|
@ -84,9 +84,7 @@ ProgressTreeRoot::ProgressTreeRoot()
|
||||||
|
|
||||||
|
|
||||||
QVariant
|
QVariant
|
||||||
ProgressTreeRoot::data( int role ) const
|
ProgressTreeRoot::data( int ) const
|
||||||
{
|
{
|
||||||
if ( role == ProgressTreeModel::ProgressTreeItemRole )
|
|
||||||
return this;
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,9 +98,9 @@ ProgressTreeModel::data( const QModelIndex& index, int role ) const
|
||||||
QVariant
|
QVariant
|
||||||
ProgressTreeModel::headerData( int section, Qt::Orientation orientation, int role ) const
|
ProgressTreeModel::headerData( int section, Qt::Orientation orientation, int role ) const
|
||||||
{
|
{
|
||||||
Q_UNUSED( section );
|
Q_UNUSED( section )
|
||||||
Q_UNUSED( orientation );
|
Q_UNUSED( orientation )
|
||||||
Q_UNUSED( role );
|
Q_UNUSED( role )
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ class ProgressTreeModel : public QAbstractItemModel
|
||||||
public:
|
public:
|
||||||
enum Role
|
enum Role
|
||||||
{
|
{
|
||||||
ProgressTreeItemRole = Qt::UserRole + 10,
|
|
||||||
ProgressTreeItemCurrentRole = Qt::UserRole + 11
|
ProgressTreeItemCurrentRole = Qt::UserRole + 11
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -46,15 +46,13 @@ void
|
||||||
ViewStepItem::appendChild( ProgressTreeItem* item )
|
ViewStepItem::appendChild( ProgressTreeItem* item )
|
||||||
{
|
{
|
||||||
Q_ASSERT( false );
|
Q_ASSERT( false );
|
||||||
Q_UNUSED( item );
|
Q_UNUSED( item )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant
|
QVariant
|
||||||
ViewStepItem::data( int role ) const
|
ViewStepItem::data( int role ) const
|
||||||
{
|
{
|
||||||
if ( role == ProgressTreeModel::ProgressTreeItemRole )
|
|
||||||
return this;
|
|
||||||
if ( role == Qt::DisplayRole )
|
if ( role == Qt::DisplayRole )
|
||||||
{
|
{
|
||||||
return m_step ? m_step->prettyName()
|
return m_step ? m_step->prettyName()
|
||||||
|
|
|
@ -84,10 +84,10 @@ endif()
|
||||||
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
|
add_library( calamares SHARED ${libSources} ${kdsagSources} ${utilsSources} )
|
||||||
set_target_properties( calamares
|
set_target_properties( calamares
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
AUTOMOC TRUE
|
|
||||||
VERSION ${CALAMARES_VERSION_SHORT}
|
VERSION ${CALAMARES_VERSION_SHORT}
|
||||||
SOVERSION ${CALAMARES_VERSION_SHORT}
|
SOVERSION ${CALAMARES_VERSION_SHORT}
|
||||||
)
|
)
|
||||||
|
calamares_automoc( calamares )
|
||||||
|
|
||||||
target_link_libraries( calamares
|
target_link_libraries( calamares
|
||||||
LINK_PRIVATE
|
LINK_PRIVATE
|
||||||
|
@ -114,7 +114,7 @@ if ( ECM_FOUND AND BUILD_TESTING )
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
)
|
)
|
||||||
set_target_properties( libcalamarestest PROPERTIES AUTOMOC TRUE )
|
calamares_automoc( libcalamarestest )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so
|
# Make symlink lib/calamares/libcalamares.so to lib/libcalamares.so.VERSION so
|
||||||
|
|
|
@ -41,7 +41,7 @@ CppJob::setModuleInstanceKey( const QString& instanceKey )
|
||||||
void
|
void
|
||||||
CppJob::setConfigurationMap( const QVariantMap& configurationMap )
|
CppJob::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{
|
{
|
||||||
Q_UNUSED( configurationMap );
|
Q_UNUSED( configurationMap )
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ namespace Calamares
|
||||||
|
|
||||||
class JobThread : public QThread
|
class JobThread : public QThread
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
JobThread( JobQueue* queue )
|
JobThread( JobQueue* queue )
|
||||||
: QThread( queue )
|
: QThread( queue )
|
||||||
|
@ -44,6 +43,8 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual ~JobThread() override;
|
||||||
|
|
||||||
void setJobs( const JobList& jobs )
|
void setJobs( const JobList& jobs )
|
||||||
{
|
{
|
||||||
m_jobs = jobs;
|
m_jobs = jobs;
|
||||||
|
@ -122,6 +123,10 @@ private:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
JobThread::~JobThread()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JobQueue* JobQueue::s_instance = nullptr;
|
JobQueue* JobQueue::s_instance = nullptr;
|
||||||
|
|
||||||
|
@ -184,5 +189,3 @@ JobQueue::enqueue( const JobList& jobs )
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Calamares
|
} // namespace Calamares
|
||||||
|
|
||||||
#include "JobQueue.moc"
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ BOOST_PYTHON_MODULE( libcalamares )
|
||||||
bp::object utilsModule( bp::handle<>( bp::borrowed( PyImport_AddModule( "libcalamares.utils" ) ) ) );
|
bp::object utilsModule( bp::handle<>( bp::borrowed( PyImport_AddModule( "libcalamares.utils" ) ) ) );
|
||||||
bp::scope().attr( "utils" ) = utilsModule;
|
bp::scope().attr( "utils" ) = utilsModule;
|
||||||
bp::scope utilsScope = utilsModule;
|
bp::scope utilsScope = utilsModule;
|
||||||
Q_UNUSED( utilsScope );
|
Q_UNUSED( utilsScope )
|
||||||
|
|
||||||
bp::def(
|
bp::def(
|
||||||
"debug",
|
"debug",
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
hasValue( const YAML::Node& v )
|
hasValue( const YAML::Node& v )
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
explicit KDSingleApplicationGuard( QObject * parent=nullptr );
|
explicit KDSingleApplicationGuard( QObject * parent=nullptr );
|
||||||
explicit KDSingleApplicationGuard( Policy policy, QObject * parent=nullptr );
|
explicit KDSingleApplicationGuard( Policy policy, QObject * parent=nullptr );
|
||||||
explicit KDSingleApplicationGuard( const QStringList & arguments, QObject * parent=nullptr );
|
explicit KDSingleApplicationGuard( const QStringList & arguments, QObject * parent=nullptr );
|
||||||
explicit KDSingleApplicationGuard( const QStringList & arguments, Policy policy, QObject * parent=0 );
|
explicit KDSingleApplicationGuard( const QStringList & arguments, Policy policy, QObject * parent=nullptr );
|
||||||
~KDSingleApplicationGuard();
|
~KDSingleApplicationGuard();
|
||||||
|
|
||||||
bool isOperational() const;
|
bool isOperational() const;
|
||||||
|
|
|
@ -27,7 +27,7 @@ static Version kdParseQtVersion( const char * const version ) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _kdCheckQtVersion_impl( int major, int minor, int patchlevel ) {
|
bool _kdCheckQtVersion_impl( unsigned int major, unsigned int minor, unsigned int patchlevel ) {
|
||||||
static const Version actual = kdParseQtVersion( qVersion() ); // do this only once each run...
|
static const Version actual = kdParseQtVersion( qVersion() ); // do this only once each run...
|
||||||
const Version requested = { { static_cast< unsigned char >( major ),
|
const Version requested = { { static_cast< unsigned char >( major ),
|
||||||
static_cast< unsigned char >( minor ),
|
static_cast< unsigned char >( minor ),
|
||||||
|
|
|
@ -78,7 +78,7 @@ inline T & __kdtools__dereference_for_methodcall( T * o ) {
|
||||||
|
|
||||||
#define KDAB_SET_OBJECT_NAME( x ) __kdtools__dereference_for_methodcall( x ).setObjectName( QLatin1String( #x ) )
|
#define KDAB_SET_OBJECT_NAME( x ) __kdtools__dereference_for_methodcall( x ).setObjectName( QLatin1String( #x ) )
|
||||||
|
|
||||||
KDTOOLSCORE_EXPORT bool _kdCheckQtVersion_impl( int major, int minor=0, int patchlevel=0 );
|
KDTOOLSCORE_EXPORT bool _kdCheckQtVersion_impl( unsigned int major, unsigned int minor=0, unsigned int patchlevel=0 );
|
||||||
static inline bool kdCheckQtVersion( unsigned int major, unsigned int minor=0, unsigned int patchlevel=0 ) {
|
static inline bool kdCheckQtVersion( unsigned int major, unsigned int minor=0, unsigned int patchlevel=0 ) {
|
||||||
return (major<<16|minor<<8|patchlevel) <= static_cast<unsigned int>(QT_VERSION)
|
return (major<<16|minor<<8|patchlevel) <= static_cast<unsigned int>(QT_VERSION)
|
||||||
|| _kdCheckQtVersion_impl( major, minor, patchlevel );
|
|| _kdCheckQtVersion_impl( major, minor, patchlevel );
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef KDTOOLSCORE__PIMPL_PTR_H
|
#ifndef KDTOOLSCORE_PIMPL_PTR_H
|
||||||
#define KDTOOLSCORE__PIMPL_PTR_H
|
#define KDTOOLSCORE_PIMPL_PTR_H
|
||||||
|
|
||||||
#include "kdtoolsglobal.h"
|
#include "kdtoolsglobal.h"
|
||||||
|
|
||||||
|
@ -40,5 +40,5 @@ namespace kdtools {
|
||||||
} // namespace kdtools
|
} // namespace kdtools
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* KDTOOLSCORE__PIMPL_PTR_H */
|
#endif /* KDTOOLSCORE_PIMPL_PTR_H */
|
||||||
|
|
||||||
|
|
|
@ -99,12 +99,10 @@ log( const char* msg, unsigned int debugLevel )
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
CalamaresLogHandler( QtMsgType type, const QMessageLogContext& context, const QString& msg )
|
CalamaresLogHandler( QtMsgType type, const QMessageLogContext&, const QString& msg )
|
||||||
{
|
{
|
||||||
static QMutex s_mutex;
|
static QMutex s_mutex;
|
||||||
|
|
||||||
Q_UNUSED( context );
|
|
||||||
|
|
||||||
QByteArray ba = msg.toUtf8();
|
QByteArray ba = msg.toUtf8();
|
||||||
const char* message = ba.constData();
|
const char* message = ba.constData();
|
||||||
|
|
||||||
|
|
|
@ -269,7 +269,7 @@ protected:
|
||||||
template<class impl, class ParentType>
|
template<class impl, class ParentType>
|
||||||
static QObject* createInstance( QWidget* parentWidget, QObject* parent )
|
static QObject* createInstance( QWidget* parentWidget, QObject* parent )
|
||||||
{
|
{
|
||||||
Q_UNUSED( parentWidget );
|
Q_UNUSED( parentWidget )
|
||||||
ParentType* p = nullptr;
|
ParentType* p = nullptr;
|
||||||
if ( parent )
|
if ( parent )
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,8 +20,6 @@
|
||||||
|
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
|
@ -26,11 +26,21 @@
|
||||||
class QByteArray;
|
class QByteArray;
|
||||||
class QFileInfo;
|
class QFileInfo;
|
||||||
|
|
||||||
namespace YAML
|
// The yaml-cpp headers are not C++11 warning-proof, especially
|
||||||
{
|
// with picky compilers like Clang 8. Since we use Clang for the
|
||||||
class Node;
|
// find-all-the-warnings case, switch those warnings off for
|
||||||
class Exception;
|
// the we-can't-change-them system headers.
|
||||||
}
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
|
||||||
|
#pragma clang diagnostic ignored "-Wshadow"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <yaml-cpp/yaml.h>
|
||||||
|
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
/// @brief Appends all te elements of @p node to the string list @p v
|
/// @brief Appends all te elements of @p node to the string list @p v
|
||||||
void operator>>( const YAML::Node& node, QStringList& v );
|
void operator>>( const YAML::Node& node, QStringList& v );
|
||||||
|
|
4
src/libcalamares/utils/moc-warnings.h
Normal file
4
src/libcalamares/utils/moc-warnings.h
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#ifdef __clang__
|
||||||
|
#pragma clang diagnostic ignored "-Wextra-semi-stmt"
|
||||||
|
#pragma clang diagnostic ignored "-Wredundant-parens"
|
||||||
|
#endif
|
|
@ -32,9 +32,6 @@
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QVariantMap>
|
#include <QVariantMap>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
|
|
||||||
namespace Calamares
|
namespace Calamares
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
#include "PythonQtViewModule.h"
|
#include "PythonQtViewModule.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
|
@ -40,7 +40,7 @@ static int s_defaultFontHeight = 0;
|
||||||
QPixmap
|
QPixmap
|
||||||
defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
|
defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
|
||||||
{
|
{
|
||||||
Q_UNUSED( mode );
|
Q_UNUSED( mode )
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
|
|
||||||
switch ( type )
|
switch ( type )
|
||||||
|
|
|
@ -71,7 +71,7 @@ ViewStep::setModuleInstanceKey( const QString& instanceKey )
|
||||||
void
|
void
|
||||||
ViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
ViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||||
{
|
{
|
||||||
Q_UNUSED( configurationMap );
|
Q_UNUSED( configurationMap )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ FixedAspectRatioLabel::setPixmap( const QPixmap& pixmap )
|
||||||
void
|
void
|
||||||
FixedAspectRatioLabel::resizeEvent( QResizeEvent* event )
|
FixedAspectRatioLabel::resizeEvent( QResizeEvent* event )
|
||||||
{
|
{
|
||||||
Q_UNUSED( event );
|
Q_UNUSED( event )
|
||||||
QLabel::setPixmap( m_pixmap.scaled(
|
QLabel::setPixmap( m_pixmap.scaled(
|
||||||
contentsRect().size(),
|
contentsRect().size(),
|
||||||
Qt::KeepAspectRatio,
|
Qt::KeepAspectRatio,
|
||||||
|
|
|
@ -21,5 +21,5 @@ if( ECM_FOUND AND BUILD_TESTING )
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
)
|
)
|
||||||
set_target_properties( contextualprocesstest PROPERTIES AUTOMOC TRUE )
|
calamares_automoc( contextualprocesstest )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
#include "utils/CommandList.h"
|
#include "utils/CommandList.h"
|
||||||
#include "utils/YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
|
@ -125,7 +125,7 @@ FinishedPage::focusInEvent( QFocusEvent* e )
|
||||||
void
|
void
|
||||||
FinishedPage::onInstallationFailed( const QString& message, const QString& details )
|
FinishedPage::onInstallationFailed( const QString& message, const QString& details )
|
||||||
{
|
{
|
||||||
Q_UNUSED( details );
|
Q_UNUSED( details )
|
||||||
if ( Calamares::Settings::instance()->isSetupMode() )
|
if ( Calamares::Settings::instance()->isSetupMode() )
|
||||||
ui->mainText->setText( tr( "<h1>Setup Failed</h1><br/>"
|
ui->mainText->setText( tr( "<h1>Setup Failed</h1><br/>"
|
||||||
"%1 has not been set up on your computer.<br/>"
|
"%1 has not been set up on your computer.<br/>"
|
||||||
|
|
|
@ -148,8 +148,8 @@ FinishedViewStep::jobs() const
|
||||||
void
|
void
|
||||||
FinishedViewStep::onInstallationFailed( const QString& message, const QString& details )
|
FinishedViewStep::onInstallationFailed( const QString& message, const QString& details )
|
||||||
{
|
{
|
||||||
Q_UNUSED( message );
|
Q_UNUSED( message )
|
||||||
Q_UNUSED( details );
|
Q_UNUSED( details )
|
||||||
installFailed = true;
|
installFailed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
|
@ -32,7 +32,7 @@ KeyboardLayoutModel::KeyboardLayoutModel( QObject* parent )
|
||||||
int
|
int
|
||||||
KeyboardLayoutModel::rowCount( const QModelIndex& parent ) const
|
KeyboardLayoutModel::rowCount( const QModelIndex& parent ) const
|
||||||
{
|
{
|
||||||
Q_UNUSED( parent );
|
Q_UNUSED( parent )
|
||||||
return m_layouts.count();
|
return m_layouts.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -436,7 +436,7 @@ void
|
||||||
KeyboardPage::onListLayoutCurrentItemChanged( const QModelIndex& current,
|
KeyboardPage::onListLayoutCurrentItemChanged( const QModelIndex& current,
|
||||||
const QModelIndex& previous )
|
const QModelIndex& previous )
|
||||||
{
|
{
|
||||||
Q_UNUSED( previous );
|
Q_UNUSED( previous )
|
||||||
if ( !current.isValid() )
|
if ( !current.isValid() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -446,9 +446,9 @@ KeyboardPage::onListLayoutCurrentItemChanged( const QModelIndex& current,
|
||||||
/* Returns stringlist with suitable setxkbmap command-line arguments
|
/* Returns stringlist with suitable setxkbmap command-line arguments
|
||||||
* to set the given @p layout and @p variant.
|
* to set the given @p layout and @p variant.
|
||||||
*/
|
*/
|
||||||
static inline QStringList xkbmap_args( QStringList&& r, const QString& layout, const QString& variant )
|
static inline QStringList xkbmap_args( const QString& layout, const QString& variant )
|
||||||
{
|
{
|
||||||
r << "-layout" << layout;
|
QStringList r{ "-layout", layout };
|
||||||
if ( !variant.isEmpty() )
|
if ( !variant.isEmpty() )
|
||||||
r << "-variant" << variant;
|
r << "-variant" << variant;
|
||||||
return r;
|
return r;
|
||||||
|
@ -457,7 +457,7 @@ static inline QStringList xkbmap_args( QStringList&& r, const QString& layout, c
|
||||||
void
|
void
|
||||||
KeyboardPage::onListVariantCurrentItemChanged( QListWidgetItem* current, QListWidgetItem* previous )
|
KeyboardPage::onListVariantCurrentItemChanged( QListWidgetItem* current, QListWidgetItem* previous )
|
||||||
{
|
{
|
||||||
Q_UNUSED( previous );
|
Q_UNUSED( previous )
|
||||||
|
|
||||||
QPersistentModelIndex layoutIndex = ui->listLayout->currentIndex();
|
QPersistentModelIndex layoutIndex = ui->listLayout->currentIndex();
|
||||||
LayoutItem* variantItem = dynamic_cast< LayoutItem* >( current );
|
LayoutItem* variantItem = dynamic_cast< LayoutItem* >( current );
|
||||||
|
@ -483,7 +483,7 @@ KeyboardPage::onListVariantCurrentItemChanged( QListWidgetItem* current, QListWi
|
||||||
connect( &m_setxkbmapTimer, &QTimer::timeout,
|
connect( &m_setxkbmapTimer, &QTimer::timeout,
|
||||||
this, [=]
|
this, [=]
|
||||||
{
|
{
|
||||||
QProcess::execute( "setxkbmap", xkbmap_args( QStringList(), layout, variant ) );
|
QProcess::execute( "setxkbmap", xkbmap_args( layout, variant ) );
|
||||||
cDebug() << "xkbmap selection changed to: " << layout << '-' << variant;
|
cDebug() << "xkbmap selection changed to: " << layout << '-' << variant;
|
||||||
m_setxkbmapTimer.disconnect( this );
|
m_setxkbmapTimer.disconnect( this );
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -87,8 +87,7 @@ LicensePage::LicensePage(QWidget *parent)
|
||||||
|
|
||||||
CALAMARES_RETRANSLATE(
|
CALAMARES_RETRANSLATE(
|
||||||
ui->acceptCheckBox->setText( tr( "I accept the terms and conditions above." ) );
|
ui->acceptCheckBox->setText( tr( "I accept the terms and conditions above." ) );
|
||||||
);
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ if( ECM_FOUND AND BUILD_TESTING )
|
||||||
${geoip_libs}
|
${geoip_libs}
|
||||||
${YAMLCPP_LIBRARY}
|
${YAMLCPP_LIBRARY}
|
||||||
)
|
)
|
||||||
set_target_properties( geoiptest PROPERTIES AUTOMOC TRUE )
|
calamares_automoc( geoiptest )
|
||||||
|
|
||||||
ecm_add_test(
|
ecm_add_test(
|
||||||
Tests.cpp
|
Tests.cpp
|
||||||
|
@ -65,10 +65,11 @@ if( ECM_FOUND AND BUILD_TESTING )
|
||||||
calamares
|
calamares
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
)
|
)
|
||||||
set_target_properties( localetest PROPERTIES AUTOMOC TRUE )
|
calamares_automoc( localetest )
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if( BUILD_TESTING )
|
if( BUILD_TESTING )
|
||||||
add_executable( test_geoip test_geoip.cpp ${geoip_src} )
|
add_executable( test_geoip test_geoip.cpp ${geoip_src} )
|
||||||
target_link_libraries( test_geoip calamaresui Qt5::Network ${geoip_libs} ${YAMLCPP_LIBRARY} )
|
target_link_libraries( test_geoip calamaresui Qt5::Network ${geoip_libs} ${YAMLCPP_LIBRARY} )
|
||||||
|
calamares_automoc( test_geoip )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -25,8 +25,6 @@
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
GeoIPJSON::GeoIPJSON(const QString& attribute)
|
GeoIPJSON::GeoIPJSON(const QString& attribute)
|
||||||
: GeoIP( attribute.isEmpty() ? QStringLiteral( "time_zone" ) : attribute )
|
: GeoIP( attribute.isEmpty() ? QStringLiteral( "time_zone" ) : attribute )
|
||||||
{
|
{
|
||||||
|
|
|
@ -101,7 +101,7 @@ LocalePage::LocalePage( QWidget* parent )
|
||||||
static_cast< void ( QComboBox::* )( int ) >( &QComboBox::currentIndexChanged ),
|
static_cast< void ( QComboBox::* )( int ) >( &QComboBox::currentIndexChanged ),
|
||||||
[this]( int currentIndex )
|
[this]( int currentIndex )
|
||||||
{
|
{
|
||||||
Q_UNUSED( currentIndex );
|
Q_UNUSED( currentIndex )
|
||||||
QHash< QString, QList< LocaleGlobal::Location > > regions = LocaleGlobal::getLocations();
|
QHash< QString, QList< LocaleGlobal::Location > > regions = LocaleGlobal::getLocations();
|
||||||
if ( !regions.contains( m_regionCombo->currentData().toString() ) )
|
if ( !regions.contains( m_regionCombo->currentData().toString() ) )
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -42,8 +42,6 @@
|
||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QtConcurrent/QtConcurrentRun>
|
#include <QtConcurrent/QtConcurrentRun>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( LocaleViewStepFactory, registerPlugin<LocaleViewStep>(); )
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( LocaleViewStepFactory, registerPlugin<LocaleViewStep>(); )
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,6 @@
|
||||||
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
using CalamaresUtils::yamlToVariant;
|
using CalamaresUtils::yamlToVariant;
|
||||||
|
|
||||||
NetInstallPage::NetInstallPage( QWidget* parent )
|
NetInstallPage::NetInstallPage( QWidget* parent )
|
||||||
|
|
|
@ -127,7 +127,7 @@ bool
|
||||||
PackageModel::setHeaderData( int section, Qt::Orientation orientation,
|
PackageModel::setHeaderData( int section, Qt::Orientation orientation,
|
||||||
const QVariant& value, int role )
|
const QVariant& value, int role )
|
||||||
{
|
{
|
||||||
Q_UNUSED( role );
|
Q_UNUSED( role )
|
||||||
|
|
||||||
if ( orientation == Qt::Horizontal )
|
if ( orientation == Qt::Horizontal )
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,10 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
namespace YAML
|
||||||
|
{
|
||||||
|
class Node;
|
||||||
|
}
|
||||||
|
|
||||||
class PackageModel : public QAbstractItemModel
|
class PackageModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
|
|
|
@ -540,7 +540,7 @@ void
|
||||||
ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current,
|
ChoicePage::doAlongsideSetupSplitter( const QModelIndex& current,
|
||||||
const QModelIndex& previous )
|
const QModelIndex& previous )
|
||||||
{
|
{
|
||||||
Q_UNUSED( previous );
|
Q_UNUSED( previous )
|
||||||
if ( !current.isValid() )
|
if ( !current.isValid() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -718,7 +718,7 @@ void
|
||||||
ChoicePage::onPartitionToReplaceSelected( const QModelIndex& current,
|
ChoicePage::onPartitionToReplaceSelected( const QModelIndex& current,
|
||||||
const QModelIndex& previous )
|
const QModelIndex& previous )
|
||||||
{
|
{
|
||||||
Q_UNUSED( previous );
|
Q_UNUSED( previous )
|
||||||
if ( !current.isValid() )
|
if ( !current.isValid() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ PartitionLabelsView::sizeHint() const
|
||||||
void
|
void
|
||||||
PartitionLabelsView::paintEvent( QPaintEvent* event )
|
PartitionLabelsView::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
Q_UNUSED( event );
|
Q_UNUSED( event )
|
||||||
|
|
||||||
QPainter painter( viewport() );
|
QPainter painter( viewport() );
|
||||||
painter.fillRect( rect(), palette().window() );
|
painter.fillRect( rect(), palette().window() );
|
||||||
|
@ -478,7 +478,7 @@ PartitionLabelsView::visualRect( const QModelIndex& idx ) const
|
||||||
QRegion
|
QRegion
|
||||||
PartitionLabelsView::visualRegionForSelection( const QItemSelection& selection ) const
|
PartitionLabelsView::visualRegionForSelection( const QItemSelection& selection ) const
|
||||||
{
|
{
|
||||||
Q_UNUSED( selection );
|
Q_UNUSED( selection )
|
||||||
|
|
||||||
return QRegion();
|
return QRegion();
|
||||||
}
|
}
|
||||||
|
@ -543,8 +543,8 @@ PartitionLabelsView::setExtendedPartitionHidden( bool hidden )
|
||||||
QModelIndex
|
QModelIndex
|
||||||
PartitionLabelsView::moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers )
|
PartitionLabelsView::moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers )
|
||||||
{
|
{
|
||||||
Q_UNUSED( cursorAction );
|
Q_UNUSED( cursorAction )
|
||||||
Q_UNUSED( modifiers );
|
Q_UNUSED( modifiers )
|
||||||
|
|
||||||
return QModelIndex();
|
return QModelIndex();
|
||||||
}
|
}
|
||||||
|
@ -553,7 +553,7 @@ PartitionLabelsView::moveCursor( CursorAction cursorAction, Qt::KeyboardModifier
|
||||||
bool
|
bool
|
||||||
PartitionLabelsView::isIndexHidden( const QModelIndex& index ) const
|
PartitionLabelsView::isIndexHidden( const QModelIndex& index ) const
|
||||||
{
|
{
|
||||||
Q_UNUSED( index );
|
Q_UNUSED( index )
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -598,7 +598,7 @@ PartitionLabelsView::mouseMoveEvent( QMouseEvent* event )
|
||||||
void
|
void
|
||||||
PartitionLabelsView::leaveEvent( QEvent* event )
|
PartitionLabelsView::leaveEvent( QEvent* event )
|
||||||
{
|
{
|
||||||
Q_UNUSED( event );
|
Q_UNUSED( event )
|
||||||
|
|
||||||
QGuiApplication::restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
if ( m_hoveredIndex.isValid() )
|
if ( m_hoveredIndex.isValid() )
|
||||||
|
|
|
@ -286,7 +286,7 @@ PartitionSplitterWidget::minimumSizeHint() const
|
||||||
void
|
void
|
||||||
PartitionSplitterWidget::paintEvent( QPaintEvent* event )
|
PartitionSplitterWidget::paintEvent( QPaintEvent* event )
|
||||||
{
|
{
|
||||||
Q_UNUSED( event );
|
Q_UNUSED( event )
|
||||||
|
|
||||||
QPainter painter( this );
|
QPainter painter( this );
|
||||||
painter.fillRect( rect(), palette().window() );
|
painter.fillRect( rect(), palette().window() );
|
||||||
|
@ -401,7 +401,7 @@ PartitionSplitterWidget::mouseMoveEvent( QMouseEvent* event )
|
||||||
void
|
void
|
||||||
PartitionSplitterWidget::mouseReleaseEvent( QMouseEvent* event )
|
PartitionSplitterWidget::mouseReleaseEvent( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
Q_UNUSED( event );
|
Q_UNUSED( event )
|
||||||
|
|
||||||
m_resizing = false;
|
m_resizing = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,5 +20,5 @@ if( ECM_FOUND AND BUILD_TESTING )
|
||||||
Qt5::Core
|
Qt5::Core
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
)
|
)
|
||||||
set_target_properties( shellprocesstest PROPERTIES AUTOMOC TRUE )
|
calamares_automoc( shellprocesstest )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -26,8 +26,6 @@
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/YamlUtils.h"
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QtTest/QtTest>
|
#include <QtTest/QtTest>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
|
@ -41,7 +41,7 @@ SummaryPage::SummaryPage( const SummaryViewStep* thisViewStep, QWidget* parent )
|
||||||
, m_contentWidget( nullptr )
|
, m_contentWidget( nullptr )
|
||||||
, m_scrollArea( new QScrollArea( this ) )
|
, m_scrollArea( new QScrollArea( this ) )
|
||||||
{
|
{
|
||||||
Q_UNUSED( parent );
|
Q_UNUSED( parent )
|
||||||
Q_ASSERT( m_thisViewStep );
|
Q_ASSERT( m_thisViewStep );
|
||||||
QVBoxLayout* layout = new QVBoxLayout( this );
|
QVBoxLayout* layout = new QVBoxLayout( this );
|
||||||
layout->setContentsMargins( 0, 0, 0, 0 );
|
layout->setContentsMargins( 0, 0, 0, 0 );
|
||||||
|
|
|
@ -21,13 +21,13 @@
|
||||||
* shipped with each module for correctness -- well, for parseability.
|
* shipped with each module for correctness -- well, for parseability.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "utils/YamlUtils.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <yaml-cpp/yaml.h>
|
|
||||||
|
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
|
|
|
@ -51,5 +51,5 @@ if( ECM_FOUND AND BUILD_TESTING )
|
||||||
Qt5::Test
|
Qt5::Test
|
||||||
${CRYPT_LIBRARIES}
|
${CRYPT_LIBRARIES}
|
||||||
)
|
)
|
||||||
set_target_properties( passwordtest PROPERTIES AUTOMOC TRUE )
|
calamares_automoc( passwordtest )
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -278,7 +278,7 @@ bool
|
||||||
GeneralRequirements::checkEnoughStorage( qint64 requiredSpace )
|
GeneralRequirements::checkEnoughStorage( qint64 requiredSpace )
|
||||||
{
|
{
|
||||||
#ifdef WITHOUT_LIBPARTED
|
#ifdef WITHOUT_LIBPARTED
|
||||||
Q_UNUSED( requiredSpace );
|
Q_UNUSED( requiredSpace )
|
||||||
cWarning() << "GeneralRequirements is configured without libparted.";
|
cWarning() << "GeneralRequirements is configured without libparted.";
|
||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue