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

Call format-cpp

This commit is contained in:
Elias Steurer 2020-10-29 19:17:37 +01:00
parent 8e117cebfd
commit e9d333ba2e
27 changed files with 47 additions and 77 deletions

View File

@ -234,7 +234,7 @@ void Create::createWallpaperStart(QString videoPath, Create::VideoCodec codec)
codecs.append("vp9");
}
m_createImportVideoThread = new QThread();
m_createImportVideoThread = new QThread(this);
m_createImportVideo = new CreateImportVideo(videoPath, workingDir(), codecs);
connect(m_createImportVideo, &CreateImportVideo::processOutput, this, [this](QString text) {
appendFfmpegOutput(text + "\n");
@ -328,7 +328,7 @@ void Create::saveWallpaper(QString title, QString description, QString filePath,
obj.insert("type", "videoWallpaper");
QJsonArray tagsJsonArray;
for (const QString &tmp : tags) {
for (const QString& tmp : tags) {
tagsJsonArray.append(tmp);
}
obj.insert("tags", tagsJsonArray);

View File

@ -60,10 +60,6 @@ class CreateImportVideo : public QObject {
public:
CreateImportVideo() { }
~CreateImportVideo()
{
qDebug() << "CreateImportVideo";
}
CreateImportVideo(QObject* parent = nullptr);
explicit CreateImportVideo(const QString& videoPath, const QString& exportPath, const QStringList& codecs, QObject* parent = nullptr);
@ -163,8 +159,6 @@ private:
QString m_ffprobeExecutable;
QString m_ffmpegExecutable;
};
}
Q_DECLARE_METATYPE(ScreenPlay::CreateImportVideo::ImportVideoState)

View File

@ -96,7 +96,7 @@ public:
}
public slots:
QVariantMap get(const QString &folderId) const;
QVariantMap get(const QString& folderId) const;
void loadInstalledContent();
void append(const QJsonObject&, const QString&);

View File

@ -37,7 +37,6 @@
#include <QString>
#include <QUrl>
namespace ScreenPlay {
/*!
@ -49,7 +48,7 @@ namespace ScreenPlay {
*/
struct Profile {
Profile() {}
Profile() { }
Profile(const QUrl& absolutePath,
const QString& id,
const QString& version,

View File

@ -60,7 +60,7 @@ public:
QVariant m_value;
virtual QJsonObject getItemSettings() = 0;
public slots:
virtual void setData(const QJsonObject& obj){}
virtual void setData(const QJsonObject& obj) { }
};
struct SliderItem : public IListItem {

View File

@ -280,7 +280,7 @@ bool ScreenPlayManager::removeWallpaperAt(int index)
return false;
}
bool ScreenPlayManager::removeApp(const QString &appID)
bool ScreenPlayManager::removeApp(const QString& appID)
{
emit requestSaveProfiles();

View File

@ -59,7 +59,6 @@
#include "globalvariables.h"
namespace ScreenPlay {
template <typename T>
@ -144,7 +143,6 @@ public slots:
emit debugMessagesChanged(m_debugMessages);
}
private:
QNetworkAccessManager* m_networkAccessManager { nullptr };

View File

@ -36,11 +36,10 @@
#include <QQmlExtensionPlugin>
class ScreenPlay_SDKPlugin : public QQmlExtensionPlugin
{
class ScreenPlay_SDKPlugin : public QQmlExtensionPlugin {
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
void registerTypes(const char *uri);
void registerTypes(const char* uri);
};

View File

@ -3,9 +3,8 @@
#include <qqml.h>
void ScreenPlay_SDKPlugin::registerTypes(const char *uri)
void ScreenPlay_SDKPlugin::registerTypes(const char* uri)
{
// @uri ScreenPlay.screenplaysdk
qmlRegisterType<ScreenPlaySDK>(uri, 1, 0, "ScreenPlaySDK");
}

View File

@ -13,6 +13,6 @@ QObject* ScreenPlayShaderLibrarySingleton(QQmlEngine* engine, QJSEngine* scriptE
void ScreenPlayShaderPlugin::registerTypes(const char* uri)
{
qmlRegisterType(QUrl("qrc:/ShaderWrapper/ShadertoyShader.qml"), "ScreenPlay.ShadertoyShader", 1,0, "ShadertoyShader");
qmlRegisterType(QUrl("qrc:/ShaderWrapper/ShadertoyShader.qml"), "ScreenPlay.ShadertoyShader", 1, 0, "ShadertoyShader");
qmlRegisterSingletonType<ShaderLibrary>(uri, 1, 0, "ShaderLibrary", ScreenPlayShaderLibrarySingleton);
}

View File

@ -19,4 +19,3 @@ ShaderLibrary::ShaderLibrary(QQuickItem* parent)
ShaderLibrary::~ShaderLibrary()
{
}

View File

@ -1,17 +1,17 @@
#include "cpu.h"
#include <QtQml/qqml.h>
#include "mathhelper.h"
#include <QtQml/qqml.h>
#define STATUS_SUCCESS 0
#define STATUS_INFO_LENGTH_MISMATCH 0xC0000004
#define STATUS_SUCCESS 0
#define STATUS_INFO_LENGTH_MISMATCH 0xC0000004
CPU::CPU(QObject *parent) : QObject(parent)
CPU::CPU(QObject* parent)
: QObject(parent)
{
connect(&m_updateTimer,&QTimer::timeout,this,&CPU::update);
connect(&m_updateTimer, &QTimer::timeout, this, &CPU::update);
m_updateTimer.start(m_tickRate);
}
void CPU::update()
{
BOOL status;
@ -19,7 +19,8 @@ void CPU::update()
// get new CPU's idle/kernel/user time
status = GetSystemTimes(&ftIdleTime, &ftKernelTime, &ftUserTime);
if (status == 0) return;
if (status == 0)
return;
//convert times to uint by appending low and high bits
uint64_t newIdleTime = FileTimeToInt64(ftIdleTime);

View File

@ -34,10 +34,10 @@
#pragma once
#include <QObject>
#include <QDebug>
#include <QTimer>
#include <QObject>
#include <QString>
#include <QTimer>
#ifdef Q_OS_WIN
#include <qt_windows.h>
@ -50,11 +50,9 @@ class CPU : public QObject {
Q_PROPERTY(float usage READ usage NOTIFY usageChanged)
Q_PROPERTY(int tickRate READ tickRate WRITE setTickRate NOTIFY tickRateChanged)
public:
explicit CPU(QObject* parent = nullptr);
float usage() const
{
return m_usage;
@ -71,7 +69,6 @@ signals:
void tickRateChanged(int tickRate);
public slots:
void update();
@ -95,8 +92,6 @@ public slots:
emit tickRateChanged(m_tickRate);
}
private:
float m_usage = 0.0f;

View File

@ -38,8 +38,9 @@
#include <QObject>
uint64_t FileTimeToInt64( const FILETIME& ft ) {
ULARGE_INTEGER uli = { };
uint64_t FileTimeToInt64(const FILETIME& ft)
{
ULARGE_INTEGER uli = {};
uli.LowPart = ft.dwLowDateTime;
uli.HighPart = ft.dwHighDateTime;
return uli.QuadPart;

View File

@ -1,12 +1,12 @@
#include "ram.h"
#include "sysinfoapi.h"
#include <QtQml/qqml.h>
#include <qmetatype.h>
#include "sysinfoapi.h"
RAM::RAM(QObject* parent)
: QObject(parent)
{
connect(&m_updateTimer,&QTimer::timeout,this,&RAM::update);
connect(&m_updateTimer, &QTimer::timeout, this, &RAM::update);
m_updateTimer.start(m_tickRate);
}
@ -16,7 +16,7 @@ void RAM::update()
MEMORYSTATUSEX memoryStatus;
memoryStatus.dwLength = sizeof(MEMORYSTATUSEX); //needed for internal api
bool success = GlobalMemoryStatusEx(&memoryStatus);
if(!success)
if (!success)
return;
//Apply total values

View File

@ -34,8 +34,8 @@
#pragma once
#include <QObject>
#include <QDebug>
#include <QObject>
#include <QTimer>
#ifdef Q_OS_WIN
#include <qt_windows.h>
@ -113,7 +113,6 @@ signals:
void usedPagingMemoryChanged(DWORDLONG usedPagingMemory);
void totalPhysicalMemoryChanged(DWORDLONG totalPhysicalMemory);
void totalVirtualMemoryChanged(DWORDLONG totalVirtualMemory);
@ -134,7 +133,7 @@ private slots:
void setUsedPhysicalMemory(DWORDLONG usedPhysicalMemory)
{
if(usedPhysicalMemory == m_usedPhysicalMemory)
if (usedPhysicalMemory == m_usedPhysicalMemory)
return;
m_usedPhysicalMemory = usedPhysicalMemory;
@ -143,7 +142,7 @@ private slots:
void setTotalPhysicalMemory(DWORDLONG totalPhysicalMemory)
{
if(totalPhysicalMemory == m_totalPhysicalMemory)
if (totalPhysicalMemory == m_totalPhysicalMemory)
return;
m_totalPhysicalMemory = totalPhysicalMemory;
@ -152,7 +151,7 @@ private slots:
void setUsedVirtualMemory(DWORDLONG usedVirtualMemory)
{
if(usedVirtualMemory == m_usedVirtualMemory)
if (usedVirtualMemory == m_usedVirtualMemory)
return;
m_usedVirtualMemory = usedVirtualMemory;
@ -161,7 +160,7 @@ private slots:
void setTotalVirtualMemory(DWORDLONG totalVirtualMemory)
{
if(totalVirtualMemory == m_totalVirtualMemory)
if (totalVirtualMemory == m_totalVirtualMemory)
return;
m_totalVirtualMemory = totalVirtualMemory;
@ -170,7 +169,7 @@ private slots:
void setUsedPagingMemory(DWORDLONG usedPagingMemory)
{
if(usedPagingMemory == m_usedPagingMemory)
if (usedPagingMemory == m_usedPagingMemory)
return;
m_usedPagingMemory = usedPagingMemory;
@ -179,7 +178,7 @@ private slots:
void setTotalPagingMemory(DWORDLONG totalPagingMemory)
{
if(totalPagingMemory == m_totalPagingMemory)
if (totalPagingMemory == m_totalPagingMemory)
return;
m_totalPagingMemory = totalPagingMemory;
@ -197,6 +196,4 @@ private:
QTimer m_updateTimer;
int m_tickRate = 1000;
};

View File

@ -15,5 +15,4 @@ void ScreenPlaySysInfoPlugin::registerTypes(const char* uri)
{
// @uri ScreenPlay.Sysinfo
qmlRegisterSingletonType<SysInfo>(uri, 1, 0, "SysInfo", ScreenPlaySysInfoSingleton);
}

View File

@ -36,11 +36,10 @@
#include <QQmlExtensionPlugin>
class ScreenPlaySysInfoPlugin : public QQmlExtensionPlugin
{
class ScreenPlaySysInfoPlugin : public QQmlExtensionPlugin {
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
void registerTypes(const char *uri);
void registerTypes(const char* uri);
};

View File

@ -88,7 +88,7 @@ void Storage::reset()
void Storage::loadStorageDevices()
{
beginInsertRows(QModelIndex(), 0, rowCount());
for (const auto &storage : QStorageInfo::mountedVolumes()) {
for (const auto& storage : QStorageInfo::mountedVolumes()) {
m_storageInfoList.append(storage);
}
endInsertRows();

View File

@ -63,7 +63,6 @@ public:
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
public slots:
void refresh();
void reset();
@ -71,6 +70,7 @@ signals:
private:
void loadStorageDevices();
private:
QVector<QStorageInfo> m_storageInfoList;
};

View File

@ -67,7 +67,6 @@ public:
return m_storage.get();
}
signals:
void ramChanged(RAM* ram);
void cpuChanged(CPU* cpu);

View File

@ -120,8 +120,8 @@ MainWindow::MainWindow(int screenAt, QString projectPath, QString id, QString de
UpdateWindow(m_hwnd);
UpdateWindow(m_worker_hwnd);
SetWindowLongPtr(m_hwnd, GWL_STYLE, WS_CHILDWINDOW);
SetWindowLongPtr(m_hwnd, GWL_EXSTYLE, WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_NOACTIVATE );
// ShowWindow(m_hwnd, SW_SHOW);
SetWindowLongPtr(m_hwnd, GWL_EXSTYLE, WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_NOACTIVATE);
// ShowWindow(m_hwnd, SW_SHOW);
//MoveWindow(m_hwnd, screen->geometry().x(), screen->geometry().y() , screen->size().width(), screen->size().height(), true);
qDebug() << "Create window: " << screenAt << ", x: " << screen->geometry().x() << "y: " << screen->geometry().y() << screen->size().width() << screen->size().height();
@ -158,7 +158,7 @@ MainWindow::MainWindow(int screenAt, QString projectPath, QString id, QString de
}
});
QTimer::singleShot(3000,[=](){
QTimer::singleShot(3000, [=]() {
ShowWindow(m_hwnd, SW_SHOWNOACTIVATE);
});
@ -176,7 +176,7 @@ void MainWindow::init()
// This needs to be set in this order or
// the window will be opened as fullscreen!
//ShowWindow(m_hwnd, SW_SHOWDEFAULT);
//ShowWindow(m_hwnd, SW_SHOWDEFAULT);
#endif
}
void MainWindow::destroyThis()

View File

@ -45,9 +45,9 @@
#include <QQmlEngine>
#include <QScreen>
#include <QSharedPointer>
#include <QTimer>
#include <QWindow>
#include <QtGlobal>
#include <QTimer>
#include <QtQuick/QQuickView>
#include <QtQuick/QQuickWindow>

View File

@ -28,8 +28,6 @@ BaseWindow::BaseWindow(QString projectFilePath, const QVector<int> activeScreens
QJsonDocument configJsonDocument;
QJsonParseError parseError;
projectFile.setFileName(projectFilePath + "/project.json");
projectFile.open(QIODevice::ReadOnly | QIODevice::Text);
QString projectConfig = projectFile.readAll();

View File

@ -1,6 +1,5 @@
#include "linuxwindow.h"
LinuxWindow::LinuxWindow(QVector<int> activeScreensList, QString projectPath, QString id, QString volume, const QString fillmode, const bool checkWallpaperVisible, QObject* parent)
: BaseWindow(projectPath, activeScreensList, checkWallpaperVisible)
{
@ -42,8 +41,6 @@ LinuxWindow::LinuxWindow(QVector<int> activeScreensList, QString projectPath, QS
m_window.setTextRenderType(QQuickWindow::TextRenderType::NativeTextRendering);
m_window.setSource(QUrl("qrc:/mainWindow.qml"));
// WARNING: Setting Window flags must be called *here*!
Qt::WindowFlags flags = m_window.flags();
m_window.setFlags(flags | Qt::FramelessWindowHint | Qt::Desktop);

View File

@ -1,11 +1,11 @@
#include "macwindow.h"
MacWindow::MacWindow(
const QVector<int> &activeScreensList,
const QString &projectPath,
const QString &id,
const QString &volume,
const QString &fillmode)
const QVector<int>& activeScreensList,
const QString& projectPath,
const QString& id,
const QString& volume,
const QString& fillmode)
: BaseWindow(projectPath, activeScreensList, false)
{
setAppID(id);
@ -28,8 +28,6 @@ MacWindow::MacWindow(
//setupWallpaperForMultipleScreens(activeScreensList);
}
// WARNING: Setting Window flags must be called *here*!
Qt::WindowFlags flags = m_window.flags();
m_window.setFlags(flags | Qt::FramelessWindowHint | Qt::Desktop);
@ -44,7 +42,6 @@ MacWindow::MacWindow(
MacIntegration* macIntegration = new MacIntegration(this);
macIntegration->SetBackgroundLevel(&m_window);
}
void MacWindow::setVisible(bool show)

View File

@ -13,7 +13,6 @@ int main(int argc, char* argv[])
QStringList argumentList = app.arguments();
// If we start with only one argument (path, appID, type),
// it means we want to test a single widget
if (argumentList.length() == 1) {