From 7bf435c144fc77d9aee00abf2857ae10634a538e 2017-06-06 14:16:11 From: mperrinel Date: 2017-06-06 14:16:11 Subject: [PATCH] Refactoring of app module to avoir vera++ warning and to dispatch sources files in the corrects paths --- diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 1076386..cfa7c6d 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -3,10 +3,13 @@ SET(EXECUTABLE_NAME "sciqlop") SCIQLOP_SET_TO_PARENT_SCOPE(EXECUTABLE_NAME) SET(SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/) -SET(INCLUDE_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/include) -SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/src) +SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include") +SET(UI_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/ui) SET(RES_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/resources) +# Include gui directory +include_directories("${INCLUDES_DIR}") + # # Find Qt modules # @@ -35,24 +38,19 @@ list(APPEND SHARED_LIBRARIES ${SQPCORE_SHARED_LIBRARIES}) #get_property(sqpcoreLocation TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY LOCATION) list(APPEND SHARED_LIBRARIES_FROM_TARGETS ${sqpcoreLocation}) +# Ui files +FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) + # # Compile the application # FILE (GLOB_RECURSE APPLICATION_SOURCES - ${SOURCES_DIR}/*.c - ${SOURCES_DIR}/*.cpp - ${SOURCES_DIR}/*.h) - -# Headers files (.h) -FILE (GLOB_RECURSE PROJECT_HEADERS ${INCLUDE_FOLDER}/*.h) + ${INCLUDES_DIR}/*.h + ${SOURCES_DIR}/*.c + ${SOURCES_DIR}/*.cpp + ${SOURCES_DIR}/*.h + ${PROJECT_FORMS}) -# Ui files -FILE (GLOB_RECURSE PROJECT_FORMS ${UI_FOLDER}/*.ui) - -# Resources files -FILE (GLOB_RECURSE PROJECT_RESOURCES ${RES_FOLDER}/*.qrc) - -# Retrieve resources files FILE (GLOB_RECURSE APPLICATION_RESOURCES ${RES_FOLDER}/*.qrc) QT5_ADD_RESOURCES(RCC_HDRS ${APPLICATION_RESOURCES} ) diff --git a/app/src/mainwindow.h b/app/include/MainWindow.h similarity index 78% rename from app/src/mainwindow.h rename to app/include/MainWindow.h index a349a21..4a6256e 100644 --- a/app/src/mainwindow.h +++ b/app/include/MainWindow.h @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------------ --- This file is a part of the QLop Software --- Copyright (C) 2015, Plasma Physics Laboratory - CNRS +-- This file is a part of the SciQLop Software +-- Copyright (C) 2017, Plasma Physics Laboratory - CNRS -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ /*-- Author : Alexis Jeandet -- Mail : alexis.jeandet@member.fsf.org ----------------------------------------------------------------------------*/ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H +#ifndef SCIQLOP_MAINWINDOW_H +#define SCIQLOP_MAINWINDOW_H #include #include @@ -32,29 +32,29 @@ //#include "../Core/qlopservice.h" //#include "../Core/qlopgui.h" +#include namespace Ui { class MainWindow; -} +} // namespace Ui + class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); + virtual ~MainWindow(); public slots: protected: void changeEvent(QEvent *e); private: - Ui::MainWindow *ui; - QList m_progress; - int *m_progressThreadIds; - QWidget *m_progressWidget; - QVBoxLayout *m_progressLayout; + std::unique_ptr m_Ui; + // QWidget *m_progressWidget; + // QVBoxLayout *m_progressLayout; // QList m_qlopServices; }; -#endif // MAINWINDOW_H +#endif // SCIQLOP_MAINWINDOW_H diff --git a/app/src/mainwindow.cpp b/app/src/MainWindow.cpp similarity index 91% rename from app/src/mainwindow.cpp rename to app/src/MainWindow.cpp index 44f6c66..31077c2 100644 --- a/app/src/mainwindow.cpp +++ b/app/src/MainWindow.cpp @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------------ --- This file is a part of the QLop Software --- Copyright (C) 2015, Plasma Physics Laboratory - CNRS +-- This file is a part of the SciQLop Software +-- Copyright (C) 2017, Plasma Physics Laboratory - CNRS -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by @@ -19,8 +19,8 @@ /*-- Author : Alexis Jeandet -- Mail : alexis.jeandet@member.fsf.org ----------------------------------------------------------------------------*/ -#include "mainwindow.h" -#include "ui_mainwindow.h" +#include "MainWindow.h" +#include "ui_MainWindow.h" #include #include #include @@ -38,9 +38,9 @@ //#include "amdatxtcodec.h" //#include -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) +MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_Ui(new Ui::MainWindow) { - ui->setupUi(this); + m_Ui->setupUi(this); /* QLopGUI::registerMenuBar(menuBar()); this->setWindowIcon(QIcon(":/sciqlopLOGO.svg")); this->m_progressWidget = new QWidget(); @@ -86,7 +86,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi MainWindow::~MainWindow() { - delete ui; } @@ -95,7 +94,7 @@ void MainWindow::changeEvent(QEvent *e) QMainWindow::changeEvent(e); switch (e->type()) { case QEvent::LanguageChange: - ui->retranslateUi(this); + m_Ui->retranslateUi(this); break; default: break; diff --git a/app/src/mainwindow.ui b/app/ui/MainWindow.ui similarity index 100% rename from app/src/mainwindow.ui rename to app/ui/MainWindow.ui diff --git a/app/vera-exclusions/exclusions.txt b/app/vera-exclusions/exclusions.txt index f6204f8..372a58a 100644 --- a/app/vera-exclusions/exclusions.txt +++ b/app/vera-exclusions/exclusions.txt @@ -1,3 +1,4 @@ -# Ignore false positive relative to sqpApp macro +# Ignore false positive relative to App macro +\.h:\d+:.IPSIS_S04.*found: Ui SqpApplication\.h:\d+:.IPSIS_S03.*found: sqpApp SqpApplication\.h:\d+:.IPSIS_S04_VARIABLE.*found: sqpApp