mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Fix werid qt moc Qt 6.4 compilation
See my last comment https://bugreports.qt.io/browse/QTBUG-106672 : while compiling class template member function 'QtPrivate::QMetaTypeInterface::CopyCtrFn QtPrivate::QMetaTypeForType<T>::getCopyCtr(void)'
This commit is contained in:
parent
d2cdd31fe1
commit
2ea55d9f1c
@ -103,17 +103,17 @@ public:
|
||||
Wizards* wizards() const { return m_wizards.get(); }
|
||||
|
||||
signals:
|
||||
void globalVariablesChanged(GlobalVariables* globalVariables);
|
||||
void screenPlayManagerChanged(ScreenPlayManager* screenPlayManager);
|
||||
void createChanged(Create* create);
|
||||
void utilChanged(Util* util);
|
||||
void settingsChanged(Settings* settings);
|
||||
void installedListModelChanged(InstalledListModel* installedListModel);
|
||||
void monitorListModelChanged(MonitorListModel* monitorListModel);
|
||||
void profileListModelChanged(ProfileListModel* profileListModel);
|
||||
void installedListFilterChanged(InstalledListFilter* installedListFilter);
|
||||
void globalVariablesChanged(ScreenPlay::GlobalVariables* globalVariables);
|
||||
void screenPlayManagerChanged(ScreenPlay::ScreenPlayManager* screenPlayManager);
|
||||
void createChanged(ScreenPlay::Create* create);
|
||||
void utilChanged(ScreenPlay::Util* util);
|
||||
void settingsChanged(ScreenPlay::Settings* settings);
|
||||
void installedListModelChanged(ScreenPlay::InstalledListModel* installedListModel);
|
||||
void monitorListModelChanged(ScreenPlay::MonitorListModel* monitorListModel);
|
||||
void profileListModelChanged(ScreenPlay::ProfileListModel* profileListModel);
|
||||
void installedListFilterChanged(ScreenPlay::InstalledListFilter* installedListFilter);
|
||||
void mainWindowEngineChanged(QQmlApplicationEngine* mainWindowEngine);
|
||||
void wizardsChanged(Wizards* wizards);
|
||||
void wizardsChanged(ScreenPlay::Wizards* wizards);
|
||||
|
||||
public slots:
|
||||
QString version() const;
|
||||
|
@ -58,14 +58,15 @@
|
||||
#include "ScreenPlayUtil/contenttypes.h"
|
||||
#include "ScreenPlayUtil/util.h"
|
||||
|
||||
#include "qarchive_enums.hpp"
|
||||
#include "qarchivediskcompressor.hpp"
|
||||
#include "qarchivediskextractor.hpp"
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <optional>
|
||||
|
||||
namespace QArchive {
|
||||
class DiskCompressor;
|
||||
class DiskExtractor;
|
||||
}
|
||||
|
||||
namespace ScreenPlay {
|
||||
|
||||
template <typename T>
|
||||
@ -87,20 +88,20 @@ T QStringToEnum(const QString& key, const T defaultValue)
|
||||
|
||||
class Util : public QObject {
|
||||
Q_OBJECT
|
||||
QML_ELEMENT
|
||||
|
||||
Q_PROPERTY(QString debugMessages READ debugMessages NOTIFY debugMessagesChanged)
|
||||
Q_PROPERTY(QArchive::DiskCompressor* compressor READ compressor NOTIFY compressorChanged)
|
||||
Q_PROPERTY(QArchive::DiskExtractor* extractor READ extractor NOTIFY extractorChanged)
|
||||
|
||||
public:
|
||||
explicit Util(QNetworkAccessManager* networkAccessManager, QObject* parent = nullptr);
|
||||
Util();
|
||||
~Util();
|
||||
|
||||
QString debugMessages() const { return m_debugMessages; }
|
||||
QArchive::DiskCompressor* compressor() const { return m_compressor.get(); }
|
||||
QArchive::DiskExtractor* extractor() const { return m_extractor.get(); }
|
||||
|
||||
signals:
|
||||
void extractionProgressChanged(QString file, int proc, int total, qint64 br, qint64 bt);
|
||||
void extractionFinished();
|
||||
void compressionProgressChanged(QString file, int proc, int total, qint64 br, qint64 bt);
|
||||
void compressionFinished();
|
||||
|
||||
void requestNavigation(QString nav);
|
||||
void requestNavigationActive(bool isActive);
|
||||
void requestToggleWallpaperConfiguration();
|
||||
@ -108,15 +109,13 @@ signals:
|
||||
void allLicenseLoaded(QString licensesText);
|
||||
void allDataProtectionLoaded(QString dataProtectionText);
|
||||
void debugMessagesChanged(QString debugMessages);
|
||||
void compressorChanged(QArchive::DiskCompressor* compressor);
|
||||
void extractorChanged(QArchive::DiskExtractor* extractor);
|
||||
|
||||
public slots:
|
||||
void copyToClipboard(const QString& text) const;
|
||||
void openFolderInExplorer(const QString& url) const;
|
||||
QString toLocal(const QString& url) const;
|
||||
bool exportProject(QString& contentPath, QString& exportFileName);
|
||||
bool importProject(QString& archivePath, QString extractionPath);
|
||||
bool exportProject(QString contentPath, QString exportFileName);
|
||||
bool importProject(QString archivePath, QString extractionPath);
|
||||
void requestAllLicenses() ;
|
||||
void requestDataProtection();
|
||||
bool fileExists(const QString& filePath) const;
|
||||
@ -154,25 +153,8 @@ public slots:
|
||||
emit debugMessagesChanged(m_debugMessages);
|
||||
}
|
||||
|
||||
void setCompressor(QArchive::DiskCompressor* compressor)
|
||||
{
|
||||
if (m_compressor.get() == compressor)
|
||||
return;
|
||||
m_compressor.reset(compressor);
|
||||
emit compressorChanged(m_compressor.get());
|
||||
}
|
||||
|
||||
void setExtractor(QArchive::DiskExtractor* extractor)
|
||||
{
|
||||
if (m_extractor.get() == extractor)
|
||||
return;
|
||||
m_extractor.reset(extractor);
|
||||
emit extractorChanged(m_extractor.get());
|
||||
}
|
||||
|
||||
private:
|
||||
QNetworkAccessManager* m_networkAccessManager { nullptr };
|
||||
|
||||
QString m_debugMessages {};
|
||||
QFuture<void> m_requestAllLicensesFuture;
|
||||
std::unique_ptr<QArchive::DiskCompressor> m_compressor;
|
||||
|
@ -366,11 +366,11 @@ Item {
|
||||
}
|
||||
Connections {
|
||||
id: exportConnections
|
||||
target: App.util.compressor
|
||||
function onProgress(file, proc, total, br, bt) {
|
||||
target: App.util
|
||||
function onCompressionProgressChanged(file, proc, total, br, bt) {
|
||||
exportProgressBar.value = (br * 100 / bt)
|
||||
}
|
||||
function onFinished() {
|
||||
function onCompressionFinished() {
|
||||
exportFileProgressDialog.close()
|
||||
}
|
||||
}
|
||||
@ -436,8 +436,9 @@ Item {
|
||||
closePolicy: Popup.NoAutoClose
|
||||
onClosed: importProgressBar.value = 0
|
||||
onOpened: {
|
||||
App.util.importProject(dropArea.filePath,
|
||||
const success = App.util.importProject(dropArea.filePath,
|
||||
App.globalVariables.localStoragePath)
|
||||
print("finished", success)
|
||||
dropArea.filePath = ""
|
||||
}
|
||||
ColumnLayout {
|
||||
@ -458,11 +459,11 @@ Item {
|
||||
}
|
||||
Connections {
|
||||
id: importConnections
|
||||
target: App.util.extractor
|
||||
function onProgress(file, proc, total, br, bt) {
|
||||
target: App.util
|
||||
function onExtractionProgressChanged(file, proc, total, br, bt) {
|
||||
importProgressBar.value = (br * 100 / bt)
|
||||
}
|
||||
function onFinished() {
|
||||
function onExtractionFinished() {
|
||||
importDialog.close()
|
||||
}
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ void App::init()
|
||||
using std::make_shared, std::make_unique;
|
||||
|
||||
// Util should be created as first so we redirect qDebugs etc. into the log
|
||||
m_util = std::make_unique<Util>(&m_networkAccessManager);
|
||||
m_util = make_unique<Util>();
|
||||
m_globalVariables = make_shared<GlobalVariables>();
|
||||
m_installedListModel = make_shared<InstalledListModel>(m_globalVariables);
|
||||
m_installedListFilter = make_shared<InstalledListFilter>(m_installedListModel);
|
||||
|
@ -1,5 +1,9 @@
|
||||
#include "ScreenPlay/util.h"
|
||||
|
||||
#include "qarchive_enums.hpp"
|
||||
#include "qarchivediskcompressor.hpp"
|
||||
#include "qarchivediskextractor.hpp"
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#include <sentry.h>
|
||||
#endif
|
||||
@ -15,16 +19,22 @@ namespace ScreenPlay {
|
||||
/*!
|
||||
\brief Constructor.
|
||||
*/
|
||||
Util::Util(QNetworkAccessManager* networkAccessManager, QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_networkAccessManager { networkAccessManager }
|
||||
, m_extractor { std::make_unique<QArchive::DiskExtractor>() }
|
||||
, m_compressor { std::make_unique<QArchive::DiskCompressor>() }
|
||||
Util::Util()
|
||||
: QObject(nullptr)
|
||||
{
|
||||
utilPointer = this;
|
||||
// Fix log access vilation on quit
|
||||
utilPointer = this;
|
||||
QObject::connect(QGuiApplication::instance(), &QGuiApplication::aboutToQuit, this, []() { utilPointer = nullptr; });
|
||||
|
||||
m_extractor = std::make_unique<QArchive::DiskExtractor>();
|
||||
m_compressor = std::make_unique<QArchive::DiskCompressor>();
|
||||
|
||||
QObject::connect(m_extractor.get(), &QArchive::DiskExtractor::progress, this, &Util::extractionProgressChanged);
|
||||
QObject::connect(m_extractor.get(), &QArchive::DiskExtractor::finished, this, &Util::extractionFinished);
|
||||
|
||||
QObject::connect(m_compressor.get(), &QArchive::DiskCompressor::progress, this, &Util::compressionProgressChanged);
|
||||
QObject::connect(m_compressor.get(), &QArchive::DiskCompressor::finished, this, &Util::compressionFinished);
|
||||
|
||||
// In release mode redirect messages to logging otherwhise we break the nice clickable output :(
|
||||
#ifdef QT_NO_DEBUG
|
||||
qInstallMessageHandler(Util::logToGui);
|
||||
@ -35,6 +45,12 @@ Util::Util(QNetworkAccessManager* networkAccessManager, QObject* parent)
|
||||
qSetMessagePattern("%{if-category}%{category}: %{endif}%{message}\n Loc: [%{file}:%{line}]");
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief Needed only for QArchive unique_ptr
|
||||
https://stackoverflow.com/questions/28386185/cant-use-stdunique-ptrt-with-t-being-a-forward-declaration
|
||||
*/
|
||||
Util::~Util() { }
|
||||
|
||||
/*!
|
||||
\brief Copies the given string to the clipboard.
|
||||
*/
|
||||
@ -108,7 +124,7 @@ QString Util::toLocal(const QString& url) const
|
||||
/*!
|
||||
\brief Exports a given project into a .screenplay 7Zip file.
|
||||
*/
|
||||
bool Util::exportProject(QString& contentPath, QString& exportFileName)
|
||||
bool Util::exportProject(QString contentPath, QString exportFileName)
|
||||
{
|
||||
m_compressor->clear();
|
||||
contentPath = ScreenPlayUtil::toLocal(contentPath);
|
||||
@ -142,7 +158,7 @@ bool Util::exportProject(QString& contentPath, QString& exportFileName)
|
||||
\brief Imports a given project from a .screenplay zip file. The argument extractionPath
|
||||
must be copied otherwise it will get reset in qml before extracting.
|
||||
*/
|
||||
bool Util::importProject(QString& archivePath, QString extractionPath)
|
||||
bool Util::importProject(QString archivePath, QString extractionPath)
|
||||
{
|
||||
m_extractor->clear();
|
||||
archivePath = ScreenPlayUtil::toLocal(archivePath);
|
||||
|
Loading…
Reference in New Issue
Block a user