1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-15 06:52:34 +02:00

Move projectfile to be used elsewhere

This commit is contained in:
Elias Steurer 2021-02-03 17:52:29 +01:00
parent 394237d11d
commit 3dd2ff0852
8 changed files with 16 additions and 20 deletions

View File

@ -55,7 +55,6 @@ set(headers
src/settings.h
src/profilelistmodel.h
src/profile.h
src/projectfile.h
src/installedlistfilter.h
src/projectsettingslistmodel.h
src/screenplaymanager.h

View File

@ -100,12 +100,12 @@ Popup {
id: delegate
focus: true
width: gridView.cellWidth - 30
customTitle: screenTitle
type: screenType
screenId: screenFolderId
absoluteStoragePath: screenAbsoluteStoragePath
publishedFileID: screenPublishedFileID
preview: screenPreview
customTitle: m_title
type: m_type
screenId: m_folderId
absoluteStoragePath: m_absoluteStoragePath
publishedFileID: m_publishedFileID
preview: m_preview
itemIndex: index
onItemClicked: {
for (let childItem in gridView.contentItem.children) {

View File

@ -21,7 +21,7 @@ Item {
property string absoluteStoragePath: ""
property string screenId: ""
property string preview: ""
property string type: ""
property var type
property bool hasMenuOpen: false
property var publishedFileID: 0
property int itemIndex
@ -103,7 +103,7 @@ Item {
Text {
id: name
text: screenTitle
text: m_title
color: Material.foreground
font.pointSize: 18
font.family: ScreenPlay.settings.font
@ -111,7 +111,7 @@ Item {
}
Text {
text: qsTr("Type: ") + screenType
text: qsTr("Type: ") + m_type
color: Material.foreground
font.family: ScreenPlay.settings.font
}

View File

@ -89,7 +89,7 @@ QVariant InstalledListModel::data(const QModelIndex& index, int role) const
if (!index.isValid())
return QVariant();
int row = index.row();
const int row = index.row();
if (row < 0 || row >= m_screenPlayFiles.count()) {
return QVariant();
}
@ -127,8 +127,7 @@ QVariant InstalledListModel::data(const QModelIndex& index, int role) const
*/
QHash<int, QByteArray> InstalledListModel::roleNames() const
{
static const QHash<int, QByteArray> roles {
return {
{ static_cast<int>(ScreenPlayItem::Title), "m_title" },
{ static_cast<int>(ScreenPlayItem::Type), "m_type" },
{ static_cast<int>(ScreenPlayItem::Preview), "m_preview" },
@ -140,7 +139,6 @@ QHash<int, QByteArray> InstalledListModel::roleNames() const
{ static_cast<int>(ScreenPlayItem::Tags), "m_tags" },
{ static_cast<int>(ScreenPlayItem::SearchType), "m_searchType" },
};
return roles;
}
/*!
@ -161,9 +159,9 @@ void InstalledListModel::loadInstalledContent()
QtConcurrent::run([this]() {
QFileInfoList list = QDir(m_globalVariables->localStoragePath().toLocalFile()).entryInfoList(QDir::NoDotAndDotDot | QDir::AllDirs);
QString projectItemPath;
int counter {};
int counter = 0;
for (auto&& item : list) {
for (const auto& item : list) {
projectItemPath = m_globalVariables->localStoragePath().toLocalFile() + "/" + item.baseName() + "/project.json";
if (auto obj = ScreenPlayUtil::openJsonFileToObject(projectItemPath)) {

View File

@ -55,7 +55,7 @@
#include "globalvariables.h"
#include "profilelistmodel.h"
#include "projectfile.h"
#include "ScreenPlayUtil/projectfile.h"
#include "util.h"
#include <memory>

View File

@ -45,7 +45,7 @@
#include "installedlistmodel.h"
#include "monitorlistmodel.h"
#include "profilelistmodel.h"
#include "projectfile.h"
#include "ScreenPlayUtil/projectfile.h"
#include "projectsettingslistmodel.h"
#include "screenplaywallpaper.h"
#include "screenplaywidget.h"

View File

@ -17,6 +17,7 @@ set(SOURCES
set(HEADER
inc/public/ScreenPlayUtil/util.h
inc/public/ScreenPlayUtil/contenttypes.h
inc/public/ScreenPlayUtil/projectfile.h
)
add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADER})

View File

@ -44,8 +44,6 @@
#include <QVariantList>
#include "ScreenPlayUtil/util.h"
#include "globalvariables.h"
#include "util.h"
/*!
\class ProjectFile