forked from mirrors/gio-qt
feat: add binding for g_file_find_enclosing_mount().
This commit is contained in:
parent
3f5bf7c081
commit
4fb8986d11
2 changed files with 16 additions and 0 deletions
|
@ -37,6 +37,7 @@ enum DGioFileQueryInfoFlag
|
|||
Q_DECLARE_FLAGS(DGioFileQueryInfoFlags, DGioFileQueryInfoFlag)
|
||||
|
||||
class DGioFileInfo;
|
||||
class DGioMount;
|
||||
class DGioFileIterator;
|
||||
class DGioMountOperation;
|
||||
class DGioFilePrivate;
|
||||
|
@ -62,6 +63,8 @@ public:
|
|||
|
||||
void mountEnclosingVolume(DGioMountOperation *dgioMountOperation);
|
||||
|
||||
QExplicitlySharedDataPointer<DGioMount> findEnclosingMount();
|
||||
|
||||
Q_SIGNALS:
|
||||
void createFileIteratorReady(QExplicitlySharedDataPointer<DGioFileIterator> iter);
|
||||
void mountEnclosingVolumeReady(bool result, QString msg);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "dgiofile.h"
|
||||
#include "dgiofileinfo.h"
|
||||
#include "dgiofileiterator.h"
|
||||
#include "dgiomount.h"
|
||||
|
||||
#include <glibmm/refptr.h>
|
||||
|
||||
|
@ -343,3 +344,15 @@ void DGioFile::mountEnclosingVolume(DGioMountOperation *dgioMountOperation)
|
|||
d->getGmmFileInstance()->mount_enclosing_volume(dgioMountOperation->getGIOMountOperationObj(),
|
||||
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 a new issue