From 2aca5464b749396ad08cbb98ece3b2878efdb210 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 16 Apr 2020 22:41:28 +0200 Subject: [PATCH] [netinstall] Display package descriptions - For packages with a description, show that - Add an example in the config-file --- src/modules/netinstall/PackageTreeItem.cpp | 29 +++++++--------------- src/modules/netinstall/netinstall.conf | 8 +++++- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/modules/netinstall/PackageTreeItem.cpp b/src/modules/netinstall/PackageTreeItem.cpp index df9195cce..30a57ac2a 100644 --- a/src/modules/netinstall/PackageTreeItem.cpp +++ b/src/modules/netinstall/PackageTreeItem.cpp @@ -131,27 +131,16 @@ PackageTreeItem::row() const QVariant PackageTreeItem::data( int column ) const { - if ( isPackage() ) // packages have a packagename, groups don't + switch ( column ) { - switch ( column ) - { - case 0: - return QVariant( packageName() ); - default: - return QVariant(); - } - } - else - { - switch ( column ) // group - { - case 0: - return QVariant( name() ); - case 1: - return QVariant( description() ); - default: - return QVariant(); - } + case 0: + // packages have a packagename, groups don't + return QVariant( isPackage() ? packageName() : name() ); + case 1: + // packages often have a blank description + return QVariant( description() ); + default: + return QVariant(); } } diff --git a/src/modules/netinstall/netinstall.conf b/src/modules/netinstall/netinstall.conf index 24f4f201d..a1496d6ff 100644 --- a/src/modules/netinstall/netinstall.conf +++ b/src/modules/netinstall/netinstall.conf @@ -255,7 +255,9 @@ groups: - konversation - nheko - quaternion - # Setting *selected* is supported. + # Setting *selected* is supported. Here we also show off "rich" + # packages: ones with a package-name (for the package-manager) + # and a description (for the human). - name: Editors description: "Editing" selected: false @@ -263,6 +265,10 @@ groups: - vi - emacs - nano + - name: kate-git + description: Kate (unstable) + - name: kate + description: KDE's text editor # The "bare" package names can be intimidating, so you can use subgroups # to provide human-readable names while hiding the packages themselves. # This also allows you you group related packages -- suppose you feel