Commit 9277cc53 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Implement basic device type detection

parent 95a62f4f
Pipeline #18893 failed with stage
in 3 minutes and 9 seconds
......@@ -109,7 +109,23 @@ void KdeConnectConfig::setName(const QString& name)
QString KdeConnectConfig::deviceType()
return QStringLiteral("desktop"); // TODO
return QStringLiteral("phone");
const QByteArrayList platforms = qgetenv("PLASMA_PLATFORM").split(':');
if (platforms.contains("phone")) {
return QStringLiteral("phone");
} else if (platforms.contains("tablet")) {
return QStringLiteral("tablet");
} else if(platforms.contains("mediacenter")) {
return QStringLiteral("tv");
// TODO non-Plasma mobile platforms
return QStringLiteral("desktop");
QString KdeConnectConfig::deviceId()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment