mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-22 15:30:13 +01:00
Ignore mounted samba shares and CDs from the GIO lister
This commit is contained in:
parent
6faa1aa1a6
commit
3c6f48bd4c
@ -27,6 +27,12 @@ QString GioLister::MountInfo::unique_id() const {
|
|||||||
return QString("Gio/%1/%2/%3").arg(uuid, filesystem_type).arg(filesystem_size);
|
return QString("Gio/%1/%2/%3").arg(uuid, filesystem_type).arg(filesystem_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GioLister::MountInfo::is_suitable() const {
|
||||||
|
return filesystem_type != "udf" &&
|
||||||
|
filesystem_type != "smb" &&
|
||||||
|
filesystem_type != "cifs";
|
||||||
|
}
|
||||||
|
|
||||||
GioLister::GioLister()
|
GioLister::GioLister()
|
||||||
: monitor_(NULL)
|
: monitor_(NULL)
|
||||||
{
|
{
|
||||||
@ -133,6 +139,8 @@ void GioLister::MountRemovedCallback(GVolumeMonitor*, GMount* m, gpointer d) {
|
|||||||
|
|
||||||
void GioLister::MountAdded(GMount *mount) {
|
void GioLister::MountAdded(GMount *mount) {
|
||||||
MountInfo info = ReadMountInfo(mount);
|
MountInfo info = ReadMountInfo(mount);
|
||||||
|
if (!info.is_suitable())
|
||||||
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
QMutexLocker l(&mutex_);
|
QMutexLocker l(&mutex_);
|
||||||
|
@ -54,6 +54,7 @@ private:
|
|||||||
MountInfo() : filesystem_size(0), filesystem_free(0) {}
|
MountInfo() : filesystem_size(0), filesystem_free(0) {}
|
||||||
|
|
||||||
QString unique_id() const;
|
QString unique_id() const;
|
||||||
|
bool is_suitable() const;
|
||||||
|
|
||||||
GMount* mount;
|
GMount* mount;
|
||||||
QString unix_device;
|
QString unix_device;
|
||||||
|
Loading…
Reference in New Issue
Block a user