mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-07 03:22:33 +01:00
Merge remote-tracking branch 'origin/161-refactor-screenplaywallpaper-to-no-longer-inherit-from-basewindow' into 161-refactor-screenplaywallpaper-to-no-longer-inherit-from-basewindow
This commit is contained in:
commit
c8f5665e35
@ -506,3 +506,5 @@ void App::setWizards(Wizards* wizards)
|
||||
emit wizardsChanged(m_wizards.get());
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_app.cpp"
|
||||
|
@ -360,3 +360,5 @@ void Create::abortAndCleanup()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_create.cpp"
|
||||
|
@ -766,3 +766,5 @@ QString CreateImportVideo::waitForFinished(
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_createimportvideo.cpp"
|
||||
|
@ -20,3 +20,5 @@ ScreenPlay::GlobalVariables::GlobalVariables(QObject* parent)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_globalvariables.cpp"
|
||||
|
@ -83,3 +83,5 @@ void InstalledListFilter::resetFilter()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_installedlistfilter.cpp"
|
||||
|
@ -280,3 +280,5 @@ void InstalledListModel::reset()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_installedlistmodel.cpp"
|
||||
|
@ -272,3 +272,5 @@ void MonitorListModel::reset()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_monitorlistmodel.cpp"
|
||||
|
@ -95,3 +95,5 @@ void ProfileListModel::append(const Profile& profile)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_profilelistmodel.cpp"
|
||||
|
@ -204,3 +204,5 @@ QHash<int, QByteArray> ProjectSettingsListModel::roleNames() const
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_projectsettingslistmodel.cpp"
|
||||
|
@ -737,3 +737,5 @@ void ScreenPlayManager::setIsKDEConnected(bool isKDEConnected)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_screenplaymanager.cpp"
|
||||
|
@ -282,3 +282,5 @@ bool ScreenPlayWallpaper::replace(
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_screenplaywallpaper.cpp"
|
||||
|
@ -133,3 +133,5 @@ QJsonObject ScreenPlayWidget::getActiveSettingsJson()
|
||||
return obj;
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_screenplaywidget.cpp"
|
||||
|
@ -125,3 +125,5 @@ bool ScreenPlay::SDKConnection::close()
|
||||
return m_socket->state() == QLocalSocket::UnconnectedState;
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_sdkconnection.cpp"
|
||||
|
@ -329,3 +329,5 @@ QString Settings::fixLanguageCode(const QString& languageCode)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_settings.cpp"
|
||||
|
@ -439,3 +439,5 @@ bool Util::copyPreviewThumbnail(QJsonObject& obj, const QString& previewThumbnai
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_util.cpp"
|
||||
|
@ -409,3 +409,5 @@ const std::optional<QString> Wizards::createTemporaryFolder() const
|
||||
return folderName;
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_wizards.cpp"
|
||||
|
@ -38,3 +38,5 @@ ShaderLibrary::ShaderLibrary(QQuickItem* parent)
|
||||
ShaderLibrary::~ShaderLibrary()
|
||||
{
|
||||
}
|
||||
|
||||
#include "moc_shaderlibrary.cpp"
|
||||
|
@ -58,3 +58,5 @@ void CPU::update()
|
||||
// publish result
|
||||
setUsage(currentUsage);
|
||||
}
|
||||
|
||||
#include "moc_cpu.cpp"
|
||||
|
@ -57,3 +57,5 @@ GPU::GPU(QObject* parent)
|
||||
setMaxFrequency(properties_of_device.max_frequency);
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_gpu.cpp"
|
||||
|
@ -48,3 +48,5 @@ IpAddress::IpAddress(QObject* parent)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_ipaddress.cpp"
|
||||
|
@ -42,3 +42,5 @@ void RAM::update()
|
||||
// set overall usage
|
||||
setUsage(memoryStatus.dwMemoryLoad);
|
||||
}
|
||||
|
||||
#include "moc_ram.cpp"
|
||||
|
@ -100,3 +100,5 @@ void Storage::loadStorageDevices()
|
||||
}
|
||||
endInsertRows();
|
||||
}
|
||||
|
||||
#include "moc_storage.cpp"
|
||||
|
@ -26,3 +26,5 @@ SysInfo::SysInfo(QQuickItem* parent)
|
||||
, m_uptime(std::make_unique<Uptime>())
|
||||
{
|
||||
}
|
||||
|
||||
#include "moc_sysinfo.cpp"
|
||||
|
@ -43,3 +43,5 @@ void Uptime::update()
|
||||
setYears(years);
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "moc_uptime.cpp"
|
||||
|
@ -27,3 +27,5 @@ void HttpFileServer::stopServer()
|
||||
m_thread.join();
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_httpfileserver.cpp"
|
||||
|
@ -47,8 +47,8 @@ int main(int argc, char* argv[])
|
||||
// For testing purposes when starting the ScreenPlayWallpaper directly.
|
||||
if (argumentList.length() == 1) {
|
||||
window.setActiveScreensList({ 0 });
|
||||
//window.setProjectPath("test");
|
||||
window.setProjectPath("C:/Program Files (x86)/Steam/steamapps/workshop/content/672870/particles");
|
||||
// window.setProjectPath("test");
|
||||
window.setProjectPath("C:/Program Files (x86)/Steam/steamapps/workshop/content/672870/2023_01_05_141855");
|
||||
window.setAppID("test");
|
||||
window.setVolume(1);
|
||||
window.setFillMode("fill");
|
||||
|
@ -243,3 +243,5 @@ void BaseWindow::setVideoCodec(ScreenPlay::VideoCodec::VideoCodec newVideoCodec)
|
||||
m_videoCodec = newVideoCodec;
|
||||
emit videoCodecChanged(newVideoCodec);
|
||||
}
|
||||
|
||||
#include "moc_basewindow.cpp"
|
||||
|
@ -141,3 +141,5 @@ void LinuxX11Window::terminate()
|
||||
{
|
||||
QCoreApplication::quit();
|
||||
}
|
||||
|
||||
#include "moc_linuxx11window.cpp"
|
||||
|
@ -12,3 +12,5 @@ void MacIntegration::SetBackgroundLevel(QWindow* window)
|
||||
{
|
||||
MacBridge::SetBackgroundLevel(window);
|
||||
}
|
||||
|
||||
#include "moc_macintegration.cpp"
|
||||
|
@ -55,3 +55,5 @@ void MacWindow::clearComponentCache()
|
||||
{
|
||||
m_window.engine()->clearComponentCache();
|
||||
}
|
||||
|
||||
#include "moc_macwindow.cpp"
|
||||
|
@ -58,3 +58,5 @@ WindowsDesktopProperties::WindowsDesktopProperties(QObject* parent)
|
||||
if (canParse)
|
||||
setWindowsVersion(value);
|
||||
}
|
||||
|
||||
#include "moc_windowsdesktopproperties.cpp"
|
||||
|
@ -507,3 +507,5 @@ void WinWindow::clearComponentCache()
|
||||
{
|
||||
m_window.engine()->clearComponentCache();
|
||||
}
|
||||
|
||||
#include "moc_winwindow.cpp"
|
||||
|
@ -144,3 +144,5 @@ QNetworkRequest ScreenPlayWeather::defaultRequest() const
|
||||
request.setHeader(QNetworkRequest::KnownHeaders::ContentTypeHeader, "application/json");
|
||||
return request;
|
||||
}
|
||||
|
||||
#include "moc_screenplayweather.cpp"
|
||||
|
@ -220,3 +220,5 @@ void WidgetWindow::setupLiveReloading()
|
||||
QObject::connect(&m_liveReloadLimiter, &QTimer::timeout, this, reloadQMLLambda);
|
||||
m_fileSystemWatcher.addPaths({ projectPath() });
|
||||
}
|
||||
|
||||
#include "moc_widgetwindow.cpp"
|
||||
|
@ -155,3 +155,5 @@ void InstalledListModel::reset()
|
||||
loadInstalledContent();
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_installedlistmodel.cpp"
|
||||
|
@ -12,3 +12,5 @@ ScreenPlayWorkshop::ScreenPlayWorkshop()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_screenplayworkshop.cpp"
|
||||
|
@ -81,3 +81,5 @@ void SteamAccount::onAvatarImageLoaded(AvatarImageLoaded_t* avatarImage)
|
||||
m_avatarLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_steamaccount.cpp"
|
||||
|
@ -8,3 +8,5 @@ SteamQMLImageProvider::SteamQMLImageProvider(QQuickItem* parent)
|
||||
setFlag(QQuickItem::ItemHasContents);
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_steamqmlimageprovider.cpp"
|
||||
|
@ -396,3 +396,5 @@ void SteamWorkshop::onRequestUserItemsReturned(SteamUGCQueryCompleted_t* pCallba
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
#include "moc_steamworkshop.cpp"
|
||||
|
@ -221,3 +221,5 @@ void SteamWorkshopItem::saveWorkshopID()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_steamworkshopitem.cpp"
|
||||
|
@ -76,3 +76,5 @@ void SteamWorkshopListModel::clear()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_steamworkshoplistmodel.cpp"
|
||||
|
63
Tools/check_moc_includes.py
Normal file
63
Tools/check_moc_includes.py
Normal file
@ -0,0 +1,63 @@
|
||||
#!/usr/bin/python3
|
||||
# SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
|
||||
import os
|
||||
from pathlib import Path
|
||||
import util
|
||||
import argparse
|
||||
|
||||
def find_files(path, pattern, file_extensions):
|
||||
files = []
|
||||
for root, dirnames, filenames in os.walk(path):
|
||||
for filename in filenames:
|
||||
if any(filename.endswith(ext) for ext in file_extensions):
|
||||
file_path = os.path.join(root, filename)
|
||||
with open(file_path) as f:
|
||||
contents = f.read()
|
||||
if any(substring in contents for substring in pattern):
|
||||
files.append(file_path)
|
||||
print(f"Found file {file_path}")
|
||||
return files
|
||||
|
||||
|
||||
def check_moc_include(filename, add_include=False):
|
||||
cppfile = Path(filename)
|
||||
# replace cppfile ending with .cpp
|
||||
cppfile = cppfile.with_suffix(".cpp").resolve()
|
||||
# check if cpp file exists
|
||||
if not cppfile.exists():
|
||||
# check if cpp file exists but 3 directories up and then in src
|
||||
cppfile = cppfile.joinpath(
|
||||
"../../../../src/{}".format(cppfile.name)).resolve()
|
||||
if not cppfile.exists():
|
||||
print(f"FAIL: {cppfile} does not exist")
|
||||
return
|
||||
print(f"Check {cppfile}")
|
||||
|
||||
with open(cppfile) as f:
|
||||
if '#include "moc_{}"'.format(os.path.basename(cppfile)) in f.read():
|
||||
print("OK: {} HAS moc include".format(cppfile))
|
||||
else:
|
||||
print("FAIL: {} MISSES moc include".format(cppfile))
|
||||
if add_include:
|
||||
with open(cppfile, 'a') as f:
|
||||
f.write("\n#include \"moc_{}\"\n".format(
|
||||
os.path.basename(cppfile)))
|
||||
print("Adding include...")
|
||||
else:
|
||||
print("Add this line to the end of the file:")
|
||||
print("#include \"moc_{}\"".format(os.path.basename(cppfile)))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Check if moc includes are present and add them if requested.")
|
||||
parser.add_argument('-a', '--addinclude', action='store_true',
|
||||
help='Automatically add missing moc includes')
|
||||
args = parser.parse_args()
|
||||
repo_root = util.repo_root_path()
|
||||
filenames = find_files(repo_root, ['Q_OBJECT', 'Q_GADGET', 'Q_NAMESPACE'], [
|
||||
'.cpp', '.h', "main.cpp"])
|
||||
for filename in filenames:
|
||||
check_moc_include(filename, args.addinclude)
|
||||
if not args.addinclude:
|
||||
print("Run this script with the '-a' or '--addinclude' flag to automatically add the moc includes")
|
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/python3
|
||||
# SPDX-License-Identifier: LicenseRef-EliasSteurerTachiom OR AGPL-3.0-only
|
||||
import os
|
||||
import util
|
||||
import sys
|
||||
|
Loading…
Reference in New Issue
Block a user