From adb3be027c1c4650d701b943680c886b2aeab1b1 Mon Sep 17 00:00:00 2001
From: Mikhail Svechnikov <m.svechnikov@fz-juelich.de>
Date: Wed, 7 Sep 2022 14:33:31 +0200
Subject: [PATCH] constants: rename

---
 GUI/View/Fit/JobMessagePanel.cpp     | 10 +++++-----
 GUI/View/Main/ActionManager.cpp      |  8 ++++----
 GUI/View/Main/MainWindow.cpp         | 18 +++++++++---------
 GUI/View/Tool/mainwindow_constants.h | 14 +++++++-------
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/GUI/View/Fit/JobMessagePanel.cpp b/GUI/View/Fit/JobMessagePanel.cpp
index e03ba91538f..b3054451238 100644
--- a/GUI/View/Fit/JobMessagePanel.cpp
+++ b/GUI/View/Fit/JobMessagePanel.cpp
@@ -63,9 +63,9 @@ JobMessagePanel::~JobMessagePanel()
 void JobMessagePanel::readSettings()
 {
     QSettings settings;
-    if (settings.childGroups().contains(GUI::Constants::S_JOBMESSAGEPANEL)) {
-        settings.beginGroup(GUI::Constants::S_JOBMESSAGEPANEL);
-        m_panelSize = settings.value(GUI::Constants::S_JOBMESSAGEPANEL_SIZE).toSize();
+    if (settings.childGroups().contains(GUI::Constants::S_JOB_MESSAGE_PANEL)) {
+        settings.beginGroup(GUI::Constants::S_JOB_MESSAGE_PANEL);
+        m_panelSize = settings.value(GUI::Constants::S_JOB_MESSAGE_PANEL_SIZE).toSize();
         settings.endGroup();
     }
 }
@@ -73,8 +73,8 @@ void JobMessagePanel::readSettings()
 void JobMessagePanel::writeSettings()
 {
     QSettings settings;
-    settings.beginGroup(GUI::Constants::S_JOBMESSAGEPANEL);
-    settings.setValue(GUI::Constants::S_JOBMESSAGEPANEL_SIZE, size());
+    settings.beginGroup(GUI::Constants::S_JOB_MESSAGE_PANEL);
+    settings.setValue(GUI::Constants::S_JOB_MESSAGE_PANEL_SIZE, size());
     settings.endGroup();
     settings.sync();
 }
diff --git a/GUI/View/Main/ActionManager.cpp b/GUI/View/Main/ActionManager.cpp
index c518d204eb8..bc5dd32e4f4 100644
--- a/GUI/View/Main/ActionManager.cpp
+++ b/GUI/View/Main/ActionManager.cpp
@@ -212,11 +212,11 @@ void ActionManager::onAboutToShowSettingsMenu()
 
     QSettings settings;
 
-    settings.beginGroup(GUI::Constants::S_SESSIONMODELVIEW);
+    settings.beginGroup(GUI::Constants::S_SESSION_MODEL_VIEW);
     QAction* action = m_settingsMenu->addAction("&Model tech view");
     action->setToolTip("Additional developer's view will appear in left control tab bar");
     action->setCheckable(true);
-    action->setChecked(settings.value(GUI::Constants::S_VIEWISACTIVE, false).toBool());
+    action->setChecked(settings.value(GUI::Constants::S_VIEW_IS_ACTIVE, false).toBool());
     connect(action, &QAction::toggled, this, &ActionManager::setSessionModelViewActive);
     settings.endGroup();
 
@@ -284,8 +284,8 @@ void ActionManager::onAboutToShowViewMenu()
 void ActionManager::setSessionModelViewActive(bool status)
 {
     QSettings settings;
-    settings.beginGroup(GUI::Constants::S_SESSIONMODELVIEW);
-    settings.setValue(GUI::Constants::S_VIEWISACTIVE, status);
+    settings.beginGroup(GUI::Constants::S_SESSION_MODEL_VIEW);
+    settings.setValue(GUI::Constants::S_VIEW_IS_ACTIVE, status);
     settings.endGroup();
     m_mainWindow->onSessionModelViewActive(status);
 }
diff --git a/GUI/View/Main/MainWindow.cpp b/GUI/View/Main/MainWindow.cpp
index 99dd52cbf31..ccdfc30672c 100644
--- a/GUI/View/Main/MainWindow.cpp
+++ b/GUI/View/Main/MainWindow.cpp
@@ -263,8 +263,8 @@ void MainWindow::initViews()
 
         // enabling technical view
         QSettings settings;
-        settings.beginGroup(GUI::Constants::S_SESSIONMODELVIEW);
-        onSessionModelViewActive(settings.value(GUI::Constants::S_VIEWISACTIVE, false).toBool());
+        settings.beginGroup(GUI::Constants::S_SESSION_MODEL_VIEW);
+        onSessionModelViewActive(settings.value(GUI::Constants::S_VIEW_IS_ACTIVE, false).toBool());
         settings.endGroup();
 
         connect(m_jobView, &JobView::focusRequest, this, &MainWindow::onFocusRequest);
@@ -279,10 +279,10 @@ void MainWindow::initViews()
 void MainWindow::readSettings()
 {
     QSettings settings;
-    if (settings.childGroups().contains(GUI::Constants::S_MAINWINDOW)) {
-        settings.beginGroup(GUI::Constants::S_MAINWINDOW);
-        resize(settings.value(GUI::Constants::S_WINDOWSIZE, QSize(400, 400)).toSize());
-        move(settings.value(GUI::Constants::S_WINDOWPOSITION, QPoint(200, 200)).toPoint());
+    if (settings.childGroups().contains(GUI::Constants::S_MAIN_WINDOW)) {
+        settings.beginGroup(GUI::Constants::S_MAIN_WINDOW);
+        resize(settings.value(GUI::Constants::S_WINDOW_SIZE, QSize(400, 400)).toSize());
+        move(settings.value(GUI::Constants::S_WINDOW_POSITION, QPoint(200, 200)).toPoint());
         settings.endGroup();
     }
     m_projectManager->readSettings();
@@ -291,9 +291,9 @@ void MainWindow::readSettings()
 void MainWindow::writeSettings()
 {
     QSettings settings;
-    settings.beginGroup(GUI::Constants::S_MAINWINDOW);
-    settings.setValue(GUI::Constants::S_WINDOWSIZE, size());
-    settings.setValue(GUI::Constants::S_WINDOWPOSITION, pos());
+    settings.beginGroup(GUI::Constants::S_MAIN_WINDOW);
+    settings.setValue(GUI::Constants::S_WINDOW_SIZE, size());
+    settings.setValue(GUI::Constants::S_WINDOW_POSITION, pos());
     settings.endGroup();
     m_projectManager->writeSettings();
     settings.sync();
diff --git a/GUI/View/Tool/mainwindow_constants.h b/GUI/View/Tool/mainwindow_constants.h
index 292692620a4..66bbc91d5d8 100644
--- a/GUI/View/Tool/mainwindow_constants.h
+++ b/GUI/View/Tool/mainwindow_constants.h
@@ -20,16 +20,16 @@
 namespace GUI::Constants {
 
 // Settings groups
-const char S_MAINWINDOW[] = "MainWindow";
-const char S_JOBMESSAGEPANEL[] = "JobMessagePanel";
-const char S_SESSIONMODELVIEW[] = "SessionModelView";
+const char S_MAIN_WINDOW[] = "MainWindow";
+const char S_JOB_MESSAGE_PANEL[] = "JobMessagePanel";
+const char S_SESSION_MODEL_VIEW[] = "SessionModelView";
 
 // Settings keys
-const char S_WINDOWSIZE[] = "size";
-const char S_WINDOWPOSITION[] = "pos";
-const char S_VIEWISACTIVE[] = "ViewIsActive";
+const char S_WINDOW_SIZE[] = "size";
+const char S_WINDOW_POSITION[] = "pos";
+const char S_VIEW_IS_ACTIVE[] = "ViewIsActive";
 
-const char S_JOBMESSAGEPANEL_SIZE[] = "size";
+const char S_JOB_MESSAGE_PANEL_SIZE[] = "size";
 
 const int MAX_RECENT_PROJECTS = 10;
 
-- 
GitLab