Commit 1857fbe9 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

IDeviceLister: Rename functions

Since we now handle multiple mountpoints, we care about a device being
mounted/unmounted instead of plugged unplugged
parent ba1f4715
......@@ -40,18 +40,18 @@ class IDeviceListerCb
public:
virtual ~IDeviceListerCb() = default;
/**
* @brief onDevicePlugged Shall be invoked when a known device gets plugged
* @brief onDeviceMounted Shall be invoked when a known device gets mounted
* @param uuid The device UUID
* @param mountpoint The device new mountpoint
* @returns true is the device was unknown. false otherwise
*/
virtual bool onDevicePlugged( const std::string& uuid, const std::string& mountpoint ) = 0;
virtual bool onDeviceMounted( const std::string& uuid, const std::string& mountpoint ) = 0;
/**
* @brief onDeviceUnplugged Shall be invoked when a known device gets unplugged
* @brief onDeviceUnmounted Shall be invoked when a known device gets unmounted
* @param uuid The device UUID
* @param mountpoint The mountpoint the device was mounted on
*/
virtual void onDeviceUnplugged( const std::string& uuid, const std::string& mountpoint ) = 0;
virtual void onDeviceUnmounted( const std::string& uuid, const std::string& mountpoint ) = 0;
/**
* @brief isDeviceKnown Returns true is the provided device is already known to the media library
*
......
......@@ -1553,7 +1553,7 @@ void MediaLibrary::addThumbnailer( std::shared_ptr<IThumbnailer> thumbnailer )
m_thumbnailers.push_back( std::move( thumbnailer ) );
}
bool MediaLibrary::DeviceListerCb::onDevicePlugged( const std::string& uuid, const std::string& mountpoint )
bool MediaLibrary::DeviceListerCb::onDeviceMounted( const std::string& uuid, const std::string& mountpoint )
{
auto currentDevice = Device::fromUuid( m_ml, uuid );
LOG_INFO( "Device ", uuid, " was plugged and mounted on ", mountpoint );
......@@ -1579,7 +1579,7 @@ bool MediaLibrary::DeviceListerCb::onDevicePlugged( const std::string& uuid, con
return currentDevice == nullptr;
}
void MediaLibrary::DeviceListerCb::onDeviceUnplugged( const std::string& uuid,
void MediaLibrary::DeviceListerCb::onDeviceUnmounted( const std::string& uuid,
const std::string& mountpoint )
{
auto device = Device::fromUuid( m_ml, uuid );
......
......@@ -230,8 +230,8 @@ class MediaLibrary : public IMediaLibrary
public:
DeviceListerCb( MediaLibrary* ml );
private:
virtual bool onDevicePlugged( const std::string& uuid, const std::string& mountpoint ) override;
virtual void onDeviceUnplugged(const std::string& uuid, const std::string& mountpoint) override;
virtual bool onDeviceMounted( const std::string& uuid, const std::string& mountpoint ) override;
virtual void onDeviceUnmounted(const std::string& uuid, const std::string& mountpoint) override;
virtual bool isDeviceKnown( const std::string& uuid ) const override;
private:
......
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