1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-10-06 09:17:07 +02:00

File formatting

This commit is contained in:
debashbora 2021-10-15 20:43:44 +05:30
parent 43cf3584d2
commit 143323de8f
2 changed files with 16 additions and 17 deletions

View File

@ -157,7 +157,7 @@ QVariant InstalledListModel::data(const QModelIndex& index, int role) const
case static_cast<int>(ScreenPlayItem::SearchType): case static_cast<int>(ScreenPlayItem::SearchType):
return QVariant::fromValue(m_screenPlayFiles.at(row).m_searchType); return QVariant::fromValue(m_screenPlayFiles.at(row).m_searchType);
case static_cast<int>(ScreenPlayItem::SizeBytes): case static_cast<int>(ScreenPlayItem::SizeBytes):
return QVariant::fromValue(m_screenPlayFiles.at(row).m_Size); return QVariant::fromValue(m_screenPlayFiles.at(row).m_sizeBytes);
} }
qWarning() << "Unable to fetch value for row type:" << role; qWarning() << "Unable to fetch value for row type:" << role;
@ -182,7 +182,7 @@ QHash<int, QByteArray> InstalledListModel::roleNames() const
{ static_cast<int>(ScreenPlayItem::SearchType), "m_searchType" }, { static_cast<int>(ScreenPlayItem::SearchType), "m_searchType" },
{ static_cast<int>(ScreenPlayItem::IsNew), "m_isNew" }, { static_cast<int>(ScreenPlayItem::IsNew), "m_isNew" },
{ static_cast<int>(ScreenPlayItem::LastModified), "m_lastModified" }, { static_cast<int>(ScreenPlayItem::LastModified), "m_lastModified" },
{ static_cast<int>(ScreenPlayItem::SizeBytes),"m_Size"} { static_cast<int>(ScreenPlayItem::SizeBytes), "m_sizeBytes" }
}; };
} }
@ -231,7 +231,6 @@ void InstalledListModel::loadInstalledContent()
sizeBytes += QFileInfo(projectIterator.next()).size(); sizeBytes += QFileInfo(projectIterator.next()).size();
} }
} }
if (auto obj = ScreenPlayUtil::openJsonFileToObject(absoluteFilePath)) { if (auto obj = ScreenPlayUtil::openJsonFileToObject(absoluteFilePath)) {
@ -284,7 +283,7 @@ QVariantMap InstalledListModel::get(const QString& folderName) const
map.insert("m_publishedFileID", item.m_publishedFileID); map.insert("m_publishedFileID", item.m_publishedFileID);
map.insert("m_isNew", item.m_isNew); map.insert("m_isNew", item.m_isNew);
map.insert("m_lastModified", item.m_lastModified); map.insert("m_lastModified", item.m_lastModified);
map.insert("m_Size",item.m_Size); map.insert("m_Size", item.m_sizeBytes);
return map; return map;
} }
} }

View File

@ -119,7 +119,7 @@ struct ProjectFile {
m_searchType = ScreenPlayUtil::getSearchTypeFromInstalledType(m_type); m_searchType = ScreenPlayUtil::getSearchTypeFromInstalledType(m_type);
m_isNew = isNew; m_isNew = isNew;
m_lastModified = lastModified; m_lastModified = lastModified;
m_Size = sizeBytes; m_sizeBytes = sizeBytes;
} }
ProjectFile() { } ProjectFile() { }
@ -142,6 +142,6 @@ struct ProjectFile {
SearchType::SearchType m_searchType = SearchType::SearchType::All; SearchType::SearchType m_searchType = SearchType::SearchType::All;
bool m_isNew = false; bool m_isNew = false;
QDateTime m_lastModified; QDateTime m_lastModified;
int m_Size; int m_sizeBytes;
}; };
} }