OSDN Git Service

Added macros for a Unicode-safe version of qDebug(), qWarning() and qFatal(). These...
authorlordmulder <mulder2@gmx.de>
Sat, 12 Mar 2011 20:58:46 +0000 (21:58 +0100)
committerlordmulder <mulder2@gmx.de>
Sat, 12 Mar 2011 20:58:46 +0000 (21:58 +0100)
doc/FAQ.html
src/Config.h
src/Global.cpp
src/Global.h
src/Thread_FileAnalyzer.cpp
src/Thread_Initialization.cpp

index 0b8597d..c1b3386 100644 (file)
@@ -272,7 +272,7 @@ switching to the 'Compatibility' tab and un-checking the 'Run this program in co
 
 <a name="328b0a18"><b>Why do I get the error 'Executable requires Windows 2000 or later' on startup?</b></a><br>
 <br>
-You are trying to run LameXP on a platform that is NOT supported, such as Windows 95, Windows 98 or Windows<br>
+You are trying to run LameXP on a platform that is NOT supported, such as Windows 95, Windows 98, Windows<br>
 Millenium Edition or Windows NT 4.0. There is nothing you can do about that, except for updating to a less<br>
 antiquated OS. Note: This can also happen, if your system is configured to run LameXP in <a href="#e7c9ae2b">compatibility mode</a>.<br><br>
 
index c8d618e..458b479 100644 (file)
@@ -25,7 +25,7 @@
 #define VER_LAMEXP_MAJOR                               4
 #define VER_LAMEXP_MINOR_HI                            0
 #define VER_LAMEXP_MINOR_LO                            1
-#define VER_LAMEXP_BUILD                               366
+#define VER_LAMEXP_BUILD                               367
 #define VER_LAMEXP_SUFFIX                              Beta-8
 
 /*
index 73a480d..06710c1 100644 (file)
@@ -207,7 +207,7 @@ bool lamexp_version_demo(void)
 
 QDate lamexp_version_expires(void)
 {
-       return lamexp_version_date().addDays(30);
+       return lamexp_version_date().addDays(LAMEXP_DEBUG ? 2 : 30);
 }
 
 /*
@@ -354,7 +354,7 @@ void lamexp_message_handler(QtMsgType type, const char *msg)
 void lamexp_init_console(int argc, char* argv[])
 {
        bool enableConsole = lamexp_version_demo();
-       
+
        for(int i = 0; i < argc; i++)
        {
                if(!_stricmp(argv[i], "--console"))
index 00a863b..99ba52a 100644 (file)
@@ -123,6 +123,11 @@ SIZE_T lamexp_dbg_private_bytes(void);
 #define        LAMEXP_DYNCAST(OUT,CLASS,SRC) try { OUT = dynamic_cast<CLASS>(SRC); } catch(std::bad_cast) { OUT = NULL; }
 #define LAMEXP_BOOL(X) (X ? "1" : "0")
 
+//Output Qt debug message (Unicode-safe versions)
+#define qDebug64(FORMAT, ...) qDebug("@BASE64@%s", QString(FORMAT).arg(__VA_ARGS__).toUtf8().toBase64().constData());
+#define qWarning64(FORMAT, ...) qWarning("@BASE64@%s", QString(FORMAT).arg(__VA_ARGS__).toUtf8().toBase64().constData());
+#define qFatal64(FORMAT, ...) qFatal("@BASE64@%s", QString(FORMAT).arg(__VA_ARGS__).toUtf8().toBase64().constData());
+
 //Check for debug build
 #if defined(_DEBUG) || defined(QT_DEBUG) || !defined(NDEBUG) || !defined(QT_NO_DEBUG)
 #define LAMEXP_DEBUG 1
index 4896248..cb9dc90 100644 (file)
@@ -74,7 +74,7 @@ void FileAnalyzer::run()
        while(!m_inputFiles.isEmpty())
        {
                QString currentFile = QDir::fromNativeSeparators(m_inputFiles.takeFirst());
-               qDebug("@BASE64@%s", QString("Analyzing: %1").arg(currentFile).toUtf8().toBase64().constData());
+               qDebug64("Analyzing: %1", currentFile);
                emit fileSelected(QFileInfo(currentFile).fileName());
                AudioFileModel file = analyzeFile(currentFile);
                if(file.fileName().isEmpty() || file.formatContainerType().isEmpty() || file.formatAudioType().isEmpty())
@@ -82,7 +82,7 @@ void FileAnalyzer::run()
                        if(!PlaylistImporter::importPlaylist(m_inputFiles, currentFile))
                        {
                                m_filesRejected++;
-                               qDebug("@BASE64@%s", QString("Skipped: %1").arg(file.filePath()).toUtf8().toBase64().constData());
+                               qDebug64("Skipped: %1", file.filePath());
                        }
                        continue;
                }
index c3bb80e..e4838c7 100644 (file)
@@ -228,7 +228,7 @@ void InitializationThread::initTranslations(void)
                
                if(lamexp_translation_register(langId, qmFile, langName, systemId))
                {
-                       qDebug("@BASE64@%s", QString("Registering translation: %1 = %2 (%3)").arg(qmFile, langName, QString::number(systemId)).toUtf8().toBase64().constData());
+                       qDebug64("Registering translation: %1 = %2 (%3)", qmFile, langName, QString::number(systemId));
                }
                else
                {