netinstall: adjust to Qt6
This commit is contained in:
parent
e781e4eb5f
commit
f56250624f
@ -17,7 +17,7 @@ calamares_add_plugin(netinstall
|
|||||||
UI
|
UI
|
||||||
page_netinst.ui
|
page_netinst.ui
|
||||||
LINK_PRIVATE_LIBRARIES
|
LINK_PRIVATE_LIBRARIES
|
||||||
Qt5::Network
|
${qtname}::Network
|
||||||
SHARED_LIB
|
SHARED_LIB
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -25,6 +25,6 @@ if(KF5CoreAddons_FOUND)
|
|||||||
calamares_add_test(
|
calamares_add_test(
|
||||||
netinstalltest
|
netinstalltest
|
||||||
SOURCES Tests.cpp Config.cpp LoaderQueue.cpp PackageTreeItem.cpp PackageModel.cpp
|
SOURCES Tests.cpp Config.cpp LoaderQueue.cpp PackageTreeItem.cpp PackageModel.cpp
|
||||||
LIBRARIES Qt5::Gui Qt5::Network KF5::CoreAddons
|
LIBRARIES ${qtname}::Gui ${qtname}::Network KF5::CoreAddons
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
|
#include "compat/Variant.h"
|
||||||
#include "network/Manager.h"
|
#include "network/Manager.h"
|
||||||
#include "packages/Globals.h"
|
#include "packages/Globals.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
@ -137,11 +138,11 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
const QString key = QStringLiteral( "groupsUrl" );
|
const QString key = QStringLiteral( "groupsUrl" );
|
||||||
const auto& groupsUrlVariant = configurationMap.value( key );
|
const auto& groupsUrlVariant = configurationMap.value( key );
|
||||||
m_queue = new LoaderQueue( this );
|
m_queue = new LoaderQueue( this );
|
||||||
if ( groupsUrlVariant.type() == QVariant::String )
|
if ( Calamares::typeOf( groupsUrlVariant ) == Calamares::StringVariantType )
|
||||||
{
|
{
|
||||||
m_queue->append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) );
|
m_queue->append( SourceItem::makeSourceItem( groupsUrlVariant.toString(), configurationMap ) );
|
||||||
}
|
}
|
||||||
else if ( groupsUrlVariant.type() == QVariant::List )
|
else if ( Calamares::typeOf( groupsUrlVariant ) == Calamares::ListVariantType )
|
||||||
{
|
{
|
||||||
for ( const auto& s : groupsUrlVariant.toStringList() )
|
for ( const auto& s : groupsUrlVariant.toStringList() )
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include "PackageModel.h"
|
#include "PackageModel.h"
|
||||||
|
|
||||||
|
#include "compat/Variant.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
#include "utils/Yaml.h"
|
#include "utils/Yaml.h"
|
||||||
@ -279,7 +280,7 @@ PackageModel::setupModelData( const QVariantList& groupList, PackageTreeItem* pa
|
|||||||
{
|
{
|
||||||
for ( const auto& packageName : groupMap.value( "packages" ).toList() )
|
for ( const auto& packageName : groupMap.value( "packages" ).toList() )
|
||||||
{
|
{
|
||||||
if ( packageName.type() == QVariant::String )
|
if ( Calamares::typeOf( packageName ) == Calamares::StringVariantType )
|
||||||
{
|
{
|
||||||
item->appendChild( new PackageTreeItem( packageName.toString(), item ) );
|
item->appendChild( new PackageTreeItem( packageName.toString(), item ) );
|
||||||
}
|
}
|
||||||
@ -301,7 +302,7 @@ PackageModel::setupModelData( const QVariantList& groupList, PackageTreeItem* pa
|
|||||||
{
|
{
|
||||||
bool haveWarned = false;
|
bool haveWarned = false;
|
||||||
const auto& subgroupValue = groupMap.value( "subgroups" );
|
const auto& subgroupValue = groupMap.value( "subgroups" );
|
||||||
if ( !subgroupValue.canConvert( QVariant::List ) )
|
if ( !subgroupValue.canConvert< QVariantList >() )
|
||||||
{
|
{
|
||||||
cWarning() << "*subgroups* under" << item->name() << "is not a list.";
|
cWarning() << "*subgroups* under" << item->name() << "is not a list.";
|
||||||
haveWarned = true;
|
haveWarned = true;
|
||||||
|
@ -22,7 +22,12 @@ GroupsTreeView::drawBranches( QPainter* painter, const QRect& rect, const QModel
|
|||||||
const QString s = index.data().toString();
|
const QString s = index.data().toString();
|
||||||
if ( s.isEmpty() )
|
if ( s.isEmpty() )
|
||||||
{
|
{
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
|
||||||
QStyleOptionViewItem opt = viewOptions();
|
QStyleOptionViewItem opt = viewOptions();
|
||||||
|
#else
|
||||||
|
QStyleOptionViewItem opt;
|
||||||
|
initViewItemOption( &opt );
|
||||||
|
#endif
|
||||||
opt.state = QStyle::State_Sibling;
|
opt.state = QStyle::State_Sibling;
|
||||||
opt.rect = QRect( !isRightToLeft() ? rect.left() : rect.right() + 1, rect.top(), indentation(), rect.height() );
|
opt.rect = QRect( !isRightToLeft() ? rect.left() : rect.right() + 1, rect.top(), indentation(), rect.height() );
|
||||||
painter->eraseRect( opt.rect );
|
painter->eraseRect( opt.rect );
|
||||||
|
Loading…
Reference in New Issue
Block a user