Commit 19a8d7e8 authored by Raine Makelainen's avatar Raine Makelainen

Merge branch 'jb47352' into 'master'

[nemo-systemsettings] Expose symlink from UDisks2 block. Contributes to JB#47352

See merge request !121
parents 955f0772 093edefd
......@@ -294,6 +294,32 @@ QString UDisks2::Block::idUUID() const
return value(QStringLiteral("IdUUID")).toString();
}
QStringList UDisks2::Block::symlinks() const
{
QStringList links;
QVariant variantListBytes = value(QStringLiteral("Symlinks"));
if (variantListBytes.canConvert<QVariantList>()) {
QSequentialIterable iterable = variantListBytes.value<QSequentialIterable>();
for (const QVariant &a : iterable) {
QByteArray symlinkBytes;
if (a.canConvert<QVariantList>()) {
QSequentialIterable i = a.value<QSequentialIterable>();
for (const QVariant &variantByte : i) {
symlinkBytes.append(variantByte.toChar());
}
}
if (!symlinkBytes.isEmpty())
links << QString::fromLocal8Bit(symlinkBytes);
}
}
return links;
}
QString UDisks2::Block::mountPath() const
{
return m_mountPath;
......
......@@ -100,6 +100,8 @@ public:
QString idLabel() const;
QString idUUID() const;
QStringList symlinks() const;
QString mountPath() const;
QVariant value(const QString &key) const;
......
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