There will be about 1h of downtime on 2020-03-02 at 13:00 UTC+1 (change of servers and upgrade to Heptapod 0.20.0 final)

Commit 0c53a805 authored by Tijl Coosemans's avatar Tijl Coosemans

Implement Block DeviceNumber property, used by GVfs.

parent f895cf05eebd
......@@ -24,6 +24,8 @@
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/stat.h>
#include <QFileInfo>
#include "bsdisks.h"
......@@ -89,6 +91,15 @@ QByteArray Block::device() const
}
qulonglong Block::deviceNumber() const
{
struct stat st;
::stat((QStringLiteral("/dev/") + name).toLocal8Bit().constData(), &st);
return st.st_rdev;
}
QByteArrayList Block::symlinks()
{
QByteArrayList r;
......
......@@ -71,6 +71,9 @@ public:
Q_PROPERTY(QByteArray Device READ device)
QByteArray device() const;
Q_PROPERTY(qulonglong DeviceNumber READ deviceNumber)
qulonglong deviceNumber() const;
Q_PROPERTY(QByteArray PreferredDevice READ preferredDevice)
QByteArray preferredDevice() 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