mirror of
https://github.com/linuxdeepin/gio-qt.git
synced 2024-11-10 12:03:46 +01:00
parent
6d6c50e40e
commit
fbe5ddfe93
@ -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 New Issue
Block a user