mirror of
https://github.com/linuxdeepin/gio-qt.git
synced 2024-12-27 07:26:09 +01:00
parent
6d6c50e40e
commit
fbe5ddfe93
4 changed files with 25 additions and 4 deletions
|
@ -132,7 +132,7 @@ QExplicitlySharedDataPointer<DGioFileInfo> DGioFile::createFileSystemInfo()
|
||||||
QExplicitlySharedDataPointer<DGioFileInfo> fileInfoPtr(new DGioFileInfo(gmmFileInfo.release()));
|
QExplicitlySharedDataPointer<DGioFileInfo> fileInfoPtr(new DGioFileInfo(gmmFileInfo.release()));
|
||||||
return fileInfoPtr;
|
return fileInfoPtr;
|
||||||
}
|
}
|
||||||
} catch (Glib::Error error) {
|
} catch (const Glib::Error &error) {
|
||||||
qDebug() << QString::fromStdString(error.what().raw());
|
qDebug() << QString::fromStdString(error.what().raw());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,14 @@ DGioFileInfo::~DGioFileInfo()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DGioFileInfo::isReadOnly() const
|
DGioFileType DGioFileInfo::fileType() const
|
||||||
|
{
|
||||||
|
Q_D(const DGioFileInfo);
|
||||||
|
|
||||||
|
return static_cast<DGioFileType>(d->getGmmFileInfoInstance()->get_file_type());
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DGioFileInfo::fsReadOnly() const
|
||||||
{
|
{
|
||||||
Q_D(const DGioFileInfo);
|
Q_D(const DGioFileInfo);
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,17 @@
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSharedData>
|
#include <QSharedData>
|
||||||
|
|
||||||
|
enum DGioFileType {
|
||||||
|
FILE_TYPE_NOT_KNOWN,
|
||||||
|
FILE_TYPE_REGULAR,
|
||||||
|
FILE_TYPE_DIRECTORY,
|
||||||
|
FILE_TYPE_SYMBOLIC_LINK,
|
||||||
|
FILE_TYPE_SPECIAL,
|
||||||
|
FILE_TYPE_SHORTCUT,
|
||||||
|
FILE_TYPE_MOUNTABLE
|
||||||
|
};
|
||||||
|
Q_ENUMS(DGioFileType);
|
||||||
|
|
||||||
namespace Gio {
|
namespace Gio {
|
||||||
class FileInfo;
|
class FileInfo;
|
||||||
}
|
}
|
||||||
|
@ -16,8 +27,11 @@ public:
|
||||||
explicit DGioFileInfo(Gio::FileInfo *gmmFileInfoInfoPtr, QObject *parent = nullptr);
|
explicit DGioFileInfo(Gio::FileInfo *gmmFileInfoInfoPtr, QObject *parent = nullptr);
|
||||||
~DGioFileInfo();
|
~DGioFileInfo();
|
||||||
|
|
||||||
bool isReadOnly() const;
|
// file info
|
||||||
|
DGioFileType fileType() const;
|
||||||
|
|
||||||
|
// filesystem info.
|
||||||
|
bool fsReadOnly() const;
|
||||||
quint64 fsTotalBytes() const;
|
quint64 fsTotalBytes() const;
|
||||||
quint64 fsUsedBytes() const;
|
quint64 fsUsedBytes() const;
|
||||||
quint64 fsFreeBytes() const;
|
quint64 fsFreeBytes() const;
|
||||||
|
|
|
@ -86,7 +86,7 @@ DGioMount *DGioMount::createFromPath(QString path, QObject *parent)
|
||||||
if (gmmMount) {
|
if (gmmMount) {
|
||||||
return new DGioMount(gmmMount.release(), parent);
|
return new DGioMount(gmmMount.release(), parent);
|
||||||
}
|
}
|
||||||
} catch (Glib::Error error) {
|
} catch (const Glib::Error &error) {
|
||||||
qDebug() << QString::fromStdString(error.what().raw());
|
qDebug() << QString::fromStdString(error.what().raw());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue