2020-10-01 00:33:19 +01:00
/*
SPDX - FileCopyrightText : 2008 - 2012 Volker Lanz < vl @ fidra . de >
SPDX - FileCopyrightText : 2012 - 2018 Andrius Š tikonas < andrius @ stikonas . eu >
SPDX - FileCopyrightText : 2015 - 2016 Teo Mrnjavac < teo @ kde . org >
SPDX - FileCopyrightText : 2016 Chantara Tith < tith . chantara @ gmail . com >
SPDX - FileCopyrightText : 2016 Friedrich W . H . Kossebau < kossebau @ kde . org >
SPDX - License - Identifier : GPL - 3.0 - or - later
*/
2015-06-04 01:29:22 +01:00
# include "util/helpers.h"
2016-05-04 21:50:05 +01:00
# include "util/externalcommand.h"
# include "util/globallog.h"
2015-06-04 01:29:22 +01:00
2016-05-04 21:50:05 +01:00
# include "ops/operation.h"
2015-06-04 01:29:22 +01:00
# include <KAboutData>
# include <KLocalizedString>
void registerMetaTypes ( )
{
2015-07-13 15:16:36 +01:00
qRegisterMetaType < Operation * > ( " Operation* " ) ;
qRegisterMetaType < Log : : Level > ( " Log::Level " ) ;
2015-06-04 01:29:22 +01:00
}
bool caseInsensitiveLessThan ( const QString & s1 , const QString & s2 )
{
2015-07-13 15:16:36 +01:00
return s1 . toLower ( ) < s2 . toLower ( ) ;
2015-06-04 01:29:22 +01:00
}
2016-03-31 17:43:38 +01:00
bool isMounted ( const QString & deviceNode )
{
2016-05-04 21:50:05 +01:00
ExternalCommand cmd ( QStringLiteral ( " lsblk " ) ,
{ QStringLiteral ( " --noheadings " ) ,
QStringLiteral ( " --nodeps " ) ,
QStringLiteral ( " --output " ) ,
QStringLiteral ( " mountpoint " ) ,
deviceNode } ) ;
if ( cmd . run ( - 1 ) & & cmd . exitCode ( ) = = 0 ) {
2016-05-05 12:46:27 +01:00
return ! cmd . output ( ) . trimmed ( ) . isEmpty ( ) ;
2016-05-04 21:50:05 +01:00
}
return false ;
2016-03-31 17:43:38 +01:00
}
2016-08-25 00:14:51 +01:00
KAboutData aboutKPMcore ( )
{
KAboutData aboutData ( QStringLiteral ( " kpmcore " ) ,
xi18nc ( " @title " , " <application>KPMcore</application> " ) , QStringLiteral ( VERSION ) ,
2016-08-25 00:22:15 +01:00
xi18nc ( " @title " , " Library for managing partitions " ) ,
2020-10-01 00:33:19 +01:00
KAboutLicense : : GPL_V3 , xi18nc ( " @info:credit " , " © 2008-2020 KPMcore developers " ) ) ;
2016-08-25 00:14:51 +01:00
aboutData . setOrganizationDomain ( QByteArray ( " kde.org " ) ) ;
aboutData . setProductName ( QByteArray ( " kpmcore " ) ) ;
2016-11-16 17:36:51 +00:00
aboutData . setHomepage ( QStringLiteral ( " https://commits.kde.org/kpmcore " ) ) ;
2016-08-25 00:14:51 +01:00
2016-08-25 00:22:15 +01:00
aboutData . addAuthor ( xi18nc ( " @info:credit " , " Volker Lanz " ) , xi18nc ( " @info:credit " , " Former maintainer " ) ) ;
2016-08-25 00:14:51 +01:00
aboutData . addAuthor ( xi18nc ( " @info:credit " , " Andrius Štikonas " ) , xi18nc ( " @info:credit " , " Maintainer " ) , QStringLiteral ( " andrius@stikonas.eu " ) ) ;
2017-10-02 01:40:41 +01:00
aboutData . addCredit ( xi18nc ( " @info:credit " , " Teo Mrnjavac " ) , i18nc ( " @info:credit " , " Former Calamares maintainer " ) , QStringLiteral ( " teo@kde.org " ) ) ;
aboutData . addCredit ( xi18nc ( " @info:credit " , " Chantara Tith " ) , i18nc ( " @info:credit " , " LVM support " ) , QStringLiteral ( " tith.chantara@gmail.com " ) ) ;
aboutData . addCredit ( xi18nc ( " @info:credit " , " Pali Rohár " ) , i18nc ( " @info:credit " , " UDF support " ) , QStringLiteral ( " pali.rohar@gmail.com " ) ) ;
2017-10-02 22:44:58 +01:00
aboutData . addCredit ( xi18nc ( " @info:credit " , " Adriaan de Groot " ) , i18nc ( " @info:credit " , " Calamares maintainer " ) , QStringLiteral ( " groot@kde.org " ) ) ;
2019-09-18 00:59:06 +01:00
aboutData . addCredit ( xi18nc ( " @info:credit " , " Caio Jordão Carvalho " ) , i18nc ( " @info:credit " , " Improved SMART support " ) , QStringLiteral ( " caiojcarvalho@gmail.com " ) ) ;
2020-10-09 20:41:41 +01:00
aboutData . addCredit ( xi18nc ( " @info:credit " , " David Edmundson " ) , i18nc ( " @info:credit " , " Port from KAuth to Polkit " ) , QStringLiteral ( " kde@davidedmundson.co.uk " ) ) ;
2016-08-25 00:14:51 +01:00
return aboutData ;
}