From e38914887dd2cd5841a73845428c3e7503678232 Mon Sep 17 00:00:00 2001 From: Eberhard Graether Date: Mon, 7 Jul 2014 13:43:29 +0200 Subject: [PATCH] utility: Fixed name collision of log macros in clang This change removes the local std::string variable in the log macros due to possible name collisions with macro callers in clang. Responsibility of this change is held by Malte. --- src/app/qt/view/QtSearchView.cpp | 6 +++--- src/app/qt/view/QtSearchView.h | 2 +- src/lib/utility/logging/logging.h | 9 +++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/app/qt/view/QtSearchView.cpp b/src/app/qt/view/QtSearchView.cpp index 3d40a6f7..51112048 100644 --- a/src/app/qt/view/QtSearchView.cpp +++ b/src/app/qt/view/QtSearchView.cpp @@ -36,7 +36,7 @@ void QtSearchView::initGui() m_searchBox = new QtEditBox(widget); m_searchBox->setPlaceholderText("Please enter your search string."); - m_searchBox->setCallbackOnReturnPressed(std::bind(&QtSearchView::onSeachButtonClick, this)); + m_searchBox->setCallbackOnReturnPressed(std::bind(&QtSearchView::onSearchButtonClick, this)); std::vector autocompletionList; autocompletionList.push_back("tralala"); @@ -45,7 +45,7 @@ void QtSearchView::initGui() m_searchButton = new QtButton(widget); m_searchButton->setText("Search"); - m_searchButton->setCallbackOnClick(std::bind(&QtSearchView::onSeachButtonClick, this)); + m_searchButton->setCallbackOnClick(std::bind(&QtSearchView::onSearchButtonClick, this)); widget->layout()->addWidget(m_searchBox); widget->layout()->addWidget(m_searchButton); @@ -61,7 +61,7 @@ void QtSearchView::setAutocompletionList(const std::vector& autocom m_setAutocompletionListFunctor(autocompletionList); } -void QtSearchView::onSeachButtonClick() +void QtSearchView::onSearchButtonClick() { SearchController* controller = getController(); if (controller) diff --git a/src/app/qt/view/QtSearchView.h b/src/app/qt/view/QtSearchView.h index 3c85ab7d..e14267fc 100644 --- a/src/app/qt/view/QtSearchView.h +++ b/src/app/qt/view/QtSearchView.h @@ -24,7 +24,7 @@ public: virtual void setAutocompletionList(const std::vector& autocompletionList); private: - void onSeachButtonClick(); + void onSearchButtonClick(); void doSetText(const std::string& s); void doSetAutocompletionList(const std::vector& autocompletionList); diff --git a/src/lib/utility/logging/logging.h b/src/lib/utility/logging/logging.h index 10008c60..454dc7ba 100644 --- a/src/lib/utility/logging/logging.h +++ b/src/lib/utility/logging/logging.h @@ -9,24 +9,21 @@ #define LOG_INFO(str) \ do \ { \ - std::string s((str)); \ - LogManager::getInstance()->logInfo(s, __FILE__, __FUNCTION__, __LINE__); \ + LogManager::getInstance()->logInfo(str, __FILE__, __FUNCTION__, __LINE__); \ } \ while(0) \ #define LOG_WARNING(str) \ do \ { \ - std::string s((str)); \ - LogManager::getInstance()->logWarning(s, __FILE__, __FUNCTION__, __LINE__); \ + LogManager::getInstance()->logWarning(str, __FILE__, __FUNCTION__, __LINE__); \ } \ while(0) \ #define LOG_ERROR(str) \ do \ { \ - std::string s((str)); \ - LogManager::getInstance()->logError(s, __FILE__, __FUNCTION__, __LINE__); \ + LogManager::getInstance()->logError(str, __FILE__, __FUNCTION__, __LINE__); \ } \ while(0) \