mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-06 07:19:51 +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);
|
||||
}
|
||||
|
||||
bool GioLister::MountInfo::is_suitable() const {
|
||||
return filesystem_type != "udf" &&
|
||||
filesystem_type != "smb" &&
|
||||
filesystem_type != "cifs";
|
||||
}
|
||||
|
||||
GioLister::GioLister()
|
||||
: monitor_(NULL)
|
||||
{
|
||||
@ -133,6 +139,8 @@ void GioLister::MountRemovedCallback(GVolumeMonitor*, GMount* m, gpointer d) {
|
||||
|
||||
void GioLister::MountAdded(GMount *mount) {
|
||||
MountInfo info = ReadMountInfo(mount);
|
||||
if (!info.is_suitable())
|
||||
return;
|
||||
|
||||
{
|
||||
QMutexLocker l(&mutex_);
|
||||
|
@ -54,6 +54,7 @@ private:
|
||||
MountInfo() : filesystem_size(0), filesystem_free(0) {}
|
||||
|
||||
QString unique_id() const;
|
||||
bool is_suitable() const;
|
||||
|
||||
GMount* mount;
|
||||
QString unix_device;
|
||||
|
Loading…
Reference in New Issue
Block a user