diff --git a/gio-qt/include/dgiofile.h b/gio-qt/include/dgiofile.h index 1b68aba..2b6a8d8 100644 --- a/gio-qt/include/dgiofile.h +++ b/gio-qt/include/dgiofile.h @@ -54,6 +54,7 @@ public: QString basename() const; QString path() const; QString uri() const; + QExplicitlySharedDataPointer createFileInfo(QString attr = "*", DGioFileQueryInfoFlags queryInfoFlags = FILE_QUERY_INFO_NONE); QExplicitlySharedDataPointer createFileSystemInfo(QString attr = "*"); QExplicitlySharedDataPointer createFileIterator(QString attr = "*", DGioFileQueryInfoFlags queryInfoFlags = FILE_QUERY_INFO_NONE); diff --git a/gio-qt/include/dgiofileinfo.h b/gio-qt/include/dgiofileinfo.h index 9200208..a75a324 100644 --- a/gio-qt/include/dgiofileinfo.h +++ b/gio-qt/include/dgiofileinfo.h @@ -51,6 +51,7 @@ public: QString displayName() const; DGioFileType fileType() const; quint64 fileSize() const; + QStringList themedIconNames() const; // filesystem info. bool fsReadOnly() const; diff --git a/gio-qt/source/dgiofileinfo.cpp b/gio-qt/source/dgiofileinfo.cpp index 4d42fa9..005573d 100644 --- a/gio-qt/source/dgiofileinfo.cpp +++ b/gio-qt/source/dgiofileinfo.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see . */ #include "dgiofileinfo.h" +#include "dgiohelper.h" #include @@ -127,6 +128,15 @@ quint64 DGioFileInfo::fileSize() const return static_cast(d->getGmmFileInfoInstance()->get_size()); } +QStringList DGioFileInfo::themedIconNames() const +{ + Q_D(const DGioFileInfo); + + Glib::RefPtr icon = d->getGmmFileInfoInstance()->get_icon(); + + return DGioPrivate::getThemedIconNames(icon); +} + bool DGioFileInfo::fsReadOnly() const { Q_D(const DGioFileInfo); diff --git a/test/tst_simplefileinfo.cpp b/test/tst_simplefileinfo.cpp index 14ac3e1..74aa869 100644 --- a/test/tst_simplefileinfo.cpp +++ b/test/tst_simplefileinfo.cpp @@ -31,6 +31,7 @@ void DGioSimpleFileInfoTest::testCase_RegularFile() QCOMPARE(file->basename(), tmpFileInfo.fileName()); QCOMPARE(file->path(), tmpFileInfo.absoluteFilePath()); QCOMPARE(fi->fileSize(), tmpFileInfo.size()); + QVERIFY(fi->themedIconNames().contains("text-plain")); // is this check okay? better approach? } QTEST_APPLESS_MAIN(DGioSimpleFileInfoTest)