mirror of
https://github.com/linuxdeepin/gio-qt.git
synced 2024-12-27 07:26:09 +01:00
feat: new interface for eject
This commit is contained in:
parent
bd6154c585
commit
369628a8a9
2 changed files with 16 additions and 10 deletions
|
@ -45,17 +45,17 @@ public:
|
||||||
bool isShadowed() const;
|
bool isShadowed() const;
|
||||||
bool canUnmount() const;
|
bool canUnmount() const;
|
||||||
bool canEject() const;
|
bool canEject() const;
|
||||||
|
QString sortKey() const;
|
||||||
QStringList themedIconNames() const;
|
QStringList themedIconNames() const;
|
||||||
QStringList themedSymbolicIconNames() const;
|
QStringList themedSymbolicIconNames() const;
|
||||||
|
|
||||||
void unmount(bool forceUnmount = false);
|
void unmount(bool forceUnmount = false);
|
||||||
|
void eject(bool forceEject = false);
|
||||||
|
|
||||||
QExplicitlySharedDataPointer<DGioFile> getRootFile();
|
QExplicitlySharedDataPointer<DGioFile> getRootFile();
|
||||||
QExplicitlySharedDataPointer<DGioFile> getDefaultLocationFile();
|
QExplicitlySharedDataPointer<DGioFile> getDefaultLocationFile();
|
||||||
QExplicitlySharedDataPointer<DGioVolume> getVolume();
|
QExplicitlySharedDataPointer<DGioVolume> getVolume();
|
||||||
|
|
||||||
QString getSortKey()const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<DGioMountPrivate> d_ptr;
|
QScopedPointer<DGioMountPrivate> d_ptr;
|
||||||
|
|
||||||
|
|
|
@ -169,6 +169,13 @@ bool DGioMount::canEject() const
|
||||||
return d->getGmmMountInstance()->can_eject();
|
return d->getGmmMountInstance()->can_eject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString DGioMount::sortKey() const
|
||||||
|
{
|
||||||
|
Q_D(const DGioMount);
|
||||||
|
|
||||||
|
return QString::fromStdString(d->getGmmMountInstance()->get_sort_key());
|
||||||
|
}
|
||||||
|
|
||||||
QStringList DGioMount::themedIconNames() const
|
QStringList DGioMount::themedIconNames() const
|
||||||
{
|
{
|
||||||
Q_D(const DGioMount);
|
Q_D(const DGioMount);
|
||||||
|
@ -194,6 +201,13 @@ void DGioMount::unmount(bool forceUnmount)
|
||||||
return d->getGmmMountInstance()->unmount(forceUnmount ? MOUNT_UNMOUNT_FORCE : MOUNT_UNMOUNT_NONE);
|
return d->getGmmMountInstance()->unmount(forceUnmount ? MOUNT_UNMOUNT_FORCE : MOUNT_UNMOUNT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DGioMount::eject(bool forceEject)
|
||||||
|
{
|
||||||
|
Q_D(const DGioMount);
|
||||||
|
|
||||||
|
return d->getGmmMountInstance()->eject(forceEject ? MOUNT_UNMOUNT_FORCE : MOUNT_UNMOUNT_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
QExplicitlySharedDataPointer<DGioFile> DGioMount::getRootFile()
|
QExplicitlySharedDataPointer<DGioFile> DGioMount::getRootFile()
|
||||||
{
|
{
|
||||||
Q_D(const DGioMount);
|
Q_D(const DGioMount);
|
||||||
|
@ -226,11 +240,3 @@ QExplicitlySharedDataPointer<DGioVolume> DGioMount::getVolume()
|
||||||
|
|
||||||
return QExplicitlySharedDataPointer<DGioVolume>(nullptr);
|
return QExplicitlySharedDataPointer<DGioVolume>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DGioMount::getSortKey()const
|
|
||||||
{
|
|
||||||
Q_D(const DGioMount);
|
|
||||||
|
|
||||||
return QString::fromStdString(d->getGmmMountInstance()->get_sort_key());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue