diff --git a/ScreenPlay/src/installedlistmodel.cpp b/ScreenPlay/src/installedlistmodel.cpp index 5c8c29bd..9ef96071 100644 --- a/ScreenPlay/src/installedlistmodel.cpp +++ b/ScreenPlay/src/installedlistmodel.cpp @@ -144,10 +144,10 @@ QHash InstalledListModel::roleNames() const /*! \brief Append an ProjectFile to the list. */ -void InstalledListModel::append(const QJsonObject& obj, const QString& folderName, const QDateTime& lastModified) +void InstalledListModel::append(const QJsonObject& obj, const QString& folderName, const QDateTime& lastModified,const QDateTime& birthTime) { beginInsertRows(QModelIndex(), m_screenPlayFiles.size(), m_screenPlayFiles.size()); - m_screenPlayFiles.append(ProjectFile(obj, folderName, m_globalVariables->localStoragePath(), lastModified)); + m_screenPlayFiles.append(ProjectFile(obj, folderName, m_globalVariables->localStoragePath(), lastModified, birthTime)); endInsertRows(); } @@ -176,12 +176,14 @@ void InstalledListModel::loadInstalledContent() if (ScreenPlayUtil::getAvailableTypes().contains(obj->value("type").toString())) { if (ScreenPlayUtil::getAvailableTypes().contains(obj->value("type").toString(), Qt::CaseInsensitive)) { - append(*obj, item.baseName(), item.lastModified()); + append(*obj, item.baseName(), item.lastModified(),item.birthTime()); } + counter += 1; } } + } setCount(counter); emit installedLoadingFinished(); diff --git a/ScreenPlay/src/installedlistmodel.h b/ScreenPlay/src/installedlistmodel.h index d566d42d..dac72255 100644 --- a/ScreenPlay/src/installedlistmodel.h +++ b/ScreenPlay/src/installedlistmodel.h @@ -101,7 +101,7 @@ public slots: QVariantMap get(const QString& folderId) const; void loadInstalledContent(); - void append(const QJsonObject&, const QString&, const QDateTime& lastModified); + void append(const QJsonObject&, const QString&, const QDateTime& lastModified,const QDateTime& birthTime); void reset(); void init(); bool deinstallItemAt(const int index); diff --git a/ScreenPlayUtil/inc/public/ScreenPlayUtil/projectfile.h b/ScreenPlayUtil/inc/public/ScreenPlayUtil/projectfile.h index 045e45cc..3c65c6b1 100644 --- a/ScreenPlayUtil/inc/public/ScreenPlayUtil/projectfile.h +++ b/ScreenPlayUtil/inc/public/ScreenPlayUtil/projectfile.h @@ -42,6 +42,7 @@ #include #include #include +#include #include "ScreenPlayUtil/util.h" @@ -58,7 +59,8 @@ struct ProjectFile { const QJsonObject& obj, const QString& folderName, const QUrl& absolutePath, - const QDateTime& lastModified) + const QDateTime& lastModified, + const QDateTime& birthTime) { if (obj.contains("description")) @@ -100,6 +102,8 @@ struct ProjectFile { m_folderId = folderName; + + if (!obj.contains("type")) return; @@ -115,6 +119,7 @@ struct ProjectFile { } m_searchType = ScreenPlayUtil::getSearchTypeFromInstalledType(m_type); m_lastModified = lastModified; + m_birthTime = birthTime; } ProjectFile() { } @@ -136,5 +141,6 @@ struct ProjectFile { InstalledType::InstalledType m_type = InstalledType::InstalledType::Unknown; SearchType::SearchType m_searchType = SearchType::SearchType::All; QDateTime m_lastModified; + QDateTime m_birthTime; }; }