]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
Replace ME_SENDER_STR static members with a macro in logger.h
authorMichal Malý <madcatxster@devoid-pointer.net>
Sat, 7 Mar 2015 15:53:12 +0000 (16:53 +0100)
committerMichal Malý <madcatxster@devoid-pointer.net>
Sat, 7 Mar 2015 15:53:12 +0000 (16:53 +0100)
19 files changed:
datafilesloader.cpp
datafilesloader.h
datamanager.cpp
datamanager.h
gui/graphview.cpp
gui/graphview.h
gui/graphviewcontextmenu.h
integrationtablemodel.cpp
integrationtablemodel.h
integrator.cpp
integrator.h
logger.h
signalcontroller.cpp
signalcontroller.h
signaldrawer.cpp
signaldrawer.h
singlerundata.cpp
singlerundata.h
usersettings.cpp

index 0ae0181a24b32eb6d2284a11fa11aab531749fc6..f8d5d8062c73170acfc3716fd087ab6e4a0c3b24 100644 (file)
@@ -26,8 +26,6 @@
 #include "gui/failedfilesdialog.h"
 #include <QDebug>
 
-const QString DataFilesLoader::ME_SENDER_STR("DataFilesLoader");
-
 DataFilesLoader::DataFilesLoader(QObject *parent) :
   QObject(parent)
 {
index 9f4852bbd81267abff03b47a1e84a5c62f6f0d26..1bc4a7174af0941322c089f0e31fedbb98dd9813 100644 (file)
@@ -45,8 +45,6 @@ public:
 private:
   QStringList m_supportedFileTypes;
 
-  static const QString ME_SENDER_STR;
-
 signals:
 
 public slots:
index 6209d8b9ab068828b6fb0215f3c65382b4b4713d..ccaa73b7c076c5f4c93cd05ffce56bfd15d9f9b0 100644 (file)
@@ -27,7 +27,6 @@
 
 #include <QDebug>
 
-const QString DataManager::ME_SENDER_STR("DataManager");
 const char DataManager::UNIT_DEGREES_CELSIUS_TEXT[] = {static_cast<char>(0xB0), 0x43, 0x00};
 const char DataManager::UNIT_KILOVOLTS_TEXT[] = {0x4B, 0x56, 0x00};
 const char DataManager::UNIT_KILOVOLTS_ALT1_TEXT[] = {0x6B, 0x56, 0x00};
index 75877171a263bf81f59db05eb335f13fa81fc5da..8361fccb405e6f54e80a23f5a6aa1391fcbc59e8 100644 (file)
@@ -77,7 +77,6 @@ private:
   ExportRawDataDialog m_exportRawDataDialog;
   ExportGraphToImageDialog m_graphToImageExportDialog;
 
-  static const QString ME_SENDER_STR;
   static const char UNIT_DEGREES_CELSIUS_TEXT[];
   static const char UNIT_KILOVOLTS_TEXT[];
   static const char UNIT_KILOVOLTS_ALT1_TEXT[];
index 36b60e4320806729bc6182d6bed37ad9bbb80724..31bb2e09f597f0330381f5b96e58b94d711a689c 100644 (file)
@@ -29,7 +29,6 @@
 #include <QDebug>
 
 const double GraphView::DEFAULT_Y_MARGIN = 0.05;
-const QString GraphView::ME_SENDER_STR("GraphView");
 
 GraphView::GraphView(std::shared_ptr<SignalController> controller, QWidget* parent) :
   QWidget(parent), SignalDrawer(controller, Constraints(SignalController::RELATIVE_MIN, RELATIVE_Y_MIN_WITH_MARGIN(), SignalController::RELATIVE_MAX,
index 58179c88c21d6b4718332804902527da7cd49f6d..b4795aa0a8145b4a1b4766d03b35042ac94aa903 100644 (file)
@@ -111,7 +111,6 @@ private:
   int m_zoomRectLastYPix;
 
   static const double DEFAULT_Y_MARGIN;
-  static const QString ME_SENDER_STR;
 
 private slots:
   void onCtxMenuDeletePeak(const QPoint pixPos);
index 3615a0ca510ece6b516660f025bf346266f0f256..ead535620cfb35953a3d1b8dacb9225c0acd83c4 100644 (file)
@@ -39,8 +39,6 @@ private:
 
   QPoint m_relPixPos;
 
-  static const QString ME_SENDER_STR;
-
 private slots:
   void onDeletePeakTriggered();
   void onZoomOutTriggered();
index f7166a93d901a46e71b51833469d2f188b152240..3c04a52372ee4880e6cb7f4c20581f2a652f1795 100644 (file)
@@ -24,8 +24,6 @@
 #include "logger.h"
 #include <QtCore/QLocale>
 
-const QString IntegrationTableModel::ME_SENDER_STR("IntegrationTableModel");
-
 IntegrationTableModel::IntegrationTableModel(const std::shared_ptr<Integrator> integrator, QObject* parent) :
   QAbstractTableModel(parent),
   m_integrator(integrator)
index 7a41b818533fd70ecaaa01f6271faa1947adbdd5..63a8ba5284a7c87c62576c5c2837f93737f3faee 100644 (file)
@@ -41,8 +41,6 @@ public:
 private:
   const std::shared_ptr<Integrator> m_integrator;
 
-  static const QString ME_SENDER_STR;
-
 public slots:
   void prepToAdd(const int idx);
   void prepToDelete(const int idx);
index 7714faeffbe4d8a5ff5da26b513bbc1247687248..08fa60feb4fd67cdc0dea25d5be9d62d37aee069 100644 (file)
@@ -25,8 +25,6 @@
 
 #include <QDebug>
 
-const QString Integrator::ME_SENDER_STR("Integrator");
-
 Integrator::Integrator(std::shared_ptr<Signal> signal, QObject* parent) :
   QObject(parent),
   m_peakCount(0),
index 71e89a6a6340a378577a4540cef0e55922da9e81..3bea748ee4178cad853c25e9d63b8081804f7dde 100644 (file)
@@ -66,8 +66,6 @@ private:
   PeakMap m_peakMap;
   std::shared_ptr<Signal> m_signal;
 
-  static const QString ME_SENDER_STR;
-
 signals:
   void addingPeak(const int idx);
   void deletingPeak(const int idx);
index 2f308b858a5b493b7476168a7a70977d5cff4b54..f620e014b03c19c78c8a769046474f6fa36c9466 100644 (file)
--- a/logger.h
+++ b/logger.h
@@ -36,6 +36,9 @@
 
 #define __QFUNC__ QString(__func__) + QString("()")
 
+#define ME_SENDER_STR typeid(*this).name()
+#define ME_SENDER_STR_S(ptr) typeid(*ptr).name()
+
 class LocalLogger;
 typedef std::shared_ptr<LocalLogger> LocalLoggerPtr;
 
index caeb12e75bd30f9c520b9641939d8115cb7c8b03..969fbdf25e3b8e6215aaaea5ce57998192b1e782 100644 (file)
@@ -31,7 +31,6 @@
 
 const double SignalController::RELATIVE_MAX = 1.0;
 const double SignalController::RELATIVE_MIN = 0.0;
-const QString SignalController::ME_SENDER_STR("SignalController");
 
 const QString SignalController::KEY_PEAKS("peaks");
 
index d8105c3396ff6550466337dc46615ff0151e4ed0..6db279a626a3edc6cc9834a889ae021ad453031b 100644 (file)
@@ -148,8 +148,6 @@ private:
   void drawIntegratedPeak(const std::shared_ptr<const IntegratedPeak> peak);
   PeakDrawData genPeakDrawData(const std::shared_ptr<const IntegratedPeak> peak);
 
-  static const QString ME_SENDER_STR;
-
   static const QString KEY_PEAKS;
 
 public slots:
index b0262c97126730df23d684599e587c8afdeb5d67..7ace5d313c60b54fc6300f114dcaadf969c5c0ad 100644 (file)
@@ -26,7 +26,6 @@
 #include <QFontMetrics>
 #include <QDebug>
 
-const QString SignalDrawer::ME_SENDER_STR("SignalDrawer");
 const int SignalDrawer::AXIS_LABEL_BORDER_OFFSET(2);
 const int SignalDrawer::AXIS_LABEL_SCALE_OFFSET(3);
 const int SignalDrawer::MAXIMAL_AXIS_BIGTICK_STEP(75);
index 31ef120a3c78fd4b29892b4d106fc8804ee4dd2f..5a2cd15bad20d1aeb293c7ec646843b8e679a6a9 100644 (file)
@@ -134,9 +134,6 @@ private:
   const QString m_xAxisLabelText;
   const QString m_yAxisLabelText;
 
-
-  static const QString ME_SENDER_STR;
-
 };
 
 #endif // SIGNALDRAWER_H
index 6b6887e1a6dd1dc6b9451996f2c32223df7bd60c..5d1d4720e7171b40b4fc2833788d058f73b381ab 100644 (file)
@@ -28,8 +28,6 @@
 #include <QtCore/QJsonValue>
 #include <QtWidgets/QMessageBox>
 
-const QString SingleRunData::ME_SENDER_STR("SingleRunData");
-
 SingleRunData::SingleRunData(const QString& methodName, const QString& operatorName, const QString& sampleInfo, const QDate date, const QTime time,
                              SignalsMap& sigs, SignalControllersMap& ctrls,
                              const QString& dirname, const QString& absPath, QObject *parent) :
index b27cb4bd8d305de3a0e6e19d1a7478bf3c50db22..7b818cca36c0c31c7f3023c4720468c9cf04f06c 100644 (file)
@@ -72,8 +72,6 @@ private:
   SignalsMap m_signals;
   const QTime m_time;
 
-  static const QString ME_SENDER_STR;
-
 signals:
 
 public slots:
index 7bc2f8c6e11465ebda7146009b68f6a9d74b96d6..509ce692bfcfdf5c20724ca938f72a2e5ae1010a 100644 (file)
@@ -14,13 +14,13 @@ void UserSettings::dispose()
 QVariant UserSettings::get(const QString key)
 {
   if (s_me == nullptr) {
-    Logger::log(Logger::Level::ERROR, "UserSettings", __QFUNC__ + "UserSettings not initialized");
+    Logger::log(Logger::Level::ERROR, ME_SENDER_STR_S(s_me), __QFUNC__ + "UserSettings not initialized");
     return QVariant();
   }
 
   std::lock_guard<std::mutex> lk(s_me->m_lock);
   QVariant v = s_me->m_settings[key.toLower()];
-  Logger::log(Logger::Level::DEBUG, "UserSettings ", __QFUNC__ + QString("Key: %1, Value: %2").arg(key).arg(v.toString()));
+  Logger::log(Logger::Level::DEBUG, ME_SENDER_STR_S(s_me), __QFUNC__ + QString("Key: %1, Value: %2").arg(key).arg(v.toString()));
   return v;
 }