From 8866878c2cb612d655eadcc102e002e84a8bdb52 2017-06-05 07:37:07 From: Alexandre Leroux Date: 2017-06-05 07:37:07 Subject: [PATCH] Minor fixes - Using braces instead of parenthesis - Using english for logs - Ignoring Version files --- diff --git a/.gitignore b/.gitignore index 237993e..f0dfc68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build/ CMakeLists.txt.user /.project +core/src/Version.cpp +core/include/Version.h diff --git a/app/src/main.cpp b/app/src/main.cpp index 216e576..0812bf2 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -27,8 +27,7 @@ int main(int argc, char *argv[]) { - int ad; - SqpApplication a(argc, argv); + SqpApplication a{argc, argv}; SqpApplication::setOrganizationName("LPP"); SqpApplication::setOrganizationDomain("lpp.fr"); SqpApplication::setApplicationName("SciQLop"); diff --git a/core/include/Common/spimpl.h b/core/include/Common/spimpl.h index b4d5e04..7f6e8be 100644 --- a/core/include/Common/spimpl.h +++ b/core/include/Common/spimpl.h @@ -89,8 +89,9 @@ using default_copier_t = typename default_copier::type; template struct is_default_manageable - : public std::integral_constant >::value - && std::is_same >::value> { + : public std::integral_constant >::value + && std::is_same >::value> { }; } @@ -131,10 +132,11 @@ public: } template - impl_ptr(U *u, typename std::enable_if::value - && is_default_manageable::value, - dummy_t_>::type - = dummy_t_()) SPIMPL_NOEXCEPT + impl_ptr(U *u, + typename std::enable_if::value + && is_default_manageable::value, + dummy_t_>::type + = dummy_t_()) SPIMPL_NOEXCEPT : impl_ptr(u, &details::default_delete, &details::default_copy) { } @@ -151,12 +153,12 @@ public: #ifdef SPIMPL_HAS_AUTO_PTR template - impl_ptr(std::auto_ptr &&u, typename std::enable_if::value - && is_default_manageable::value, - dummy_t_>::type - = dummy_t_()) SPIMPL_NOEXCEPT - : ptr_(u.release(), &details::default_delete), - copier_(&details::default_copy) + impl_ptr(std::auto_ptr &&u, + typename std::enable_if::value + && is_default_manageable::value, + dummy_t_>::type + = dummy_t_()) SPIMPL_NOEXCEPT : ptr_(u.release(), &details::default_delete), + copier_(&details::default_copy) { } #endif diff --git a/core/include/DataSource/DataSourceController.h b/core/include/DataSource/DataSourceController.h index 94e9d7f..b889390 100644 --- a/core/include/DataSource/DataSourceController.h +++ b/core/include/DataSource/DataSourceController.h @@ -1,8 +1,6 @@ #ifndef SCIQLOP_DATASOURCECONTROLLER_H #define SCIQLOP_DATASOURCECONTROLLER_H -#include "DataSourceController.h" - #include #include diff --git a/core/src/DataSource/DataSourceController.cpp b/core/src/DataSource/DataSourceController.cpp index 40ac74d..cdb58a1 100644 --- a/core/src/DataSource/DataSourceController.cpp +++ b/core/src/DataSource/DataSourceController.cpp @@ -1,4 +1,4 @@ -#include "DataSource/DataSourceController.h" +#include #include #include @@ -10,31 +10,29 @@ Q_LOGGING_CATEGORY(LOG_DataSourceController, "DataSourceController") class DataSourceController::DataSourceControllerPrivate { public: - DataSourceControllerPrivate() {} - QMutex m_WorkingMutex; }; DataSourceController::DataSourceController(QObject *parent) : impl{spimpl::make_unique_impl()} { - qCDebug(LOG_DataSourceController()) << tr("Construction du DataSourceController") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController construction") << QThread::currentThread(); } DataSourceController::~DataSourceController() { - qCDebug(LOG_DataSourceController()) << tr("Desctruction du DataSourceController") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController destruction") << QThread::currentThread(); this->waitForFinish(); } void DataSourceController::initialize() { - qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController") - << QThread::currentThread(); + qCDebug(LOG_DataSourceController()) + << tr("DataSourceController init") << QThread::currentThread(); impl->m_WorkingMutex.lock(); - qCDebug(LOG_DataSourceController()) << tr("initialize du DataSourceController END"); + qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END"); } void DataSourceController::finalize() @@ -44,5 +42,5 @@ void DataSourceController::finalize() void DataSourceController::waitForFinish() { - QMutexLocker locker(&impl->m_WorkingMutex); + QMutexLocker locker{&impl->m_WorkingMutex}; } diff --git a/gui/include/SqpApplication.h b/gui/include/SqpApplication.h index 997d97a..8b37273 100644 --- a/gui/include/SqpApplication.h +++ b/gui/include/SqpApplication.h @@ -12,10 +12,10 @@ Q_DECLARE_LOGGING_CATEGORY(LOG_SqpApplication) /** * @brief The SqpApplication class aims to make the link between SciQlop - * and its plugins. This is the intermediate class that SciQlop have to use - * in the way to connect a data source. Please first use load method to intialize + * and its plugins. This is the intermediate class that SciQlop has to use + * in the way to connect a data source. Please first use load method to initialize * a plugin specified by its metadata name (JSON plugin source) then others specifics - * method will ba able to access it. + * method will be able to access it. * You can load a data source driver plugin then create a data source. */ diff --git a/gui/src/SqpApplication.cpp b/gui/src/SqpApplication.cpp index c510e53..6c6f28d 100644 --- a/gui/src/SqpApplication.cpp +++ b/gui/src/SqpApplication.cpp @@ -7,10 +7,14 @@ Q_LOGGING_CATEGORY(LOG_SqpApplication, "SqpApplication") class SqpApplication::SqpApplicationPrivate { public: - SqpApplicationPrivate() {} + SqpApplicationPrivate() : m_DataSourceController{std::make_unique()} + { + m_DataSourceController->moveToThread(&m_DataSourceControllerThread); + } + virtual ~SqpApplicationPrivate() { - qCInfo(LOG_SqpApplication()) << tr("Desctruction du SqpApplicationPrivate"); + qCInfo(LOG_SqpApplication()) << tr("SqpApplicationPrivate destruction"); m_DataSourceControllerThread.quit(); m_DataSourceControllerThread.wait(); } @@ -21,12 +25,9 @@ public: SqpApplication::SqpApplication(int &argc, char **argv) - : QApplication(argc, argv), impl{spimpl::make_unique_impl()} + : QApplication{argc, argv}, impl{spimpl::make_unique_impl()} { - qCInfo(LOG_SqpApplication()) << tr("Construction du SqpApplication"); - - impl->m_DataSourceController = std::make_unique(); - impl->m_DataSourceController->moveToThread(&impl->m_DataSourceControllerThread); + qCInfo(LOG_SqpApplication()) << tr("SqpApplication construction"); connect(&impl->m_DataSourceControllerThread, &QThread::started, impl->m_DataSourceController.get(), &DataSourceController::initialize);