@ -61,25 +61,15 @@ uint Environment::makeVersion(uint major, uint minor, uint release) const
uint Environment : : identifyPlasmaDesktopVersion ( )
uint Environment : : identifyPlasmaDesktopVersion ( )
{
{
//! Identify Plasma Desktop version
//! Identify Plasma Desktop version
QProcess process ;
QStringList plasmaDesktopVersionParts = QString ( PLASMA_WORKSPACE_VERSION ) . split ( " . " ) ;
process . start ( " plasmashell " , QStringList ( ) < < " -v " ) ;
process . waitForFinished ( ) ;
QString output ( process . readAllStandardOutput ( ) ) ;
QStringList stringSplit = output . split ( " " ) ;
if ( stringSplit . count ( ) > = 2 ) {
qDebug ( ) < < " ///////////////////////// " ;
QString cleanVersionString = stringSplit [ 1 ] . remove ( " \n " ) ;
QStringList plasmaDesktopVersionParts = cleanVersionString . split ( " . " ) ;
if ( plasmaDesktopVersionParts . count ( ) = = 3 ) {
if ( plasmaDesktopVersionParts . count ( ) = = 3 ) {
qDebug ( ) < < " ///////////////////////// " ;
uint maj = plasmaDesktopVersionParts [ 0 ] . toUInt ( ) ;
uint maj = plasmaDesktopVersionParts [ 0 ] . toUInt ( ) ;
uint min = plasmaDesktopVersionParts [ 1 ] . toUInt ( ) ;
uint min = plasmaDesktopVersionParts [ 1 ] . toUInt ( ) ;
uint rel = plasmaDesktopVersionParts [ 2 ] . toUInt ( ) ;
uint rel = plasmaDesktopVersionParts [ 2 ] . toUInt ( ) ;
if ( maj > 0 ) {
if ( maj > 0 ) {
uint desktopVersion = makeVersion ( maj , min , rel ) ;
uint desktopVersion = makeVersion ( maj , min , rel ) ;
QString message ( " Plasma Desktop version: " + QString : : number ( maj ) + " . "
QString message ( " Plasma Desktop version: " + QString : : number ( maj ) + " . "
@ -90,7 +80,6 @@ uint Environment::identifyPlasmaDesktopVersion()
return desktopVersion ;
return desktopVersion ;
}
}
}
qDebug ( ) < < " ///////////////////////// " ;
qDebug ( ) < < " ///////////////////////// " ;
}
}