Skip to content
Permalink
Browse files

fix storage detection for linux.(refs #77)

  • Loading branch information...
haraki committed Jun 9, 2019
1 parent 0eee712 commit 449bb6e45d70312eda7a7152800fd67d978c3ea8
Showing with 12 additions and 2 deletions.
  1. +12 −2 storagefavoriteinfomodel.cpp
@@ -33,9 +33,19 @@ int StorageFavoriteInfoModel::initialize()
qDebug() << QString("Bytes free: %L1 Bytes").arg(volume.bytesFree());
qDebug() << QString("Bytes total: %L1 Bytes").arg(volume.bytesTotal()) << endl;

if(volume.isValid() && volume.isReady())
if(volume.isValid() && volume.isReady()
#ifdef Q_OS_LINUX
&& (volume.isRoot() || volume.rootPath().startsWith("/media"))
#endif
)
{
m_infos.push_back({StorageFavoriteInfo::Type::Storage, volume.displayName(), volume.rootPath()});
m_infos.push_back({StorageFavoriteInfo::Type::Storage,
#ifdef Q_OS_LINUX
volume.device(),
#else
volume.displayName(),
#endif
volume.rootPath()});
}
}

0 comments on commit 449bb6e

Please sign in to comment.
You can’t perform that action at this time.