Merge branch 'master' of https://github.com/calamares/calamares into development
This commit is contained in:
commit
8a10f5565b
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +0,0 @@
|
||||
[submodule "thirdparty/libcrashreporter-qt"]
|
||||
path = thirdparty/libcrashreporter-qt
|
||||
url = https://github.com/dschmidt/libcrashreporter-qt
|
@ -52,12 +52,7 @@ if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
cmake_policy( SET CMP0023 OLD )
|
||||
cmake_policy( SET CMP0028 NEW ) # double colons in KF5::Foo and Qt5::Foo are necessarily IMPORTED or ALIAS targets, don't search further
|
||||
cmake_policy( SET CMP0043 OLD )
|
||||
|
||||
include( MacroOptionalFindPackage )
|
||||
include( MacroLogFeature )
|
||||
include( FeatureSummary )
|
||||
|
||||
set( QT_VERSION 5.6.0 )
|
||||
|
||||
@ -66,7 +61,7 @@ find_package( YAMLCPP 0.5.1 REQUIRED )
|
||||
find_package( PolkitQt5-1 REQUIRED )
|
||||
|
||||
option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
|
||||
option( WITH_CRASHREPORTER "Build with CrashReporter" ON )
|
||||
# option( WITH_CRASHREPORTER "Build with CrashReporter" OFF )
|
||||
option( INSTALL_CONFIG "Install configuration files" ON )
|
||||
option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." OFF )
|
||||
option( BUILD_TESTING "Build the testing tree." ON )
|
||||
@ -75,40 +70,34 @@ if( BUILD_TESTING )
|
||||
enable_testing()
|
||||
endif ()
|
||||
|
||||
if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libcrashreporter-qt/CMakeLists.txt" )
|
||||
message( STATUS "Build of crashreporter disabled." )
|
||||
set( WITH_CRASHREPORTER OFF )
|
||||
endif()
|
||||
# if( CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/libcrashreporter-qt/CMakeLists.txt" )
|
||||
# message( STATUS "Build of crashreporter disabled." )
|
||||
# set( WITH_CRASHREPORTER OFF )
|
||||
# endif()
|
||||
|
||||
macro_optional_find_package( PythonLibs 3.3 )
|
||||
macro_log_feature(
|
||||
PYTHONLIBS_FOUND
|
||||
"Python"
|
||||
"C interface libraries for the Python 3 interpreter."
|
||||
"http://python.org"
|
||||
FALSE "3.3"
|
||||
"Python 3 is used for some Calamares job modules."
|
||||
find_package( PythonLibs 3.3 )
|
||||
set_package_properties(
|
||||
PYTHONLIBS PROPERTIES
|
||||
DESCRIPTION "C interface libraries for the Python 3 interpreter."
|
||||
URL "http://python.org"
|
||||
PURPOSE "Python 3 is used for some Calamares job modules."
|
||||
)
|
||||
|
||||
if ( PYTHONLIBS_FOUND )
|
||||
include( BoostPython3 )
|
||||
find_boost_python3( 1.54.0 ${PYTHONLIBS_VERSION_STRING} CALAMARES_BOOST_PYTHON3_FOUND )
|
||||
macro_log_feature(
|
||||
CALAMARES_BOOST_PYTHON3_FOUND
|
||||
"Boost.Python"
|
||||
"A C++ library which enables seamless interoperability between C++ and Python 3."
|
||||
"http://www.boost.org"
|
||||
FALSE "1.54.0"
|
||||
"Boost.Python is used for interfacing with Calamares job modules written in Python 3."
|
||||
set_package_properties(
|
||||
CALAMARES_BOOST_PYTHON3 PROPERTIES
|
||||
DESCRIPTION "A C++ library which enables seamless interoperability between C++ and Python 3."
|
||||
URL "http://www.boost.org"
|
||||
PURPOSE "Boost.Python is used for interfacing with Calamares job modules written in Python 3."
|
||||
)
|
||||
|
||||
macro_optional_find_package( PythonQt )
|
||||
macro_log_feature( PYTHONQT_FOUND
|
||||
"PythonQt"
|
||||
"A Python embedding solution for Qt applications."
|
||||
"http://pythonqt.sourceforge.net"
|
||||
FALSE "3.1"
|
||||
"PythonQt is used for the Python modules API."
|
||||
find_package( PythonQt )
|
||||
set_package_properties( PYTHONQT PROPERTIES
|
||||
DESCRIPTION "A Python embedding solution for Qt applications."
|
||||
URL "http://pythonqt.sourceforge.net"
|
||||
PURPOSE "PythonQt is used for the Python modules API."
|
||||
)
|
||||
endif()
|
||||
|
||||
@ -203,8 +192,8 @@ set( THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/thirdparty" )
|
||||
# make example-distro
|
||||
#
|
||||
find_program( mksquashfs_PROGRAM mksquashfs )
|
||||
macro_log_feature( mksquashfs_PROGRAM "mksquashfs" "Create example distro" "http://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html")
|
||||
if( mksquashfs_PROGRAM )
|
||||
set( mksquashfs_FOUND ON )
|
||||
set( src_fs ${CMAKE_SOURCE_DIR}/data/example-root/ )
|
||||
set( dst_fs ${CMAKE_BINARY_DIR}/example.sqfs )
|
||||
if( EXISTS ${src_fs} )
|
||||
@ -227,12 +216,22 @@ if( mksquashfs_PROGRAM )
|
||||
)
|
||||
add_custom_target(example-distro DEPENDS ${dst_fs})
|
||||
endif()
|
||||
else()
|
||||
set( mksquashfs_FOUND OFF )
|
||||
endif()
|
||||
# Doesn't list mksquashfs as an optional dep, though, because it
|
||||
# hasn't been sent through the find_package() scheme.
|
||||
set_package_properties( mksquashfs PROPERTIES
|
||||
DESCRIPTION "Create squashed filesystems"
|
||||
URL "http://tldp.org/HOWTO/SquashFS-HOWTO/creatingandusing.html"
|
||||
PURPOSE "Create example distro"
|
||||
TYPE OPTIONAL
|
||||
)
|
||||
|
||||
add_subdirectory( thirdparty )
|
||||
# add_subdirectory( thirdparty )
|
||||
add_subdirectory( src )
|
||||
|
||||
macro_display_feature_log()
|
||||
feature_summary(WHAT ALL)
|
||||
|
||||
if( NOT WITH_PYTHON )
|
||||
message( "-- WARNING: Building Calamares without Python support. Legacy Python job modules will not work.\n" )
|
||||
|
@ -45,9 +45,6 @@ function(calamares_add_library)
|
||||
add_library(${target} SHARED ${LIBRARY_SOURCES})
|
||||
endif()
|
||||
|
||||
# HACK: add qt modules - every lib should define its own set of modules
|
||||
qt5_use_modules(${target} Core Gui Widgets ${LIBRARY_QT5_MODULES})
|
||||
|
||||
# definitions - can this be moved into set_target_properties below?
|
||||
add_definitions(${QT_DEFINITIONS})
|
||||
set_target_properties(${target} PROPERTIES AUTOMOC TRUE)
|
||||
@ -67,9 +64,15 @@ function(calamares_add_library)
|
||||
endif()
|
||||
|
||||
# add link targets
|
||||
target_link_libraries(${target} ${CALAMARES_LIBRARIES})
|
||||
target_link_libraries(${target}
|
||||
LINK_PUBLIC ${CALAMARES_LIBRARIES}
|
||||
Qt5::Core
|
||||
Qt5::Gui
|
||||
Qt5::Widgets
|
||||
${LIBRARY_QT5_MODULES}
|
||||
)
|
||||
if(LIBRARY_LINK_LIBRARIES)
|
||||
target_link_libraries(${target} ${LIBRARY_LINK_LIBRARIES})
|
||||
target_link_libraries(${target} LINK_PUBLIC ${LIBRARY_LINK_LIBRARIES})
|
||||
endif()
|
||||
if(LIBRARY_LINK_PRIVATE_LIBRARIES)
|
||||
target_link_libraries(${target} LINK_PRIVATE ${LIBRARY_LINK_PRIVATE_LIBRARIES})
|
||||
|
@ -5,19 +5,30 @@
|
||||
# LIBCRYPT_LIBRARY, the path to libcrypt
|
||||
# LIBCRYPT_FOUND, whether libcrypt was found
|
||||
|
||||
if( CMAKE_SYSTEM MATCHES "FreeBSD" )
|
||||
# FreeBSD has crypt(3) declared in unistd.h, which lives in
|
||||
# libc; the libcrypt found here is not used.
|
||||
find_path( CRYPT_INCLUDE_DIR NAMES unistd.h )
|
||||
add_definitions( -DNO_CRYPT_H )
|
||||
else()
|
||||
find_path( CRYPT_INCLUDE_DIR
|
||||
NAMES crypt.h
|
||||
HINTS
|
||||
${CMAKE_INSTALL_INCLUDEDIR}
|
||||
NO_CACHE
|
||||
)
|
||||
endif()
|
||||
|
||||
find_path( CRYPT_INCLUDE_DIR NAMES crypt.h
|
||||
HINTS
|
||||
${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
find_library( CRYPT_LIBRARIES NAMES crypt
|
||||
find_library( CRYPT_LIBRARIES
|
||||
NAMES crypt
|
||||
HINTS
|
||||
${CMAKE_INSTALL_LIBDIR}
|
||||
)
|
||||
|
||||
include( FindPackageHandleStandardArgs )
|
||||
find_package_handle_standard_args( Crypt
|
||||
REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR )
|
||||
find_package_handle_standard_args(
|
||||
Crypt
|
||||
REQUIRED_VARS CRYPT_LIBRARIES CRYPT_INCLUDE_DIR
|
||||
)
|
||||
|
||||
mark_as_advanced( CRYPT_INCLUDE_DIR CRYPT_LIBRARIES )
|
||||
|
@ -1,157 +0,0 @@
|
||||
# This file defines the Feature Logging macros.
|
||||
#
|
||||
# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]])
|
||||
# Logs the information so that it can be displayed at the end
|
||||
# of the configure run
|
||||
# VAR : TRUE or FALSE, indicating whether the feature is supported
|
||||
# FEATURE: name of the feature, e.g. "libjpeg"
|
||||
# DESCRIPTION: description what this feature provides
|
||||
# URL: home page
|
||||
# REQUIRED: TRUE or FALSE, indicating whether the featue is required
|
||||
# MIN_VERSION: minimum version number. empty string if unneeded
|
||||
# COMMENTS: More info you may want to provide. empty string if unnecessary
|
||||
#
|
||||
# MACRO_DISPLAY_FEATURE_LOG()
|
||||
# Call this to display the collected results.
|
||||
# Exits CMake with a FATAL error message if a required feature is missing
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# INCLUDE(MacroLogFeature)
|
||||
#
|
||||
# FIND_PACKAGE(JPEG)
|
||||
# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "")
|
||||
# ...
|
||||
# MACRO_DISPLAY_FEATURE_LOG()
|
||||
|
||||
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
||||
# Copyright (c) 2006, Allen Winter, <winter@kde.org>
|
||||
# Copyright (c) 2009, Sebastian Trueg, <trueg@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
IF (NOT _macroLogFeatureAlreadyIncluded)
|
||||
SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
|
||||
IF (EXISTS ${_file})
|
||||
FILE(REMOVE ${_file})
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
|
||||
IF (EXISTS ${_file})
|
||||
FILE(REMOVE ${_file})
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
|
||||
IF (EXISTS ${_file})
|
||||
FILE(REMOVE ${_file})
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_macroLogFeatureAlreadyIncluded TRUE)
|
||||
|
||||
INCLUDE(FeatureSummary)
|
||||
|
||||
ENDIF (NOT _macroLogFeatureAlreadyIncluded)
|
||||
|
||||
|
||||
MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments)
|
||||
|
||||
STRING(TOUPPER "${ARGV4}" _required)
|
||||
SET(_minvers "${ARGV5}")
|
||||
SET(_comments "${ARGV6}")
|
||||
|
||||
IF (${_var})
|
||||
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
|
||||
ELSE (${_var})
|
||||
IF ("${_required}" STREQUAL "TRUE")
|
||||
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
|
||||
ELSE ("${_required}" STREQUAL "TRUE")
|
||||
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
|
||||
ENDIF ("${_required}" STREQUAL "TRUE")
|
||||
ENDIF (${_var})
|
||||
|
||||
SET(_logtext " * ${_package}")
|
||||
|
||||
IF (NOT ${_var})
|
||||
IF (${_minvers} MATCHES ".*")
|
||||
SET(_logtext "${_logtext} (${_minvers} or higher)")
|
||||
ENDIF (${_minvers} MATCHES ".*")
|
||||
SET(_logtext "${_logtext} <${_url}>\n ")
|
||||
ELSE (NOT ${_var})
|
||||
SET(_logtext "${_logtext} - ")
|
||||
ENDIF (NOT ${_var})
|
||||
|
||||
SET(_logtext "${_logtext}${_description}")
|
||||
|
||||
IF (NOT ${_var})
|
||||
IF (${_comments} MATCHES ".*")
|
||||
SET(_logtext "${_logtext}\n ${_comments}")
|
||||
ENDIF (${_comments} MATCHES ".*")
|
||||
# SET(_logtext "${_logtext}\n") #double-space missing features?
|
||||
ENDIF (NOT ${_var})
|
||||
|
||||
FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
|
||||
|
||||
IF(COMMAND SET_PACKAGE_INFO) # in FeatureSummary.cmake since CMake 2.8.3
|
||||
SET_PACKAGE_INFO("${_package}" "\"${_description}\"" "${_url}" "\"${_comments}\"")
|
||||
ENDIF(COMMAND SET_PACKAGE_INFO)
|
||||
|
||||
ENDMACRO(MACRO_LOG_FEATURE)
|
||||
|
||||
|
||||
MACRO(MACRO_DISPLAY_FEATURE_LOG)
|
||||
IF(COMMAND FEATURE_SUMMARY) # in FeatureSummary.cmake since CMake 2.8.3
|
||||
FEATURE_SUMMARY(FILENAME ${CMAKE_CURRENT_BINARY_DIR}/FindPackageLog.txt
|
||||
WHAT ALL)
|
||||
ENDIF(COMMAND FEATURE_SUMMARY)
|
||||
|
||||
SET(_missingFile ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
|
||||
SET(_enabledFile ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
|
||||
SET(_disabledFile ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
|
||||
|
||||
IF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
|
||||
SET(_printSummary TRUE)
|
||||
ENDIF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
|
||||
|
||||
IF(_printSummary)
|
||||
SET(_missingDeps 0)
|
||||
IF (EXISTS ${_enabledFile})
|
||||
FILE(READ ${_enabledFile} _enabled)
|
||||
FILE(REMOVE ${_enabledFile})
|
||||
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n-----------------------------------------------------------------------------\n${_enabled}")
|
||||
ENDIF (EXISTS ${_enabledFile})
|
||||
|
||||
|
||||
IF (EXISTS ${_disabledFile})
|
||||
SET(_missingDeps 1)
|
||||
FILE(READ ${_disabledFile} _disabled)
|
||||
FILE(REMOVE ${_disabledFile})
|
||||
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n-----------------------------------------------------------------------------\n${_disabled}")
|
||||
ENDIF (EXISTS ${_disabledFile})
|
||||
|
||||
|
||||
IF (EXISTS ${_missingFile})
|
||||
SET(_missingDeps 1)
|
||||
FILE(READ ${_missingFile} _requirements)
|
||||
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- You must install these packages before continuing.\n-----------------------------------------------------------------------------\n${_requirements}")
|
||||
FILE(REMOVE ${_missingFile})
|
||||
SET(_haveMissingReq 1)
|
||||
ENDIF (EXISTS ${_missingFile})
|
||||
|
||||
|
||||
IF (NOT ${_missingDeps})
|
||||
SET(_summary "${_summary}\n-----------------------------------------------------------------------------\n-- Congratulations! All external packages have been found.")
|
||||
ENDIF (NOT ${_missingDeps})
|
||||
|
||||
|
||||
MESSAGE(${_summary})
|
||||
MESSAGE("-----------------------------------------------------------------------------\n")
|
||||
|
||||
|
||||
IF(_haveMissingReq)
|
||||
MESSAGE(FATAL_ERROR "Exiting: Missing Requirements")
|
||||
ENDIF(_haveMissingReq)
|
||||
|
||||
ENDIF(_printSummary)
|
||||
|
||||
ENDMACRO(MACRO_DISPLAY_FEATURE_LOG)
|
@ -1,48 +0,0 @@
|
||||
# - MACRO_OPTIONAL_FIND_PACKAGE() combines FIND_PACKAGE() with an OPTION()
|
||||
# MACRO_OPTIONAL_FIND_PACKAGE( <name> [QUIT] )
|
||||
# This macro is a combination of OPTION() and FIND_PACKAGE(), it
|
||||
# works like FIND_PACKAGE(), but additionally it automatically creates
|
||||
# an option name WITH_<name>, which can be disabled via the cmake GUI.
|
||||
# or via -DWITH_<name>=OFF
|
||||
# The standard <name>_FOUND variables can be used in the same way
|
||||
# as when using the normal FIND_PACKAGE()
|
||||
|
||||
# Copyright (c) 2006-2010 Alexander Neundorf, <neundorf@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
# This is just a helper macro to set a bunch of variables empty.
|
||||
# We don't know whether the package uses UPPERCASENAME or CamelCaseName, so we try both:
|
||||
macro(_MOFP_SET_EMPTY_IF_DEFINED _name _var)
|
||||
if(DEFINED ${_name}_${_var})
|
||||
set(${_name}_${_var} "")
|
||||
endif(DEFINED ${_name}_${_var})
|
||||
|
||||
string(TOUPPER ${_name} _nameUpper)
|
||||
if(DEFINED ${_nameUpper}_${_var})
|
||||
set(${_nameUpper}_${_var} "")
|
||||
endif(DEFINED ${_nameUpper}_${_var})
|
||||
endmacro(_MOFP_SET_EMPTY_IF_DEFINED _package _var)
|
||||
|
||||
|
||||
macro (MACRO_OPTIONAL_FIND_PACKAGE _name )
|
||||
option(WITH_${_name} "Search for ${_name} package" ON)
|
||||
if (WITH_${_name})
|
||||
find_package(${_name} ${ARGN})
|
||||
else (WITH_${_name})
|
||||
string(TOUPPER ${_name} _nameUpper)
|
||||
set(${_name}_FOUND FALSE)
|
||||
set(${_nameUpper}_FOUND FALSE)
|
||||
|
||||
_mofp_set_empty_if_defined(${_name} INCLUDE_DIRS)
|
||||
_mofp_set_empty_if_defined(${_name} INCLUDE_DIR)
|
||||
_mofp_set_empty_if_defined(${_name} INCLUDES)
|
||||
_mofp_set_empty_if_defined(${_name} LIBRARY)
|
||||
_mofp_set_empty_if_defined(${_name} LIBRARIES)
|
||||
_mofp_set_empty_if_defined(${_name} LIBS)
|
||||
_mofp_set_empty_if_defined(${_name} FLAGS)
|
||||
_mofp_set_empty_if_defined(${_name} DEFINITIONS)
|
||||
endif (WITH_${_name})
|
||||
endmacro (MACRO_OPTIONAL_FIND_PACKAGE)
|
||||
|
@ -55,7 +55,6 @@ if( WITH_CRASHREPORTER )
|
||||
list( APPEND LINK_LIBRARIES ${LINK_LIBRARIES} pthread crashreporter-handler )
|
||||
endif()
|
||||
|
||||
qt5_use_modules( calamares_bin Core Widgets )
|
||||
target_link_libraries( calamares_bin
|
||||
PRIVATE
|
||||
${CALAMARES_LIBRARIES}
|
||||
|
@ -64,8 +64,6 @@ ProgressTreeDelegate::paint( QPainter* painter,
|
||||
const QStyleOptionViewItem& option,
|
||||
const QModelIndex& index) const
|
||||
{
|
||||
bool isFirstLevel = !index.parent().isValid();
|
||||
|
||||
QStyleOptionViewItem opt = option;
|
||||
|
||||
painter->save();
|
||||
|
@ -96,6 +96,10 @@ ProgressTreeModel::data( const QModelIndex& index, int role ) const
|
||||
QVariant
|
||||
ProgressTreeModel::headerData( int section, Qt::Orientation orientation, int role ) const
|
||||
{
|
||||
Q_UNUSED( section );
|
||||
Q_UNUSED( orientation );
|
||||
Q_UNUSED( role );
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
@ -146,12 +150,11 @@ ProgressTreeModel::indexFromItem( ProgressTreeItem* item )
|
||||
if ( !item || !item->parent() )
|
||||
return QModelIndex();
|
||||
|
||||
|
||||
// Reconstructs a QModelIndex from a ProgressTreeItem that is somewhere in the tree.
|
||||
// Traverses the item to the root node, then rebuilds the qmodeindices from there
|
||||
// Traverses the item to the root node, then rebuilds the qmodelindices from there
|
||||
// back down; each int is the row of that item in the parent.
|
||||
/**
|
||||
* In this diagram, if the \param item is G, childIndexList will contain [0, 2, 0]
|
||||
* In this diagram, if the item is G, childIndexList will contain [0, 2, 0]
|
||||
*
|
||||
* A
|
||||
* D
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
};
|
||||
|
||||
explicit ProgressTreeModel( QObject* parent = nullptr );
|
||||
virtual ~ProgressTreeModel();
|
||||
virtual ~ProgressTreeModel() override;
|
||||
|
||||
// Reimplemented from QAbstractItemModel
|
||||
Qt::ItemFlags flags( const QModelIndex& index ) const override;
|
||||
|
@ -34,8 +34,8 @@ class ProgressTreeView : public QTreeView
|
||||
public:
|
||||
static ProgressTreeView* instance();
|
||||
|
||||
explicit ProgressTreeView( QWidget* parent = 0 );
|
||||
virtual ~ProgressTreeView();
|
||||
explicit ProgressTreeView( QWidget* parent = nullptr );
|
||||
virtual ~ProgressTreeView() override;
|
||||
|
||||
/**
|
||||
* @brief setModel assigns a model to this view.
|
||||
|
@ -81,17 +81,9 @@ set_target_properties( calamares
|
||||
SOVERSION ${CALAMARES_VERSION_SHORT}
|
||||
)
|
||||
|
||||
qt5_use_modules( calamares Core )
|
||||
|
||||
|
||||
target_link_libraries( calamares
|
||||
LINK_PRIVATE
|
||||
# internal deps, if any
|
||||
${OPTIONAL_PRIVATE_LIBRARIES}
|
||||
|
||||
LINK_PUBLIC
|
||||
# External deps
|
||||
Qt5::Core
|
||||
LINK_PRIVATE ${OPTIONAL_PRIVATE_LIBRARIES}
|
||||
LINK_PUBLIC Qt5::Core
|
||||
)
|
||||
|
||||
install( TARGETS calamares
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
bool runInChroot = false,
|
||||
int secondsTimeout = 30,
|
||||
QObject* parent = nullptr );
|
||||
virtual ~ProcessJob();
|
||||
virtual ~ProcessJob() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
QString prettyStatusMessage() const override;
|
||||
|
@ -34,7 +34,7 @@ namespace Calamares
|
||||
{
|
||||
|
||||
PluginFactory::PluginFactory()
|
||||
: d_ptr(new PluginFactoryPrivate)
|
||||
: d_ptr_p(new PluginFactoryPrivate)
|
||||
{
|
||||
Q_D(PluginFactory);
|
||||
d->q_ptr = this;
|
||||
@ -43,14 +43,14 @@ PluginFactory::PluginFactory()
|
||||
}
|
||||
|
||||
PluginFactory::PluginFactory(PluginFactoryPrivate &d)
|
||||
: d_ptr(&d)
|
||||
: d_ptr_p(&d)
|
||||
{
|
||||
factorycleanup()->add(this);
|
||||
}
|
||||
|
||||
PluginFactory::~PluginFactory()
|
||||
{
|
||||
delete d_ptr;
|
||||
delete d_ptr_p;
|
||||
}
|
||||
|
||||
void PluginFactory::doRegisterPlugin(const QString &keyword, const QMetaObject *metaObject, CreateInstanceFunction instanceFunction)
|
||||
@ -97,7 +97,7 @@ QObject *PluginFactory::create(const char *iface, QWidget *parentWidget, QObject
|
||||
{
|
||||
Q_D(PluginFactory);
|
||||
|
||||
QObject *obj = 0;
|
||||
QObject *obj( nullptr );
|
||||
|
||||
const QList<PluginFactoryPrivate::Plugin> candidates(d->createInstanceHash.values(keyword));
|
||||
// for !keyword.isEmpty() candidates.count() is 0 or 1
|
||||
|
@ -199,7 +199,7 @@ namespace Calamares
|
||||
class DLLEXPORT PluginFactory : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DECLARE_PRIVATE(PluginFactory)
|
||||
Q_DECLARE_PRIVATE( PluginFactory )
|
||||
public:
|
||||
/**
|
||||
* This constructor creates a factory for a plugin.
|
||||
@ -222,7 +222,7 @@ public:
|
||||
* \returns A pointer to the created object is returned, or 0 if an error occurred.
|
||||
*/
|
||||
template<typename T>
|
||||
T *create(QObject *parent = 0);
|
||||
T* create( QObject* parent = nullptr );
|
||||
|
||||
/**
|
||||
* Use this method to create an object. It will try to create an object which inherits
|
||||
@ -235,34 +235,35 @@ public:
|
||||
* \returns A pointer to the created object is returned, or 0 if an error occurred.
|
||||
*/
|
||||
template<typename T>
|
||||
T *create(const QString &keyword, QObject *parent = 0);
|
||||
T* create( const QString& keyword, QObject* parent = nullptr );
|
||||
|
||||
Q_SIGNALS:
|
||||
void objectCreated(QObject *object);
|
||||
void objectCreated( QObject* object );
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Function pointer type to a function that instantiates a plugin.
|
||||
*/
|
||||
typedef QObject *(*CreateInstanceFunction)(QWidget *, QObject *);
|
||||
typedef QObject* ( *CreateInstanceFunction )( QWidget*, QObject* );
|
||||
|
||||
/**
|
||||
* This is used to detect the arguments need for the constructor of plugin classes.
|
||||
* You can inherit it, if you want to add new classes and still keep support for the old ones.
|
||||
*/
|
||||
template<class impl>
|
||||
struct InheritanceChecker {
|
||||
CreateInstanceFunction createInstanceFunction(QWidget *)
|
||||
struct InheritanceChecker
|
||||
{
|
||||
CreateInstanceFunction createInstanceFunction( QWidget* )
|
||||
{
|
||||
return &createInstance<impl, QWidget>;
|
||||
}
|
||||
CreateInstanceFunction createInstanceFunction(...)
|
||||
CreateInstanceFunction createInstanceFunction( ... )
|
||||
{
|
||||
return &createInstance<impl, QObject>;
|
||||
}
|
||||
};
|
||||
|
||||
explicit PluginFactory(PluginFactoryPrivate &dd);
|
||||
explicit PluginFactory( PluginFactoryPrivate& dd );
|
||||
|
||||
/**
|
||||
* Registers a plugin with the factory. Call this function from the constructor of the
|
||||
@ -292,14 +293,14 @@ protected:
|
||||
* \endcode
|
||||
*/
|
||||
template<class T>
|
||||
void registerPlugin(const QString &keyword = QString(),
|
||||
CreateInstanceFunction instanceFunction
|
||||
= InheritanceChecker<T>().createInstanceFunction(reinterpret_cast<T *>(0)))
|
||||
void registerPlugin( const QString& keyword = QString(),
|
||||
CreateInstanceFunction instanceFunction
|
||||
= InheritanceChecker<T>().createInstanceFunction( reinterpret_cast<T*>( 0 ) ) )
|
||||
{
|
||||
doRegisterPlugin(keyword, &T::staticMetaObject, instanceFunction);
|
||||
doRegisterPlugin( keyword, &T::staticMetaObject, instanceFunction );
|
||||
}
|
||||
|
||||
PluginFactoryPrivate *const d_ptr;
|
||||
PluginFactoryPrivate* const d_ptr_p;
|
||||
|
||||
/**
|
||||
* This function is called when the factory asked to create an Object.
|
||||
@ -314,56 +315,55 @@ protected:
|
||||
* \param keyword A string that uniquely identifies the plugin. If a KService is used this
|
||||
* keyword is read from the X-KDE-PluginKeyword entry in the .desktop file.
|
||||
*/
|
||||
virtual QObject *create(const char *iface, QWidget *parentWidget, QObject *parent, const QString &keyword);
|
||||
virtual QObject* create( const char* iface, QWidget* parentWidget, QObject* parent, const QString& keyword );
|
||||
|
||||
template<class impl, class ParentType>
|
||||
static QObject *createInstance(QWidget *parentWidget, QObject *parent)
|
||||
static QObject* createInstance( QWidget* parentWidget, QObject* parent )
|
||||
{
|
||||
Q_UNUSED(parentWidget);
|
||||
ParentType *p = 0;
|
||||
if (parent) {
|
||||
p = qobject_cast<ParentType *>(parent);
|
||||
Q_ASSERT(p);
|
||||
Q_UNUSED( parentWidget );
|
||||
ParentType* p( nullptr );
|
||||
if ( parent )
|
||||
{
|
||||
p = qobject_cast<ParentType*>( parent );
|
||||
Q_ASSERT( p );
|
||||
}
|
||||
return new impl(p);
|
||||
return new impl( p );
|
||||
}
|
||||
|
||||
private:
|
||||
void doRegisterPlugin(const QString &keyword, const QMetaObject *metaObject, CreateInstanceFunction instanceFunction);
|
||||
void doRegisterPlugin( const QString& keyword, const QMetaObject* metaObject, CreateInstanceFunction instanceFunction );
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
inline T *PluginFactory::create(QObject *parent)
|
||||
inline T* PluginFactory::create( QObject* parent )
|
||||
{
|
||||
QObject *o = create(T::staticMetaObject.className(),
|
||||
parent && parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent) : 0,
|
||||
parent,
|
||||
QString());
|
||||
QObject* o = create( T::staticMetaObject.className(),
|
||||
parent && parent->isWidgetType() ? reinterpret_cast<QWidget*>( parent ) : nullptr,
|
||||
parent,
|
||||
QString() );
|
||||
|
||||
T *t = qobject_cast<T *>(o);
|
||||
if (!t) {
|
||||
T* t = qobject_cast<T*>( o );
|
||||
if ( !t )
|
||||
delete o;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T *PluginFactory::create(const QString &keyword, QObject *parent)
|
||||
inline T* PluginFactory::create( const QString& keyword, QObject* parent )
|
||||
{
|
||||
QObject *o = create(T::staticMetaObject.className(),
|
||||
parent && parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent) : 0,
|
||||
parent,
|
||||
keyword);
|
||||
QObject* o = create( T::staticMetaObject.className(),
|
||||
parent && parent->isWidgetType() ? reinterpret_cast<QWidget*>( parent ) : nullptr,
|
||||
parent,
|
||||
keyword );
|
||||
|
||||
T *t = qobject_cast<T *>(o);
|
||||
if (!t) {
|
||||
T* t = qobject_cast<T*>( o );
|
||||
if ( !t )
|
||||
delete o;
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Q_DECLARE_INTERFACE(Calamares::PluginFactory, CalamaresPluginFactory_iid)
|
||||
Q_DECLARE_INTERFACE( Calamares::PluginFactory, CalamaresPluginFactory_iid )
|
||||
|
||||
#endif // CALAMARESPLUGINFACTORY_H
|
||||
|
@ -63,7 +63,7 @@ calamares_add_library( ${CALAMARESUI_LIBRARY_TARGET}
|
||||
UI ${${CALAMARESUI_LIBRARY_TARGET}_UI}
|
||||
EXPORT_MACRO UIDLLEXPORT_PRO
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
yaml-cpp
|
||||
${YAMLCPP_LIBRARY}
|
||||
Qt5::Svg
|
||||
Qt5::QuickWidgets
|
||||
${OPTIONAL_PRIVATE_LIBRARIES}
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
private:
|
||||
friend class Module; //so only the superclass can instantiate
|
||||
explicit CppJobModule();
|
||||
virtual ~CppJobModule();
|
||||
virtual ~CppJobModule() override;
|
||||
|
||||
QPluginLoader* m_loader;
|
||||
job_ptr m_job;
|
||||
|
@ -40,7 +40,7 @@ protected:
|
||||
private:
|
||||
friend class Module;
|
||||
explicit ProcessJobModule();
|
||||
virtual ~ProcessJobModule();
|
||||
virtual ~ProcessJobModule() override;
|
||||
|
||||
QString m_command;
|
||||
QString m_workingPath;
|
||||
|
@ -43,7 +43,7 @@ protected:
|
||||
private:
|
||||
friend class Module; //so only the superclass can instantiate
|
||||
explicit ViewModule();
|
||||
virtual ~ViewModule();
|
||||
virtual ~ViewModule() override;
|
||||
|
||||
QPluginLoader* m_loader;
|
||||
ViewStep* m_viewStep = nullptr;
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "utils/Logger.h"
|
||||
|
||||
static QHash< QString, QHash< int, QHash< qint64, QPixmap > > > s_cache;
|
||||
ImageRegistry* ImageRegistry::s_instance = 0;
|
||||
ImageRegistry* ImageRegistry::s_instance = nullptr;
|
||||
|
||||
|
||||
ImageRegistry*
|
||||
|
@ -26,7 +26,7 @@
|
||||
class QJsonTreeItem
|
||||
{
|
||||
public:
|
||||
QJsonTreeItem(QJsonTreeItem * parent = 0);
|
||||
QJsonTreeItem(QJsonTreeItem * parent = nullptr);
|
||||
virtual ~QJsonTreeItem();
|
||||
void appendChild(QJsonTreeItem * item);
|
||||
QJsonTreeItem *child(int row);
|
||||
@ -41,7 +41,7 @@ public:
|
||||
QJsonValue::Type type() const;
|
||||
|
||||
|
||||
static QJsonTreeItem* load(const QJsonValue& value, QJsonTreeItem * parent = 0);
|
||||
static QJsonTreeItem* load(const QJsonValue& value, QJsonTreeItem * parent = nullptr);
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -30,7 +30,7 @@ class QJsonModel : public QAbstractItemModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QJsonModel(QObject *parent = 0);
|
||||
explicit QJsonModel(QObject *parent = nullptr);
|
||||
virtual ~QJsonModel();
|
||||
bool load(const QString& fileName);
|
||||
bool load(QIODevice * device);
|
||||
|
@ -61,6 +61,8 @@ ViewStep::setModuleInstanceKey( const QString& instanceKey )
|
||||
|
||||
void
|
||||
ViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
{}
|
||||
{
|
||||
Q_UNUSED( configurationMap );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ class UIDLLEXPORT ViewStep : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ViewStep( QObject* parent = nullptr );
|
||||
virtual ~ViewStep();
|
||||
virtual ~ViewStep() override;
|
||||
|
||||
virtual QString prettyName() const = 0;
|
||||
|
||||
|
@ -28,14 +28,14 @@ class ClickableLabel : public QLabel
|
||||
public:
|
||||
explicit ClickableLabel( QWidget* parent = nullptr, Qt::WindowFlags f = 0 );
|
||||
explicit ClickableLabel( const QString& text, QWidget* parent = nullptr, Qt::WindowFlags f = 0 );
|
||||
virtual ~ClickableLabel();
|
||||
virtual ~ClickableLabel() override;
|
||||
|
||||
signals:
|
||||
void clicked();
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent* event );
|
||||
virtual void mouseReleaseEvent( QMouseEvent* event );
|
||||
virtual void mousePressEvent( QMouseEvent* event ) override;
|
||||
virtual void mouseReleaseEvent( QMouseEvent* event ) override;
|
||||
|
||||
private:
|
||||
QTime m_time;
|
||||
|
@ -42,6 +42,7 @@ FixedAspectRatioLabel::setPixmap( const QPixmap& pixmap )
|
||||
void
|
||||
FixedAspectRatioLabel::resizeEvent( QResizeEvent* event )
|
||||
{
|
||||
Q_UNUSED( event );
|
||||
QLabel::setPixmap( m_pixmap.scaled(
|
||||
contentsRect().size(),
|
||||
Qt::KeepAspectRatio,
|
||||
|
@ -28,7 +28,7 @@ class FixedAspectRatioLabel : public QLabel
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FixedAspectRatioLabel( QWidget* parent = nullptr );
|
||||
virtual ~FixedAspectRatioLabel();
|
||||
virtual ~FixedAspectRatioLabel() override;
|
||||
|
||||
public slots:
|
||||
void setPixmap( const QPixmap &pixmap );
|
||||
|
@ -57,7 +57,7 @@ void QtWaitingSpinner::paintEvent(QPaintEvent* /*ev*/) {
|
||||
for (int i = 0; i < myLinesNumber; ++i) {
|
||||
painter.save();
|
||||
painter.translate(myRadius + myLength, myRadius + myLength);
|
||||
qreal rotateAngle = (qreal)360 * qreal(i) / qreal(myLinesNumber);
|
||||
qreal rotateAngle = 360.0 * qreal(i) / qreal(myLinesNumber);
|
||||
painter.rotate(rotateAngle);
|
||||
painter.translate(myRadius, 0);
|
||||
int distance = lineDistance(i, myCurrentCounter, myLinesNumber);
|
||||
@ -145,7 +145,7 @@ void QtWaitingSpinner::updateTimer() {
|
||||
}
|
||||
|
||||
int QtWaitingSpinner::countTimeout(int lines, qreal speed) {
|
||||
return 1000 / (lines * speed);
|
||||
return int( 1000.0 / (lines * speed) );
|
||||
}
|
||||
|
||||
int QtWaitingSpinner::lineDistance(int from, int to, int lines) {
|
||||
@ -160,14 +160,14 @@ QColor QtWaitingSpinner::countTrailColor(int distance, int lines, int trail, int
|
||||
if (distance == 0) {
|
||||
return color;
|
||||
}
|
||||
const qreal minAlphaF = (qreal)minOpacity / 100;
|
||||
int distanceThreshold = ceil( (lines - 1) * (qreal)trail / 100);
|
||||
const qreal minAlphaF = qreal(minOpacity) / 100.0;
|
||||
int distanceThreshold = int( ceil( (lines - 1) * qreal(trail) / 100.0) );
|
||||
if (distance > distanceThreshold) {
|
||||
color.setAlphaF(minAlphaF);
|
||||
return color;
|
||||
}
|
||||
qreal alphaDiff = color.alphaF() - (qreal)minAlphaF;
|
||||
qreal gradation = alphaDiff / (qreal)(distanceThreshold + 1);
|
||||
qreal alphaDiff = color.alphaF() - minAlphaF;
|
||||
qreal gradation = alphaDiff / qreal(distanceThreshold + 1);
|
||||
qreal resultAlpha = color.alphaF() - gradation * distance;
|
||||
resultAlpha = std::min(1.0, std::max(0.0, resultAlpha)); //if alpha is out of bound, force it to bounds
|
||||
color.setAlphaF(resultAlpha);
|
||||
|
@ -33,7 +33,7 @@ class UIDLLEXPORT QtWaitingSpinner : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QtWaitingSpinner(int linesNumber = 12, int length = 7, int width = 5, int radius = 10, QWidget* parent = 0);
|
||||
explicit QtWaitingSpinner(int linesNumber = 12, int length = 7, int width = 5, int radius = 10, QWidget* parent = nullptr);
|
||||
|
||||
public Q_SLOTS:
|
||||
void start();
|
||||
|
@ -34,7 +34,7 @@ class PLUGINDLLEXPORT DracutLuksCfgJob : public Calamares::CppJob
|
||||
|
||||
public:
|
||||
explicit DracutLuksCfgJob( QObject* parent = nullptr );
|
||||
virtual ~DracutLuksCfgJob();
|
||||
virtual ~DracutLuksCfgJob() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
|
||||
|
@ -225,6 +225,7 @@ class FstabGenerator(object):
|
||||
def generate_fstab_line_info(self, partition):
|
||||
""" Generates information for each fstab entry. """
|
||||
filesystem = partition["fs"].lower()
|
||||
has_luks = "luksMapperName" in partition
|
||||
mount_point = partition["mountPoint"]
|
||||
disk_name = disk_name_for_partition(partition)
|
||||
is_ssd = disk_name in self.ssd_disks
|
||||
@ -232,6 +233,8 @@ class FstabGenerator(object):
|
||||
|
||||
if not mount_point and not filesystem == "swap":
|
||||
return None
|
||||
if not mount_point:
|
||||
mount_point = "swap"
|
||||
|
||||
options = self.mount_options.get(filesystem,
|
||||
self.mount_options["default"])
|
||||
@ -252,30 +255,19 @@ class FstabGenerator(object):
|
||||
self.root_is_ssd = is_ssd
|
||||
|
||||
if filesystem == "btrfs" and "subvol" in partition:
|
||||
return dict(
|
||||
device="UUID=" + partition["uuid"],
|
||||
mount_point=mount_point,
|
||||
fs=filesystem,
|
||||
options=",".join(
|
||||
["subvol={}".format(partition["subvol"]), options]
|
||||
),
|
||||
check=check,
|
||||
)
|
||||
options="subvol={},".format(partition["subvol"]) + options
|
||||
|
||||
if "luksMapperName" in partition:
|
||||
return dict(device="/dev/mapper/" + partition["luksMapperName"],
|
||||
mount_point=mount_point or "swap",
|
||||
fs=filesystem,
|
||||
options=options,
|
||||
check=check,
|
||||
)
|
||||
if has_luks:
|
||||
device="/dev/mapper/" + partition["luksMapperName"]
|
||||
else:
|
||||
return dict(device="UUID=" + partition["uuid"],
|
||||
mount_point=mount_point or "swap",
|
||||
fs=filesystem,
|
||||
options=options,
|
||||
check=check,
|
||||
)
|
||||
device="UUID=" + partition["uuid"]
|
||||
|
||||
return dict(device=device,
|
||||
mount_point=mount_point,
|
||||
fs=filesystem,
|
||||
options=options,
|
||||
check=check,
|
||||
)
|
||||
|
||||
def print_fstab_line(self, dct, file=None):
|
||||
""" Prints line to '/etc/fstab' file. """
|
||||
|
@ -34,7 +34,7 @@ class PLUGINDLLEXPORT InteractiveTerminalViewStep : public Calamares::ViewStep
|
||||
|
||||
public:
|
||||
explicit InteractiveTerminalViewStep( QObject* parent = nullptr );
|
||||
virtual ~InteractiveTerminalViewStep();
|
||||
virtual ~InteractiveTerminalViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
|
||||
|
@ -34,7 +34,7 @@ class PLUGINDLLEXPORT KeyboardViewStep : public Calamares::ViewStep
|
||||
|
||||
public:
|
||||
explicit KeyboardViewStep( QObject* parent = nullptr );
|
||||
virtual ~KeyboardViewStep();
|
||||
virtual ~KeyboardViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
QString prettyStatus() const override;
|
||||
|
@ -17,6 +17,6 @@ calamares_add_plugin( locale
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
Qt5::Network
|
||||
yaml-cpp
|
||||
${YAMLCPP_LIBRARY}
|
||||
SHARED_LIB
|
||||
)
|
||||
|
@ -15,6 +15,6 @@ calamares_add_plugin( netinstall
|
||||
LINK_PRIVATE_LIBRARIES
|
||||
calamaresui
|
||||
Qt5::Network
|
||||
yaml-cpp
|
||||
${YAMLCPP_LIBRARY}
|
||||
SHARED_LIB
|
||||
)
|
||||
|
@ -34,7 +34,7 @@ class PLUGINDLLEXPORT NetInstallViewStep : public Calamares::ViewStep
|
||||
|
||||
public:
|
||||
explicit NetInstallViewStep( QObject* parent = nullptr );
|
||||
virtual ~NetInstallViewStep();
|
||||
virtual ~NetInstallViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
QString prettyStatus() const override;
|
||||
|
@ -126,6 +126,8 @@ bool
|
||||
PackageModel::setHeaderData( int section, Qt::Orientation orientation,
|
||||
const QVariant& value, int role )
|
||||
{
|
||||
Q_UNUSED( role );
|
||||
|
||||
if ( orientation == Qt::Horizontal )
|
||||
{
|
||||
if ( m_columnHeadings.value( section ) != QVariant() )
|
||||
|
@ -35,14 +35,14 @@ class PackageModel : public QAbstractItemModel
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PackageModel( const YAML::Node& data, QObject* parent = 0 );
|
||||
~PackageModel();
|
||||
explicit PackageModel( const YAML::Node& data, QObject* parent = nullptr );
|
||||
~PackageModel() override;
|
||||
|
||||
QVariant data( const QModelIndex& index, int role ) const override;
|
||||
bool setData( const QModelIndex& index, const QVariant& value,
|
||||
int role = Qt::EditRole ) override;
|
||||
bool setHeaderData( int section, Qt::Orientation orientation,
|
||||
const QVariant& value, int role = Qt::EditRole );
|
||||
const QVariant& value, int role = Qt::EditRole ) override;
|
||||
Qt::ItemFlags flags( const QModelIndex& index ) const override;
|
||||
QVariant headerData( int section, Qt::Orientation orientation,
|
||||
int role = Qt::DisplayRole ) const override;
|
||||
|
@ -18,9 +18,9 @@
|
||||
|
||||
#include "PackageTreeItem.h"
|
||||
|
||||
PackageTreeItem::PackageTreeItem( const ItemData& data, PackageTreeItem* parent ) :
|
||||
m_data( data ),
|
||||
m_parentItem( parent )
|
||||
PackageTreeItem::PackageTreeItem( const ItemData& data, PackageTreeItem* parent )
|
||||
: m_parentItem( parent )
|
||||
, m_data( data )
|
||||
{ }
|
||||
|
||||
PackageTreeItem::PackageTreeItem( const QString packageName, PackageTreeItem* parent ) :
|
||||
|
@ -37,10 +37,10 @@ public:
|
||||
bool isHidden = false;
|
||||
Qt::CheckState selected = Qt::Unchecked;
|
||||
};
|
||||
explicit PackageTreeItem( const ItemData& data, PackageTreeItem* parent = 0 );
|
||||
explicit PackageTreeItem( const QString packageName, PackageTreeItem* parent = 0 );
|
||||
explicit PackageTreeItem( PackageTreeItem* parent = 0 );
|
||||
~PackageTreeItem();
|
||||
explicit PackageTreeItem( const ItemData& data, PackageTreeItem* parent = nullptr );
|
||||
explicit PackageTreeItem( const QString packageName, PackageTreeItem* parent = nullptr );
|
||||
explicit PackageTreeItem( PackageTreeItem* parent = nullptr );
|
||||
~PackageTreeItem() override;
|
||||
|
||||
void appendChild( PackageTreeItem* child );
|
||||
PackageTreeItem* child( int row );
|
||||
|
@ -8,7 +8,7 @@ find_package( KF5 REQUIRED CoreAddons )
|
||||
# These are needed because KPMcore links publicly against ConfigCore, I18n, IconThemes, KIOCore and Service
|
||||
find_package( KF5 REQUIRED Config I18n IconThemes KIO Service )
|
||||
|
||||
find_package( KPMcore 3.1.50 )
|
||||
find_package( KPMcore 3.1.50 QUIET )
|
||||
if ( ${KPMcore_FOUND} )
|
||||
add_definitions(-DWITH_KPMCORE22)
|
||||
endif()
|
||||
|
@ -32,8 +32,8 @@ class DeviceModel : public QAbstractListModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DeviceModel( QObject* parent = 0 );
|
||||
~DeviceModel();
|
||||
DeviceModel( QObject* parent = nullptr );
|
||||
~DeviceModel() override;
|
||||
|
||||
/**
|
||||
* Init the model with the list of devices. Does *not* take ownership of the
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
ColumnCount // Must remain last
|
||||
};
|
||||
|
||||
PartitionModel( QObject* parent = 0 );
|
||||
PartitionModel( QObject* parent = nullptr );
|
||||
/**
|
||||
* device must remain alive for the life of PartitionModel
|
||||
*/
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
};
|
||||
|
||||
explicit PartitionBarsView( QWidget* parent = nullptr );
|
||||
virtual ~PartitionBarsView();
|
||||
virtual ~PartitionBarsView() override;
|
||||
|
||||
void setNestedPartitionsMode( NestedPartitionsMode mode );
|
||||
|
||||
|
@ -36,7 +36,7 @@ class PartitionLabelsView : public QAbstractItemView
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PartitionLabelsView( QWidget* parent = nullptr );
|
||||
virtual ~PartitionLabelsView();
|
||||
virtual ~PartitionLabelsView() override;
|
||||
|
||||
QSize minimumSizeHint() const override;
|
||||
|
||||
|
@ -41,8 +41,8 @@ class PLUGINDLLEXPORT PartitionViewStep : public Calamares::ViewStep
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PartitionViewStep( QObject* parent = 0 );
|
||||
virtual ~PartitionViewStep();
|
||||
explicit PartitionViewStep( QObject* parent = nullptr );
|
||||
virtual ~PartitionViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
QWidget* createSummaryWidget() const override;
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "jobs/CreatePartitionJob.h"
|
||||
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Units.h"
|
||||
|
||||
// KPMcore
|
||||
#include <kpmcore/backend/corebackend.h>
|
||||
@ -47,7 +48,7 @@ CreatePartitionJob::prettyName() const
|
||||
{
|
||||
return tr( "Create new %2MB partition on %4 (%3) with file system %1." )
|
||||
.arg( m_partition->fileSystem().name() )
|
||||
.arg( m_partition->capacity() / 1024 / 1024 )
|
||||
.arg( CalamaresUtils::BytesToMiB( m_partition->capacity() ) )
|
||||
.arg( m_device->name() )
|
||||
.arg( m_device->deviceNode() );
|
||||
}
|
||||
@ -59,7 +60,7 @@ CreatePartitionJob::prettyDescription() const
|
||||
return tr( "Create new <strong>%2MB</strong> partition on <strong>%4</strong> "
|
||||
"(%3) with file system <strong>%1</strong>." )
|
||||
.arg( m_partition->fileSystem().name() )
|
||||
.arg( m_partition->capacity() / 1024 / 1024 )
|
||||
.arg( CalamaresUtils::BytesToMiB( m_partition->capacity() ) )
|
||||
.arg( m_device->name() )
|
||||
.arg( m_device->deviceNode() );
|
||||
}
|
||||
@ -79,7 +80,7 @@ CreatePartitionJob::exec()
|
||||
int step = 0;
|
||||
const qreal stepCount = 4;
|
||||
|
||||
Report report( 0 );
|
||||
Report report( nullptr );
|
||||
QString message = tr( "The installer failed to create partition on disk '%1'." ).arg( m_device->name() );
|
||||
|
||||
progress( step++ / stepCount );
|
||||
|
@ -72,7 +72,7 @@ CreatePartitionTableJob::prettyStatusMessage() const
|
||||
Calamares::JobResult
|
||||
CreatePartitionTableJob::exec()
|
||||
{
|
||||
Report report( 0 );
|
||||
Report report( nullptr );
|
||||
QString message = tr( "The installer failed to create a partition table on %1." ).arg( m_device->name() );
|
||||
|
||||
CoreBackend* backend = CoreBackendManager::self()->backend();
|
||||
|
@ -63,7 +63,7 @@ DeletePartitionJob::prettyStatusMessage() const
|
||||
Calamares::JobResult
|
||||
DeletePartitionJob::exec()
|
||||
{
|
||||
Report report( 0 );
|
||||
Report report( nullptr );
|
||||
QString message = tr( "The installer failed to delete partition %1." ).arg( m_partition->devicePath() );
|
||||
|
||||
if ( m_device->deviceNode() != m_partition->devicePath() )
|
||||
|
@ -76,6 +76,50 @@ getLuksUuid( const QString& path )
|
||||
return uuid;
|
||||
}
|
||||
|
||||
// TODO: this will be available from KPMCore soon
|
||||
static const char* filesystem_labels[] = {
|
||||
"unknown",
|
||||
"extended",
|
||||
|
||||
"ext2",
|
||||
"ext3",
|
||||
"ext4",
|
||||
"linuxswap",
|
||||
"fat16",
|
||||
"fat32",
|
||||
"ntfs",
|
||||
"reiser",
|
||||
"reiser4",
|
||||
"xfs",
|
||||
"jfs",
|
||||
"hfs",
|
||||
"hfsplus",
|
||||
"ufs",
|
||||
"unformatted",
|
||||
"btrfs",
|
||||
"hpfs",
|
||||
"luks",
|
||||
"ocfs2",
|
||||
"zfs",
|
||||
"exfat",
|
||||
"nilfs2",
|
||||
"lvm2 pv",
|
||||
"f2fs",
|
||||
"udf",
|
||||
"iso9660",
|
||||
};
|
||||
|
||||
Q_STATIC_ASSERT_X((sizeof(filesystem_labels) / sizeof(char *)) >= FileSystem::__lastType, "Mismatch in filesystem labels");
|
||||
|
||||
static QString
|
||||
untranslatedTypeName(FileSystem::Type t)
|
||||
{
|
||||
|
||||
Q_ASSERT( t >= 0 );
|
||||
Q_ASSERT( t <= FileSystem::__lastType );
|
||||
|
||||
return QLatin1String(filesystem_labels[t]);
|
||||
}
|
||||
|
||||
static QVariant
|
||||
mapForPartition( Partition* partition, const QString& uuid )
|
||||
@ -83,14 +127,15 @@ mapForPartition( Partition* partition, const QString& uuid )
|
||||
QVariantMap map;
|
||||
map[ "device" ] = partition->partitionPath();
|
||||
map[ "mountPoint" ] = PartitionInfo::mountPoint( partition );
|
||||
map[ "fs" ] = partition->fileSystem().name();
|
||||
map[ "fsName" ] = partition->fileSystem().name();
|
||||
map[ "fs" ] = untranslatedTypeName( partition->fileSystem().type() );
|
||||
if ( partition->fileSystem().type() == FileSystem::Luks &&
|
||||
dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS() )
|
||||
map[ "fs" ] = dynamic_cast< FS::luks& >( partition->fileSystem() ).innerFS()->name();
|
||||
map[ "uuid" ] = uuid;
|
||||
cDebug() << partition->partitionPath()
|
||||
<< "mtpoint:" << PartitionInfo::mountPoint( partition )
|
||||
<< "fs:" << map[ "fs" ]
|
||||
<< "fs:" << map[ "fs" ] << '(' << map[ "fsName" ] << ')'
|
||||
<< uuid;
|
||||
|
||||
if ( partition->roles().has( PartitionRole::Luks ) )
|
||||
|
@ -5,7 +5,7 @@ if( ECM_FOUND )
|
||||
endif()
|
||||
|
||||
find_package( Qt5 COMPONENTS Core Test REQUIRED )
|
||||
find_package( Crypt )
|
||||
find_package( Crypt REQUIRED )
|
||||
|
||||
include_directories( ${PROJECT_BINARY_DIR}/src/libcalamaresui )
|
||||
|
||||
|
@ -36,7 +36,7 @@ class PLUGINDLLEXPORT UsersViewStep : public Calamares::ViewStep
|
||||
|
||||
public:
|
||||
explicit UsersViewStep( QObject* parent = nullptr );
|
||||
virtual ~UsersViewStep();
|
||||
virtual ~UsersViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
|
||||
|
@ -117,13 +117,12 @@ CreateUserJob::exec()
|
||||
{
|
||||
QString autologinGroup;
|
||||
if ( gs->contains( "autologinGroup" ) &&
|
||||
!gs->value( "autologinGroup" ).toString().isEmpty() )
|
||||
!gs->value( "autologinGroup" ).toString().isEmpty() )
|
||||
{
|
||||
autologinGroup = gs->value( "autologinGroup" ).toString();
|
||||
else
|
||||
autologinGroup = QStringLiteral( "autologin" );
|
||||
|
||||
CalamaresUtils::System::instance()->targetEnvCall( { "groupadd", autologinGroup } );
|
||||
defaultGroups.append( QString( ",%1" ).arg( autologinGroup ) );
|
||||
CalamaresUtils::System::instance()->targetEnvCall( { "groupadd", autologinGroup } );
|
||||
defaultGroups.append( QString( ",%1" ).arg( autologinGroup ) );
|
||||
}
|
||||
}
|
||||
|
||||
// If we're looking to reuse the contents of an existing /home
|
||||
|
@ -27,7 +27,11 @@
|
||||
#include <QDir>
|
||||
|
||||
#include <random>
|
||||
|
||||
#ifndef NO_CRYPT_H
|
||||
#include <crypt.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
SetPasswordJob::SetPasswordJob( const QString& userName, const QString& newPassword )
|
||||
@ -54,7 +58,7 @@ SetPasswordJob::prettyStatusMessage() const
|
||||
|
||||
/// Returns a modular hashing salt for method 6 (SHA512) with a 16 character random salt.
|
||||
QString
|
||||
SetPasswordJob::make_salt(size_t length)
|
||||
SetPasswordJob::make_salt(int length)
|
||||
{
|
||||
Q_ASSERT(length >= 8);
|
||||
Q_ASSERT(length <= 128);
|
||||
@ -73,7 +77,7 @@ SetPasswordJob::make_salt(size_t length)
|
||||
std::mt19937_64 twister(seed);
|
||||
|
||||
std::uint64_t next;
|
||||
size_t current_length = 0;
|
||||
int current_length = 0;
|
||||
|
||||
QString salt_string;
|
||||
salt_string.reserve(length + 10);
|
||||
|
@ -33,7 +33,7 @@ public:
|
||||
QString prettyStatusMessage() const override;
|
||||
Calamares::JobResult exec() override;
|
||||
|
||||
static QString make_salt(size_t length);
|
||||
static QString make_salt(int length);
|
||||
|
||||
private:
|
||||
QString m_userName;
|
||||
|
@ -43,7 +43,7 @@ class PLUGINDLLEXPORT WebViewStep : public Calamares::ViewStep
|
||||
|
||||
public:
|
||||
explicit WebViewStep( QObject* parent = nullptr );
|
||||
virtual ~WebViewStep();
|
||||
virtual ~WebViewStep() override;
|
||||
|
||||
QString prettyName() const override;
|
||||
|
||||
|
11
thirdparty/CMakeLists.txt
vendored
11
thirdparty/CMakeLists.txt
vendored
@ -1,11 +0,0 @@
|
||||
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||
# Suppress warnings entirely; not interesting in third-party code
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w" )
|
||||
endif()
|
||||
|
||||
if( WITH_CRASHREPORTER )
|
||||
macro( qt_wrap_ui )
|
||||
qt5_wrap_ui( ${ARGN} )
|
||||
endmacro()
|
||||
add_subdirectory( libcrashreporter-qt )
|
||||
endif()
|
1
thirdparty/libcrashreporter-qt
vendored
1
thirdparty/libcrashreporter-qt
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 61dc3963c2b59894e7d3f3bd758c43b59665054a
|
Loading…
Reference in New Issue
Block a user