mirror of
https://github.com/linuxdeepin/gio-qt.git
synced 2024-12-26 06:56:25 +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()));
|
||||
return fileInfoPtr;
|
||||
}
|
||||
} catch (Glib::Error error) {
|
||||
} catch (const Glib::Error &error) {
|
||||
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);
|
||||
|
||||
|
|
|
@ -4,6 +4,17 @@
|
|||
#include <QObject>
|
||||
#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 {
|
||||
class FileInfo;
|
||||
}
|
||||
|
@ -16,8 +27,11 @@ public:
|
|||
explicit DGioFileInfo(Gio::FileInfo *gmmFileInfoInfoPtr, QObject *parent = nullptr);
|
||||
~DGioFileInfo();
|
||||
|
||||
bool isReadOnly() const;
|
||||
// file info
|
||||
DGioFileType fileType() const;
|
||||
|
||||
// filesystem info.
|
||||
bool fsReadOnly() const;
|
||||
quint64 fsTotalBytes() const;
|
||||
quint64 fsUsedBytes() const;
|
||||
quint64 fsFreeBytes() const;
|
||||
|
|
|
@ -86,7 +86,7 @@ DGioMount *DGioMount::createFromPath(QString path, QObject *parent)
|
|||
if (gmmMount) {
|
||||
return new DGioMount(gmmMount.release(), parent);
|
||||
}
|
||||
} catch (Glib::Error error) {
|
||||
} catch (const Glib::Error &error) {
|
||||
qDebug() << QString::fromStdString(error.what().raw());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue