mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-06 19:12:30 +01:00
Changes made Till Now.
This commit is contained in:
parent
4d5032538a
commit
df126bef09
@ -144,10 +144,10 @@ QHash<int, QByteArray> InstalledListModel::roleNames() const
|
|||||||
/*!
|
/*!
|
||||||
\brief Append an ProjectFile to the list.
|
\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());
|
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();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,12 +176,14 @@ void InstalledListModel::loadInstalledContent()
|
|||||||
|
|
||||||
if (ScreenPlayUtil::getAvailableTypes().contains(obj->value("type").toString())) {
|
if (ScreenPlayUtil::getAvailableTypes().contains(obj->value("type").toString())) {
|
||||||
if (ScreenPlayUtil::getAvailableTypes().contains(obj->value("type").toString(), Qt::CaseInsensitive)) {
|
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;
|
counter += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
setCount(counter);
|
setCount(counter);
|
||||||
emit installedLoadingFinished();
|
emit installedLoadingFinished();
|
||||||
|
@ -101,7 +101,7 @@ public slots:
|
|||||||
QVariantMap get(const QString& folderId) const;
|
QVariantMap get(const QString& folderId) const;
|
||||||
|
|
||||||
void loadInstalledContent();
|
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 reset();
|
||||||
void init();
|
void init();
|
||||||
bool deinstallItemAt(const int index);
|
bool deinstallItemAt(const int index);
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
#include <QVariantList>
|
#include <QVariantList>
|
||||||
|
#include <QDateTime>
|
||||||
|
|
||||||
#include "ScreenPlayUtil/util.h"
|
#include "ScreenPlayUtil/util.h"
|
||||||
|
|
||||||
@ -58,7 +59,8 @@ struct ProjectFile {
|
|||||||
const QJsonObject& obj,
|
const QJsonObject& obj,
|
||||||
const QString& folderName,
|
const QString& folderName,
|
||||||
const QUrl& absolutePath,
|
const QUrl& absolutePath,
|
||||||
const QDateTime& lastModified)
|
const QDateTime& lastModified,
|
||||||
|
const QDateTime& birthTime)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (obj.contains("description"))
|
if (obj.contains("description"))
|
||||||
@ -100,6 +102,8 @@ struct ProjectFile {
|
|||||||
|
|
||||||
m_folderId = folderName;
|
m_folderId = folderName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!obj.contains("type"))
|
if (!obj.contains("type"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -115,6 +119,7 @@ struct ProjectFile {
|
|||||||
}
|
}
|
||||||
m_searchType = ScreenPlayUtil::getSearchTypeFromInstalledType(m_type);
|
m_searchType = ScreenPlayUtil::getSearchTypeFromInstalledType(m_type);
|
||||||
m_lastModified = lastModified;
|
m_lastModified = lastModified;
|
||||||
|
m_birthTime = birthTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectFile() { }
|
ProjectFile() { }
|
||||||
@ -136,5 +141,6 @@ struct ProjectFile {
|
|||||||
InstalledType::InstalledType m_type = InstalledType::InstalledType::Unknown;
|
InstalledType::InstalledType m_type = InstalledType::InstalledType::Unknown;
|
||||||
SearchType::SearchType m_searchType = SearchType::SearchType::All;
|
SearchType::SearchType m_searchType = SearchType::SearchType::All;
|
||||||
QDateTime m_lastModified;
|
QDateTime m_lastModified;
|
||||||
|
QDateTime m_birthTime;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user