--- qsampler/trunk/src/qsampler.cpp 2013/02/14 14:57:43 2415 +++ qsampler/trunk/src/qsampler.cpp 2014/10/09 08:50:14 2677 @@ -1,7 +1,7 @@ // qsampler.cpp // /**************************************************************************** - Copyright (C) 2004-2013, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2004-2014, rncbc aka Rui Nuno Capela. All rights reserved. Copyright (C) 2007, 2008 Christian Schoenebeck This program is free software; you can redistribute it and/or @@ -28,15 +28,11 @@ #include #include #include + #if defined(__APPLE__) // Toshi Nagata 20080105 #include #endif -#if QT_VERSION < 0x040300 -#define lighter(x) light(x) -#define darker(x) dark(x) -#endif - #define CONFIG_QUOTE1(x) #x #define CONFIG_QUOTED(x) CONFIG_QUOTE1(x) @@ -46,12 +42,6 @@ #define CONFIG_DATADIR CONFIG_PREFIX "/share" #endif -#if defined(LOCALEDIR) -#define CONFIG_LOCALEDIR CONFIG_QUOTED(LOCALEDIR) -#else -#define CONFIG_LOCALEDIR CONFIG_DATADIR "/locale" -#endif - #if WIN32 #define RELATIVE_LOCALE_DIR "/share/locale" #elif defined(__APPLE__) @@ -92,23 +82,23 @@ if (m_pQtTranslator->load(sLocName, sLocPath)) { QApplication::installTranslator(m_pQtTranslator); } else { - #ifdef RELATIVE_LOCALE_DIR + #ifdef RELATIVE_LOCALE_DIR sLocPath = QApplication::applicationDirPath() + RELATIVE_LOCALE_DIR; if (m_pQtTranslator->load(sLocName, sLocPath)) { QApplication::installTranslator(m_pQtTranslator); } else { - #endif + #endif delete m_pQtTranslator; m_pQtTranslator = 0; - #ifdef CONFIG_DEBUG + #ifdef CONFIG_DEBUG qWarning("Warning: no translation found for '%s' locale: %s/%s.qm", loc.name().toUtf8().constData(), sLocPath.toUtf8().constData(), sLocName.toUtf8().constData()); - #endif - #ifdef RELATIVE_LOCALE_DIR + #endif + #ifdef RELATIVE_LOCALE_DIR } - #endif + #endif } // Try own application translation... m_pMyTranslator = new QTranslator(this); @@ -116,22 +106,22 @@ if (m_pMyTranslator->load(sLocName, sLocPath)) { QApplication::installTranslator(m_pMyTranslator); } else { - #ifdef RELATIVE_LOCALE_DIR + #ifdef RELATIVE_LOCALE_DIR sLocPath = QApplication::applicationDirPath() + RELATIVE_LOCALE_DIR; - #else - sLocPath = CONFIG_LOCALEDIR; - #endif + #else + sLocPath = CONFIG_DATADIR "/qsampler/translations"; + #endif if (m_pMyTranslator->load(sLocName, sLocPath)) { QApplication::installTranslator(m_pMyTranslator); } else { delete m_pMyTranslator; m_pMyTranslator = 0; - #ifdef CONFIG_DEBUG + #ifdef CONFIG_DEBUG qWarning("Warning: no translation found for '%s' locale: %s/%s.qm", loc.name().toUtf8().constData(), sLocPath.toUtf8().constData(), sLocName.toUtf8().constData()); - #endif + #endif } } } @@ -403,10 +393,8 @@ } // Set default base font... - int iBaseFontSize = app.font().pointSize(); if (options.iBaseFontSize > 0) - iBaseFontSize = options.iBaseFontSize; - app.setFont(QFont(app.font().family(), iBaseFontSize)); + app.setFont(QFont(app.font().family(), options.iBaseFontSize)); // Construct, setup and show the main form. QSampler::MainForm w;