mirror of
https://github.com/linuxdeepin/gio-qt.git
synced 2024-11-10 12:03:46 +01:00
feat: add binding for g_file_find_enclosing_mount().
This commit is contained in:
parent
3f5bf7c081
commit
4fb8986d11
@ -37,6 +37,7 @@ enum DGioFileQueryInfoFlag
|
|||||||
Q_DECLARE_FLAGS(DGioFileQueryInfoFlags, DGioFileQueryInfoFlag)
|
Q_DECLARE_FLAGS(DGioFileQueryInfoFlags, DGioFileQueryInfoFlag)
|
||||||
|
|
||||||
class DGioFileInfo;
|
class DGioFileInfo;
|
||||||
|
class DGioMount;
|
||||||
class DGioFileIterator;
|
class DGioFileIterator;
|
||||||
class DGioMountOperation;
|
class DGioMountOperation;
|
||||||
class DGioFilePrivate;
|
class DGioFilePrivate;
|
||||||
@ -62,6 +63,8 @@ public:
|
|||||||
|
|
||||||
void mountEnclosingVolume(DGioMountOperation *dgioMountOperation);
|
void mountEnclosingVolume(DGioMountOperation *dgioMountOperation);
|
||||||
|
|
||||||
|
QExplicitlySharedDataPointer<DGioMount> findEnclosingMount();
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void createFileIteratorReady(QExplicitlySharedDataPointer<DGioFileIterator> iter);
|
void createFileIteratorReady(QExplicitlySharedDataPointer<DGioFileIterator> iter);
|
||||||
void mountEnclosingVolumeReady(bool result, QString msg);
|
void mountEnclosingVolumeReady(bool result, QString msg);
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "dgiofile.h"
|
#include "dgiofile.h"
|
||||||
#include "dgiofileinfo.h"
|
#include "dgiofileinfo.h"
|
||||||
#include "dgiofileiterator.h"
|
#include "dgiofileiterator.h"
|
||||||
|
#include "dgiomount.h"
|
||||||
|
|
||||||
#include <glibmm/refptr.h>
|
#include <glibmm/refptr.h>
|
||||||
|
|
||||||
@ -343,3 +344,15 @@ void DGioFile::mountEnclosingVolume(DGioMountOperation *dgioMountOperation)
|
|||||||
d->getGmmFileInstance()->mount_enclosing_volume(dgioMountOperation->getGIOMountOperationObj(),
|
d->getGmmFileInstance()->mount_enclosing_volume(dgioMountOperation->getGIOMountOperationObj(),
|
||||||
sigc::mem_fun(d, &DGioFilePrivate::slot_mountEnclosingVolumeResult));
|
sigc::mem_fun(d, &DGioFilePrivate::slot_mountEnclosingVolumeResult));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QExplicitlySharedDataPointer<DGioMount> DGioFile::findEnclosingMount()
|
||||||
|
{
|
||||||
|
Q_D(DGioFile);
|
||||||
|
QExplicitlySharedDataPointer<DGioMount> ret;
|
||||||
|
try {
|
||||||
|
ret = new DGioMount(d->getGmmFileInstance()->find_enclosing_mount().release());
|
||||||
|
} catch (const Glib::Error &error) {
|
||||||
|
qDebug() << QString::fromStdString(error.what().raw());
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user