From 544131c4bcd51ba401bde1325db36bfda9f4e608 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 1 Apr 2019 08:48:25 -0400 Subject: [PATCH] [partition] Improve type notation --- src/modules/partition/core/DeviceModel.cpp | 3 ++- src/modules/partition/core/DeviceModel.h | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/modules/partition/core/DeviceModel.cpp b/src/modules/partition/core/DeviceModel.cpp index 260315729..7c9503344 100644 --- a/src/modules/partition/core/DeviceModel.cpp +++ b/src/modules/partition/core/DeviceModel.cpp @@ -2,6 +2,7 @@ * * Copyright 2014, Aurélien Gâteau * Copyright 2014, Teo Mrnjavac + * Copyright 2019, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,7 +46,7 @@ DeviceModel::~DeviceModel() } void -DeviceModel::init( const QList< Device* >& devices ) +DeviceModel::init( const DeviceList& devices ) { beginResetModel(); m_devices = devices; diff --git a/src/modules/partition/core/DeviceModel.h b/src/modules/partition/core/DeviceModel.h index 2e2f99342..f3e158bbf 100644 --- a/src/modules/partition/core/DeviceModel.h +++ b/src/modules/partition/core/DeviceModel.h @@ -1,7 +1,7 @@ /* === This file is part of Calamares - === * * Copyright 2014, Aurélien Gâteau - * Copyright 2017, Adriaan de Groot + * Copyright 2017, 2019, Adriaan de Groot * * Calamares is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,11 +36,13 @@ public: DeviceModel( QObject* parent = nullptr ); ~DeviceModel() override; + using DeviceList = QList< Device* >; + /** * Init the model with the list of devices. Does *not* take ownership of the * devices. */ - void init( const QList< Device* >& devices ); + void init( const DeviceList& devices ); int rowCount( const QModelIndex& parent = QModelIndex() ) const override; QVariant data( const QModelIndex& index, int role = Qt::DisplayRole ) const override; @@ -54,7 +56,7 @@ public: void removeDevice( Device* device ); private: - QList< Device* > m_devices; + DeviceList m_devices; }; #endif /* DEVICEMODEL_H */