1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-14 22:42:34 +02:00

Changes made Till Now.

This commit is contained in:
Debash Bora 2021-08-25 13:18:23 +05:30
parent 4d5032538a
commit df126bef09
3 changed files with 13 additions and 5 deletions

View File

@ -144,10 +144,10 @@ QHash<int, QByteArray> 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();

View File

@ -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);

View File

@ -42,6 +42,7 @@
#include <QUrl>
#include <QVariant>
#include <QVariantList>
#include <QDateTime>
#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;
};
}