From: Michal Malý Date: Fri, 1 Aug 2014 21:36:38 +0000 (+0200) Subject: - Fix character encoding with VC11 X-Git-Tag: 0.3b~1 X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=7f6fb0adaf2a6efe860ff78b4db9de4260211903;p=anyanka.git - Fix character encoding with VC11 - Simplify VC11 ifdefing - Fix unreferenced parameter warning --- diff --git a/Anyanka.pro b/Anyanka.pro index 07ede8e..aebc60b 100644 --- a/Anyanka.pro +++ b/Anyanka.pro @@ -16,12 +16,10 @@ unix { QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra } win32 { - SOURCES += windows_defines.h + # Add project root directory to work around VC11 include path scheme + INCLUDEPATH += "./" } -# Add project root directory to work around VC11 include path scheme -INCLUDEPATH += "./" - SOURCES += main.cpp\ datafilesloader.cpp \ datamanager.cpp \ @@ -76,7 +74,6 @@ HEADERS += \ integrationtablemodel.h \ gui/aboutanyanka.h \ globalinfo.h \ - windows_defines.h \ gui/exportrawdatadialog.h \ datafileexporter.h \ datawriterbackend.h \ diff --git a/gui/graphview.cpp b/gui/graphview.cpp index 986a40f..5d7a06d 100644 --- a/gui/graphview.cpp +++ b/gui/graphview.cpp @@ -186,6 +186,8 @@ void GraphView::mousePressEvent(QMouseEvent* ev) void GraphView::paintEvent(QPaintEvent* ev) { + Q_UNUSED(ev); + QPainter p(this); if (m_pixmap != nullptr) p.drawPixmap(0, 0, dwidth(), dheight(), *m_pixmap); diff --git a/main.cpp b/main.cpp index 3773fd3..2efeba2 100644 --- a/main.cpp +++ b/main.cpp @@ -25,16 +25,13 @@ #include "logger.h" #include #include -#ifdef Q_OS_WIN -#include "windows_defines.h" -#endif int main(int argc, char *argv[]) { int ret; QApplication a(argc, argv); -#ifndef COMPILER_MSVC11 +#ifndef _MSC_VER #warning Revisit the metatype shared_ptr registration #endif qRegisterMetaType>(); diff --git a/signal.cpp b/signal.cpp index 8fee612..6d8aadf 100644 --- a/signal.cpp +++ b/signal.cpp @@ -19,10 +19,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - #include "signal.h" #include +#ifdef _MSC_VER +#define DEGREES_CELSIUS_STRING QString::fromWCharArray(L"\u00B0C") +#define MICROAMPERES_STRING QString::fromWCharArray(L"\u03BCA") +#else +#define DEGREES_CELSIUS_STRING QString::fromUtf8(u8"\u00B0C") +#define MICROAMPERES_STRING QString::fromUtf8(u8"\u03BCA") +#endif + const QString Signal::RES_CCD("CCD"); const QString Signal::RES_CURRENT("Current"); const QString Signal::RES_DAD("Absorbance"); @@ -30,9 +37,9 @@ const QString Signal::RES_POWER("Power"); const QString Signal::RES_PRESSURE("Pressure"); const QString Signal::RES_TEMPERATURE("Temperature"); const QString Signal::RES_VOLTAGE("Voltage"); -const QString Signal::DEGREES_CELSIUS_SI("\u00B0C"); +const QString Signal::DEGREES_CELSIUS_SI = DEGREES_CELSIUS_STRING; const QString Signal::KILOVOTLS_SI("KV"); -const QString Signal::MICROAMPERES_SI("\u03BCA"); +const QString Signal::MICROAMPERES_SI = MICROAMPERES_STRING; const QString Signal::MILLIAU_SI("mAU"); const QString Signal::MILLIBARS_SI("mbar"); const QString Signal::MILLIVOLTS_SI("mV"); diff --git a/windows_defines.h b/windows_defines.h deleted file mode 100644 index 2acce4c..0000000 --- a/windows_defines.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (c) 2013 Michal Malý - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - - -#ifndef WINDOWS_DEFINES_H -#define WINDOWS_DEFINES_H - -#define COMPILER_MSVC11 - -#endif // WINDOWS_DEFINES_H