From 2235a5d3d8e53cc77dd068c70da42f1be3df5775 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Mon, 9 Jul 2018 10:45:23 +0300 Subject: [PATCH] Cppcheck warning. Virtual function 'OpenSettings' is called from constructor 'VApplication(int&argc,char**argv)'. --HG-- branch : develop --- src/app/valentina/core/vapplication.cpp | 10 ++++------ src/libs/vmisc/vabstractapplication.cpp | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/app/valentina/core/vapplication.cpp b/src/app/valentina/core/vapplication.cpp index d2f64a169..f2f6dec9b 100644 --- a/src/app/valentina/core/vapplication.cpp +++ b/src/app/valentina/core/vapplication.cpp @@ -43,8 +43,6 @@ #include #include #include -#include -#include #include #include #include @@ -266,13 +264,9 @@ VApplication::VApplication(int &argc, char **argv) // Setting the Application version setApplicationVersion(APP_VERSION_STR); - OpenSettings(); - // making sure will create new instance...just in case we will ever do 2 objects of VApplication VCommandLine::Reset(); - LoadTranslation(QLocale().name());// By default the console version uses system locale VCommandLine::Get(*this); - undoStack = new QUndoStack(this); } //--------------------------------------------------------------------------------------------------------------------- @@ -555,6 +549,8 @@ void VApplication::ClearOldLogs() const //--------------------------------------------------------------------------------------------------------------------- void VApplication::InitOptions() { + OpenSettings(); + // Run creation log after sending crash report StartLogging(); @@ -565,6 +561,8 @@ void VApplication::InitOptions() qDebug()<<"Command-line arguments:"<GetLocale()); diff --git a/src/libs/vmisc/vabstractapplication.cpp b/src/libs/vmisc/vabstractapplication.cpp index 5bb27e04a..d4408a191 100644 --- a/src/libs/vmisc/vabstractapplication.cpp +++ b/src/libs/vmisc/vabstractapplication.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -44,7 +45,7 @@ //--------------------------------------------------------------------------------------------------------------------- VAbstractApplication::VAbstractApplication(int &argc, char **argv) :QApplication(argc, argv), - undoStack(nullptr), + undoStack(new QUndoStack(this)), mainWindow(nullptr), settings(nullptr), qtTranslator(nullptr),