Merge branch 'alter-interface' into 'master'

feat: new interface for eject

See merge request dde-v20/gio-qt!1
This commit is contained in:
王子冲 2019-08-05 13:30:10 +08:00
commit 4c412bb5bf
2 changed files with 16 additions and 10 deletions

View file

@ -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;

View file

@ -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());
}