chore(general): Move QClipboardProxy to StatusQ

This commit is contained in:
Michał Cieślak 2023-02-06 10:09:14 +01:00 committed by Michał
parent ad34694826
commit 8f25b93f96
9 changed files with 44 additions and 3 deletions

View File

@ -30,6 +30,29 @@ file(GLOB_RECURSE TEST_QML_FILES "qmlTests/*.qml")
set(PROJECT_LIB "${PROJECT_NAME}Lib")
set(STATUSQ_DIR ../ui/StatusQ)
set(STATUSQ_HEADERS
${STATUSQ_DIR}/include/StatusQ/statuswindow.h
${STATUSQ_DIR}/include/StatusQ/typesregistration.h
${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h
)
set(STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow.cpp
${STATUSQ_DIR}/src/typesregistration.cpp
${STATUSQ_DIR}/src/QClipboardProxy.cpp
)
if(APPLE)
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_osx.mm
)
else()
list(APPEND STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow_other.cpp
)
endif()
add_library(${PROJECT_LIB}
cachecleaner.cpp cachecleaner.h
directorieswatcher.cpp directorieswatcher.h
@ -40,8 +63,11 @@ add_library(${PROJECT_LIB}
figmalinkssource.cpp figmalinkssource.h
modelutils.cpp modelutils.h
sectionsdecoratormodel.cpp sectionsdecoratormodel.h
${STATUSQ_HEADERS} ${STATUSQ_SOURCES}
)
target_include_directories(${PROJECT_LIB} PUBLIC ${STATUSQ_DIR}/include)
add_executable(
${PROJECT_NAME}
main.cpp

View File

@ -8,6 +8,8 @@
#include "figmalinkssource.h"
#include "sectionsdecoratormodel.h"
#include "StatusQ/typesregistration.h"
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
@ -42,6 +44,8 @@ int main(int argc, char *argv[])
qmlRegisterType<FigmaLinksSource>("Storybook", 1, 0, "FigmaLinksSource");
qmlRegisterUncreatableType<FigmaLinks>("Storybook", 1, 0, "FigmaLinks", "");
registerStatusQTypes();
auto watcherFactory = [additionalImportPaths](QQmlEngine*, QJSEngine*) {
auto watcher = new DirectoriesWatcher();
watcher->addPaths(additionalImportPaths);

View File

@ -1,6 +1,7 @@
#pragma once
#include <QObject>
#include <QImage>
class QClipboard;
class QJSEngine;

View File

@ -15,11 +15,13 @@ set(STATUSQ_DIR ..)
set(STATUSQ_HEADERS
${STATUSQ_DIR}/include/StatusQ/statuswindow.h
${STATUSQ_DIR}/include/StatusQ/typesregistration.h
${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h
)
set(STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow.cpp
${STATUSQ_DIR}/src/typesregistration.cpp
${STATUSQ_DIR}/src/QClipboardProxy.cpp
)
if(APPLE)

View File

@ -1,4 +1,4 @@
#include "DOtherSide/Status/QClipboardProxy.h"
#include "StatusQ/QClipboardProxy.h"
#include <QBuffer>
#include <QClipboard>

View File

@ -1,10 +1,13 @@
#include "StatusQ/typesregistration.h"
#include "StatusQ/statuswindow.h"
#include "StatusQ/QClipboardProxy.h"
#include <QQmlEngine>
void registerStatusQTypes()
{
qmlRegisterType<StatusWindow>("StatusQ", 0 , 1, "StatusWindow");
qmlRegisterSingletonType<QClipboardProxy>("StatusQ", 0 , 1, "QClipboardProxy",
&QClipboardProxy::qmlInstance);
}

View File

@ -4,6 +4,8 @@ import QtQuick.Layouts 1.13
import QtQuick.Dialogs 1.3
import DotherSide 0.1
import StatusQ 0.1
import utils 1.0
import shared 1.0

View File

@ -22,11 +22,13 @@ macro(add_target name type)
set(STATUSQ_HEADERS
${STATUSQ_DIR}/include/StatusQ/statuswindow.h
${STATUSQ_DIR}/include/StatusQ/typesregistration.h
${STATUSQ_DIR}/include/StatusQ/QClipboardProxy.h
)
set(STATUSQ_SOURCES
${STATUSQ_DIR}/src/statuswindow.cpp
${STATUSQ_DIR}/src/typesregistration.cpp
${STATUSQ_DIR}/src/QClipboardProxy.cpp
)
if(APPLE)

View File

@ -72,10 +72,10 @@
#include "DOtherSide/Status/OSNotification.h"
#include "DOtherSide/Status/KeychainManager.h"
#include "DOtherSide/Status/SoundManager.h"
#include "DOtherSide/Status/QClipboardProxy.h"
#include "DOtherSide/Status/RXValidator.h"
#include "StatusQ/statuswindow.h"
#include "StatusQ/QClipboardProxy.h"
#ifdef MONITORING
#include <QProcessEnvironment>
@ -91,8 +91,9 @@ void register_meta_types()
qRegisterMetaType<QVector<int>>();
qmlRegisterType<StatusWindow>("StatusQ", 0 , 1, "StatusWindow");
qmlRegisterSingletonType<QClipboardProxy>("StatusQ", 0 , 1, "QClipboardProxy", &QClipboardProxy::qmlInstance);
qmlRegisterType<StatusSyntaxHighlighter>("DotherSide", 0 , 1, "StatusSyntaxHighlighter");
qmlRegisterSingletonType<QClipboardProxy>("DotherSide", 0 , 1, "QClipboardProxy", &QClipboardProxy::qmlInstance);
qmlRegisterType<RXValidator>("DotherSide", 0, 1, "RXValidator");
#ifdef MONITORING