fix doctor lib

This commit is contained in:
Andrei Yankovich 2022-01-18 16:21:05 +03:00
parent 7dfac5326c
commit 517158ccd2
6 changed files with 24 additions and 36 deletions

View File

@ -35,7 +35,10 @@ option(DOCTOR_PILL_GUI "Enable gui qml model for build" ON)
option(DOCTOR_PILL_TESTS "Enable tests of this library" ON)
option(DOCTOR_PILL_EXAMPLE "Enable example app of this library" ON)
make_directory(Distro)
SET(TARGET_DIR "${CMAKE_SOURCE_DIR}/Distro")
file(MAKE_DIRECTORY ${TARGET_DIR})
if (DEFINED TARGET_PLATFORM_TOOLCHAIN)
if (${TARGET_PLATFORM_TOOLCHAIN} STREQUAL "wasm32")
set(DOCTOR_PILL_TESTS OFF)

View File

@ -12,44 +12,25 @@ set(CURRENT_PROJECT "${PROJECT_NAME}Eaxample")
file(GLOB SOURCE_CPP
"*.cpp"
"Private/*.cpp"
"*.qrc"
"Private/*.qrc"
)
if (${QT_VERSION_MAJOR})
file(GLOB SOURCE_QRC
"*.qrc"
"Private/*.qrc"
)
endif()
set(ALL_SOURCES ${SOURCE_CPP} ${SOURCE_QRC})
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Private")
updateGitVars()
if (${QT_VERSION_MAJOR} EQUAL 6)
qt_add_executable(${CURRENT_PROJECT} MANUAL_FINALIZATION ${ALL_SOURCES})
qt_add_executable(${CURRENT_PROJECT} MANUAL_FINALIZATION ${SOURCE_CPP})
else()
if (ANDROID)
add_library(${CURRENT_PROJECT} ${ALL_SOURCES})
add_library(${CURRENT_PROJECT} ${SOURCE_CPP})
else ()
add_executable(${CURRENT_PROJECT} ${ALL_SOURCES} )
add_executable(${CURRENT_PROJECT} ${SOURCE_CPP} )
endif()
endif()
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME})
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
target_include_directories(${CURRENT_PROJECT} PRIVATE ${PRIVATE_INCUDE_DIR})
SET(TARGET_DIR "${CMAKE_SOURCE_DIR}/Distro")
file(MAKE_DIRECTORY ${TARGET_DIR})
target_include_directories(${CURRENT_PROJECT} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
if(QT_VERSION_MAJOR EQUAL 6)
# Add This line if your project use the Quick module

View File

@ -12,11 +12,15 @@ add_definitions(-DDOCTOR_PILL_LIBRARY)
file(GLOB SOURCE_CPP
"*.cpp"
"*DoctorPillCore/*.cpp"
"*.h"
"*DoctorPillCore/*.h"
)
if (DOCTOR_PILL_GUI)
file(GLOB SOURCE_CPP_GUI
"*DoctorPillGui/*.cpp"
"*DoctorPillGui/*.h"
)
file(GLOB SOURCE_QRC

View File

@ -9,7 +9,6 @@
#define DOCTOR_H
#include "ipill.h"
#include "doctorpill_global.h"
#include <QSharedPointer>
namespace DP {

View File

@ -5,11 +5,10 @@
//# of this license document, but changing it is not allowed.
//#
#ifndef PILLSMODEL_H
#define PILLSMODEL_H
#ifndef DOCTORMODEL_H
#define DOCTORMODEL_H
#include <QAbstractListModel>
#include <QFuture>
#include <DoctorPillCore/doctor.h>
namespace DP {
@ -123,9 +122,9 @@ signals:
void stateChanged();
private slots:
void handleFixFailed(QList<QSharedPointer<iPill>>);
void handleFixSuccessful(QList<QSharedPointer<iPill>>);
void handleDiagnostcFinished(QList<QSharedPointer<iPill>>);
void handleFixFailed(QList<QSharedPointer<DP::iPill>>);
void handleFixSuccessful(QList<QSharedPointer<DP::iPill>>);
void handleDiagnostcFinished(QList<QSharedPointer<DP::iPill>>);
void handleDiagnosticProgressChanged(float);
private:
@ -136,8 +135,7 @@ private:
Doctor _doctor;
QHash<QString, Issue> _viewData;
double _progress;
QFuture<void> _diagnosticWork;
};
}
#endif // PILLSMODEL_H
#endif // DOCTORMODEL_H

View File

@ -5,9 +5,10 @@
//# of this license document, but changing it is not allowed.
//#
#ifndef DOCTOR_PILL_H
#define DOCTOR_PILL_H
#include "DoctorPillCore/doctor.h"
#include "DoctorPillCore/ipill.h"
#include "DoctorPillCore/doctortest.h"
#ifdef DOCTOR_PILL_GUI
@ -52,3 +53,5 @@ namespace DP {
*/
QString version();
}
#endif // DOCTOR_PILL_H