feat: add a defualt param

add default param("*") to DGioFil::cereateFileSystemInfo

 (#9)
This commit is contained in:
kegechen 2019-07-31 14:58:31 +08:00 committed by Gary Wang
parent 5b8374b4dd
commit 9f79b3d7cc
2 changed files with 3 additions and 3 deletions

View File

@ -32,7 +32,7 @@ public:
QString basename() const; QString basename() const;
QString path() const; QString path() const;
QString uri() const; QString uri() const;
QExplicitlySharedDataPointer<DGioFileInfo> createFileSystemInfo(); QExplicitlySharedDataPointer<DGioFileInfo> createFileSystemInfo(QString attr = "*");
QExplicitlySharedDataPointer<DGioFileIterator> createFileIterator(QString attr = "*", DGioFileQueryInfoFlags queryInfoFlags = FILE_QUERY_INFO_NONE); QExplicitlySharedDataPointer<DGioFileIterator> createFileIterator(QString attr = "*", DGioFileQueryInfoFlags queryInfoFlags = FILE_QUERY_INFO_NONE);
void createFileIteratorAsync(QString attr = "*", DGioFileQueryInfoFlags queryInfoFlags = FILE_QUERY_INFO_NONE); void createFileIteratorAsync(QString attr = "*", DGioFileQueryInfoFlags queryInfoFlags = FILE_QUERY_INFO_NONE);

View File

@ -165,12 +165,12 @@ QString DGioFile::uri() const
* *
* \return the created file system info object, or nullptr if create failed. * \return the created file system info object, or nullptr if create failed.
*/ */
QExplicitlySharedDataPointer<DGioFileInfo> DGioFile::createFileSystemInfo() QExplicitlySharedDataPointer<DGioFileInfo> DGioFile::createFileSystemInfo(QString attr)
{ {
Q_D(DGioFile); Q_D(DGioFile);
try { try {
Glib::RefPtr<FileInfo> gmmFileInfo = d->getGmmFileInstance()->query_filesystem_info("filesystem::*"); Glib::RefPtr<FileInfo> gmmFileInfo = d->getGmmFileInstance()->query_filesystem_info(attr.toStdString());
if (gmmFileInfo) { if (gmmFileInfo) {
QExplicitlySharedDataPointer<DGioFileInfo> fileInfoPtr(new DGioFileInfo(gmmFileInfo.release())); QExplicitlySharedDataPointer<DGioFileInfo> fileInfoPtr(new DGioFileInfo(gmmFileInfo.release()));
return fileInfoPtr; return fileInfoPtr;