Introduce QUTF8 macro and replace ".toUtf8().constData()" everywhere.

This commit is contained in:
LoRd_MuldeR 2013-10-21 15:00:55 +02:00
parent b3046a46a7
commit b54886f242
21 changed files with 106 additions and 102 deletions

View File

@ -3290,22 +3290,22 @@
<context>
<name>QApplication</name>
<message>
<location filename="../../src/Global.cpp" line="1013"/>
<location filename="../../src/Global.cpp" line="1334"/>
<source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1266"/>
<location filename="../../src/Global.cpp" line="1279"/>
<source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1271"/>
<location filename="../../src/Global.cpp" line="1284"/>
<source>Executable &apos;%1&apos; was built for Qt &apos;%2&apos;, but found Qt &apos;%3&apos;.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1283"/>
<location filename="../../src/Global.cpp" line="1296"/>
<source>Executable &apos;%1&apos; requires Windows XP or later.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -3327,22 +3327,22 @@
<context>
<name>QApplication</name>
<message>
<location filename="../../src/Global.cpp" line="1013"/>
<location filename="../../src/Global.cpp" line="1334"/>
<source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
<translation type="unfinished">Plik wykonywalny &apos;%1&apos; nie działa w trybie kompatybilności z Windows.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1266"/>
<location filename="../../src/Global.cpp" line="1279"/>
<source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
<translation type="unfinished">Plik wykonywalny &apos;%1&apos; wymaga Qt v%2, znaleziono jednak Qt v%3.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1271"/>
<location filename="../../src/Global.cpp" line="1284"/>
<source>Executable &apos;%1&apos; was built for Qt &apos;%2&apos;, but found Qt &apos;%3&apos;.</source>
<translation type="unfinished">Plik wykonywalny &quot;%1&quot; został skompilowany dla Qt &quot;%2&quot;, znaleziono &quot;%3&quot;.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1283"/>
<location filename="../../src/Global.cpp" line="1296"/>
<source>Executable &apos;%1&apos; requires Windows XP or later.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -3310,22 +3310,22 @@
<context>
<name>QApplication</name>
<message>
<location filename="../../src/Global.cpp" line="1013"/>
<location filename="../../src/Global.cpp" line="1334"/>
<source>Executable &apos;%1&apos; doesn&apos;t support Windows compatibility mode.</source>
<translation>EXE-filen &apos;%1&apos; stöder inte Windows kompatibilitetsläge.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1266"/>
<location filename="../../src/Global.cpp" line="1279"/>
<source>Executable &apos;%1&apos; requires Qt v%2, but found Qt v%3.</source>
<translation>EXE-filen &apos;%1&apos; kräver Qt v%2, du har Qt v%3.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1271"/>
<location filename="../../src/Global.cpp" line="1284"/>
<source>Executable &apos;%1&apos; was built for Qt &apos;%2&apos;, but found Qt &apos;%3&apos;.</source>
<translation>EXE-filen &apos;%1&apos; är byggd för Qt &apos;%2&apos;, du har Qt &apos;%3&apos;.</translation>
</message>
<message>
<location filename="../../src/Global.cpp" line="1283"/>
<location filename="../../src/Global.cpp" line="1296"/>
<source>Executable &apos;%1&apos; requires Windows XP or later.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -34,7 +34,7 @@
#define VER_LAMEXP_MINOR_LO 9
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 3
#define VER_LAMEXP_BUILD 1410
#define VER_LAMEXP_BUILD 1413
#define VER_LAMEXP_CONFG 1348
///////////////////////////////////////////////////////////////////////////////

View File

@ -79,7 +79,7 @@ int LogViewDialog::exec(const QStringList &logData)
void LogViewDialog::copyButtonClicked(void)
{
QMimeData *mime = new QMimeData();
mime->setData("text/plain", ui->textEdit->toPlainText().toUtf8().constData());
mime->setData("text/plain", QUTF8(ui->textEdit->toPlainText()));
QApplication::clipboard()->setMimeData(mime);
m_clipboardUsed = true;
m_oldIcon->swap(ui->buttonCopy->icon());

View File

@ -1050,13 +1050,13 @@ void MainWindow::dropEvent(QDropEvent *event)
}
if(file.isFile())
{
qDebug("Dropped File: %s", file.canonicalFilePath().toUtf8().constData());
qDebug("Dropped File: %s", QUTF8(file.canonicalFilePath()));
droppedFiles << file.canonicalFilePath();
continue;
}
if(file.isDir())
{
qDebug("Dropped Folder: %s", file.canonicalFilePath().toUtf8().constData());
qDebug("Dropped Folder: %s", QUTF8(file.canonicalFilePath()));
QList<QFileInfo> list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Files | QDir::NoSymLinks);
if(list.count() > 0)
{
@ -1070,7 +1070,7 @@ void MainWindow::dropEvent(QDropEvent *event)
list = QDir(file.canonicalFilePath()).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks);
for(int j = 0; j < list.count(); j++)
{
qDebug("Descending to Folder: %s", list.at(j).canonicalFilePath().toUtf8().constData());
qDebug("Descending to Folder: %s", QUTF8(list.at(j).canonicalFilePath()));
urls.prepend(QUrl::fromLocalFile(list.at(j).canonicalFilePath()));
}
}
@ -1390,7 +1390,7 @@ void MainWindow::windowShown(void)
if(!arguments[i].compare("--add", Qt::CaseInsensitive))
{
QFileInfo currentFile(arguments[++i].trimmed());
qDebug("Adding file from CLI: %s", currentFile.absoluteFilePath().toUtf8().constData());
qDebug("Adding file from CLI: %s", QUTF8(currentFile.absoluteFilePath()));
addedFiles.append(currentFile.absoluteFilePath());
}
if(!addedFiles.isEmpty())
@ -1405,13 +1405,13 @@ void MainWindow::windowShown(void)
if(!arguments[i].compare("--add-folder", Qt::CaseInsensitive))
{
QFileInfo currentFile(arguments[++i].trimmed());
qDebug("Adding folder from CLI: %s", currentFile.absoluteFilePath().toUtf8().constData());
qDebug("Adding folder from CLI: %s", QUTF8(currentFile.absoluteFilePath()));
addFolder(currentFile.absoluteFilePath(), false, true);
}
if(!arguments[i].compare("--add-recursive", Qt::CaseInsensitive))
{
QFileInfo currentFile(arguments[++i].trimmed());
qDebug("Adding folder recursively from CLI: %s", currentFile.absoluteFilePath().toUtf8().constData());
qDebug("Adding folder recursively from CLI: %s", QUTF8(currentFile.absoluteFilePath()));
addFolder(currentFile.absoluteFilePath(), true, true);
}
}
@ -3988,13 +3988,13 @@ void MainWindow::addFileDelayed(const QString &filePath, bool tryASAP)
{
if(tryASAP && !m_delayedFileTimer->isActive())
{
qDebug("Received file: %s", filePath.toUtf8().constData());
qDebug("Received file: %s", QUTF8(filePath));
m_delayedFileList->append(filePath);
QTimer::singleShot(0, this, SLOT(handleDelayedFiles()));
}
m_delayedFileTimer->stop();
qDebug("Received file: %s", filePath.toUtf8().constData());
qDebug("Received file: %s", QUTF8(filePath));
m_delayedFileList->append(filePath);
m_delayedFileTimer->start(5000);
}

View File

@ -1012,7 +1012,7 @@ void ProcessingDialog::writePlayList(void)
playList.write("#EXTM3U\r\n");
while(!list.isEmpty())
{
playList.write(useUtf8 ? list.takeFirst().toUtf8().constData() : list.takeFirst().toLatin1().constData());
playList.write(useUtf8 ?QUTF8(list.takeFirst()) : list.takeFirst().toLatin1().constData());
playList.write("\r\n");
}
playList.close();

View File

@ -147,11 +147,11 @@ void SplashScreen::showSplash(QThread *thread)
//Loop while thread is still running
while(THREAD_RUNNING(thread))
{
ASYNC_WAIT(loop, 500);
if((deadlockCounter++ > 360) && thread->isRunning())
if((++deadlockCounter) > 60)
{
qFatal("Deadlock in initialization thread detected!");
}
ASYNC_WAIT(loop, 5000);
}
//Stop the timer

View File

@ -227,9 +227,10 @@ unsigned long lamexp_dbg_private_bytes(void);
#define LAMEXP_DELETE_ARRAY(PTR) do { if(PTR) { delete [] PTR; PTR = NULL; } } while(0)
#define LAMEXP_SAFE_FREE(PTR) do { if(PTR) { free((void*) PTR); PTR = NULL; } } while(0)
#define LAMEXP_CLOSE(HANDLE) do { if(HANDLE != NULL && HANDLE != INVALID_HANDLE_VALUE) { CloseHandle(HANDLE); HANDLE = NULL; } } while(0)
#define QWCHAR(STR) reinterpret_cast<const wchar_t*>((STR).utf16())
#define WCHAR2QSTR(STR) QString::fromUtf16(reinterpret_cast<const unsigned short*>(STR))
#define LAMEXP_BOOL2STR(X) (X ? "1" : "0")
#define QWCHAR(STR) (reinterpret_cast<const wchar_t*>((STR).utf16()))
#define WCHAR2QSTR(STR) (QString::fromUtf16(reinterpret_cast<const unsigned short*>((STR))))
#define QUTF8(STR) ((STR).toUtf8().constData())
#define LAMEXP_BOOL2STR(X) ((X) ? "1" : "0")
#define LAMEXP_MAKE_STRING_EX(X) #X
#define LAMEXP_MAKE_STRING(X) LAMEXP_MAKE_STRING_EX(X)
#define LAMEXP_COMPILER_WARNING(TXT) __pragma(message(__FILE__ "(" LAMEXP_MAKE_STRING(__LINE__) ") : warning: " TXT))
@ -246,26 +247,26 @@ unsigned long lamexp_dbg_private_bytes(void);
//Memory check
#if LAMEXP_DEBUG
#define LAMEXP_MEMORY_CHECK(FUNC, RETV, ...) do \
{ \
SIZE_T _privateBytesBefore = lamexp_dbg_private_bytes(); \
RETV = FUNC(__VA_ARGS__); \
SIZE_T _privateBytesLeak = (lamexp_dbg_private_bytes() - _privateBytesBefore) / 1024; \
if(_privateBytesLeak > 0) { \
char _buffer[128]; \
_snprintf_s(_buffer, 128, _TRUNCATE, "Memory leak: Lost %u KiloBytes of PrivateUsage memory.\n", _privateBytesLeak); \
OutputDebugStringA("----------\n"); \
OutputDebugStringA(_buffer); \
OutputDebugStringA("----------\n"); \
#define LAMEXP_MEMORY_CHECK(FUNC, RETV, ...) do \
{ \
SIZE_T _privateBytesBefore = lamexp_dbg_private_bytes(); \
RETV = FUNC(__VA_ARGS__); \
SIZE_T _privateBytesLeak = (lamexp_dbg_private_bytes() - _privateBytesBefore) / 1024; \
if(_privateBytesLeak > 0) { \
char _buffer[128]; \
_snprintf_s(_buffer, 128, _TRUNCATE, "Memory leak: Lost %u KiloBytes of PrivateUsage memory.\n", _privateBytesLeak); \
OutputDebugStringA("----------\n"); \
OutputDebugStringA(_buffer); \
OutputDebugStringA("----------\n"); \
} \
} \
} \
while(0)
while(0)
#else
#define LAMEXP_MEMORY_CHECK(FUNC, RETV, ...) do \
{ \
RETV = __noop(__VA_ARGS__); \
} \
while(0)
#define LAMEXP_MEMORY_CHECK(FUNC, RETV, ...) do \
{ \
RETV = __noop(__VA_ARGS__); \
} \
while(0)
#endif
//Check for CPU-compatibility options

View File

@ -112,13 +112,13 @@ LockedFile::LockedFile(QResource *const resource, const QString &outPath, const
if(outFile.write(reinterpret_cast<const char*>(resource->data()), resource->size()) != resource->size())
{
QFile::remove(QFileInfo(outFile).canonicalFilePath());
THROW_FMT("File '%s' could not be written!", QFileInfo(outFile).fileName().toUtf8().constData());
THROW_FMT("File '%s' could not be written!", QUTF8(QFileInfo(outFile).fileName()));
}
outFile.close();
}
else
{
THROW_FMT("File '%s' could not be created!", QFileInfo(outFile).fileName().toUtf8().constData());
THROW_FMT("File '%s' could not be created!", QUTF8(QFileInfo(outFile).fileName()));
}
//Now lock the file!
@ -134,7 +134,7 @@ LockedFile::LockedFile(QResource *const resource, const QString &outPath, const
if((m_fileHandle == NULL) || (m_fileHandle == INVALID_HANDLE_VALUE))
{
QFile::remove(QFileInfo(outFile).canonicalFilePath());
THROW_FMT("File '%s' could not be locked!", QFileInfo(outFile).fileName().toUtf8().constData());
THROW_FMT("File '%s' could not be locked!", QUTF8(QFileInfo(outFile).fileName()));
}
//Open file for reading
@ -163,7 +163,7 @@ LockedFile::LockedFile(QResource *const resource, const QString &outPath, const
else
{
QFile::remove(m_filePath);
THROW_FMT("File '%s' could not be read!", QFileInfo(outFile).fileName().toUtf8().constData());
THROW_FMT("File '%s' could not be read!", QUTF8(QFileInfo(outFile).fileName()));
}
//Compare hashes
@ -172,7 +172,7 @@ LockedFile::LockedFile(QResource *const resource, const QString &outPath, const
qWarning("\nFile checksum error:\n A = %s\n B = %s\n", expectedHash.constData(), hash.constData());
LAMEXP_CLOSE(m_fileHandle);
QFile::remove(m_filePath);
THROW_FMT("File '%s' is corruputed, take care!", QFileInfo(outFile).fileName().toUtf8().constData());
THROW_FMT("File '%s' is corruputed, take care!", QUTF8(QFileInfo(outFile).fileName()));
}
}
@ -185,7 +185,7 @@ LockedFile::LockedFile(const QString &filePath)
//Make sure the file exists, before we try to lock it
if(!existingFile.exists())
{
THROW_FMT("File '%s' does not exist!", existingFile.fileName().toUtf8().constData());
THROW_FMT("File '%s' does not exist!", QUTF8(existingFile.fileName()));
}
//Remember file path
@ -203,7 +203,7 @@ LockedFile::LockedFile(const QString &filePath)
//Locked successfully?
if((m_fileHandle == NULL) || (m_fileHandle == INVALID_HANDLE_VALUE))
{
THROW_FMT("File '%s' could not be locked!", existingFile.fileName().toUtf8().constData());
THROW_FMT("File '%s' could not be locked!", QUTF8(existingFile.fileName()));
}
}

View File

@ -88,7 +88,7 @@ static int lamexp_main(int argc, char* argv[])
qDebug("Command-Line Arguments:");
for(int i = 0; i < arguments.count(); i++)
{
qDebug("argv[%d]=%s", i, arguments.at(i).toUtf8().constData());
qDebug("argv[%d]=%s", i, QUTF8(arguments.at(i)));
}
qDebug("");
@ -271,6 +271,7 @@ int main(int argc, char* argv[])
{
__try
{
SetErrorMode(GetErrorMode() | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
SetUnhandledExceptionFilter(lamexp_exception_handler);
_set_invalid_parameter_handler(lamexp_invalid_param_handler);
return _main(argc, argv);

View File

@ -34,7 +34,7 @@ const unsigned int AudioFileModel::BITDEPTH_IEEE_FLOAT32 = UINT_MAX-1;
#define PRINT_S(VAR) do \
{ \
if((VAR).isEmpty()) qDebug(#VAR " = N/A"); else qDebug(#VAR " = \"%s\"", (VAR).toUtf8().constData()); \
if((VAR).isEmpty()) qDebug(#VAR " = N/A"); else qDebug(#VAR " = \"%s\"", QUTF8((VAR))); \
} \
while(0)

View File

@ -523,7 +523,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
/* --- FILE --- */
if(rxFile.indexIn(line) >= 0)
{
qDebug("%03d File: <%s> <%s>", lines, rxFile.cap(1).toUtf8().constData(), rxFile.cap(2).toUtf8().constData());
qDebug("%03d File: <%s> <%s>", lines, QUTF8(rxFile.cap(1)), QUTF8(rxFile.cap(2)));
if(currentFile)
{
if(currentTrack)
@ -560,7 +560,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
else
{
bUnsupportedTrack = true;
qWarning("%03d Skipping unsupported file of type '%s'.", lines, rxFile.cap(2).toUtf8().constData());
qWarning("%03d Skipping unsupported file of type '%s'.", lines, QUTF8(rxFile.cap(2)));
currentFile = NULL;
}
bPreamble = false;
@ -573,7 +573,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
{
if(currentFile)
{
qDebug("%03d Track: <%s> <%s>", lines, rxTrack.cap(1).toUtf8().constData(), rxTrack.cap(2).toUtf8().constData());
qDebug("%03d Track: <%s> <%s>", lines, QUTF8(rxTrack.cap(1)), QUTF8(rxTrack.cap(2)));
if(currentTrack)
{
if(currentTrack->isValid())
@ -593,7 +593,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
else
{
bUnsupportedTrack = true;
qWarning("%03d Skipping unsupported track of type '%s'.", lines, rxTrack.cap(2).toUtf8().constData());
qWarning("%03d Skipping unsupported track of type '%s'.", lines, QUTF8(rxTrack.cap(2)));
currentTrack = NULL;
}
}
@ -610,7 +610,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
{
if(currentFile && currentTrack)
{
qDebug("%03d Index: <%s> <%s>", lines, rxIndex.cap(1).toUtf8().constData(), rxIndex.cap(2).toUtf8().constData());
qDebug("%03d Index: <%s> <%s>", lines, QUTF8(rxIndex.cap(1)), QUTF8(rxIndex.cap(2)));
if(rxIndex.cap(1).toInt() == 1)
{
currentTrack->setStartIndex(parseTimeIndex(rxIndex.cap(2)));
@ -628,7 +628,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
}
else if(currentFile && currentTrack)
{
qDebug("%03d Title: <%s>", lines, rxTitle.cap(1).toUtf8().constData());
qDebug("%03d Title: <%s>", lines, QUTF8(rxTitle.cap(1)));
currentTrack->metaInfo().setTitle(UNQUOTE(rxTitle.cap(1)).simplified());
}
continue;
@ -643,7 +643,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
}
else if(currentFile && currentTrack)
{
qDebug("%03d Title: <%s>", lines, rxPerformer.cap(1).toUtf8().constData());
qDebug("%03d Title: <%s>", lines, QUTF8(rxPerformer.cap(1)));
currentTrack->metaInfo().setArtist(UNQUOTE(rxPerformer.cap(1)).simplified());
}
continue;
@ -666,7 +666,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
}
else if(currentFile && currentTrack)
{
qDebug("%03d Genre: <%s>", lines, rxGenre.cap(1).toUtf8().constData());
qDebug("%03d Genre: <%s>", lines, QUTF8(rxGenre.cap(1)));
QString temp = UNQUOTE(rxGenre.cap(1).simplified());
for(int i = 0; g_lamexp_generes[i]; i++)
{
@ -691,7 +691,7 @@ int CueSheetModel::parseCueFile(QFile &cueFile, const QDir &baseDir, QCoreApplic
}
else if(currentFile && currentTrack)
{
qDebug("%03d Year: <%s>", lines, rxPerformer.cap(1).toUtf8().constData());
qDebug("%03d Year: <%s>", lines, QUTF8(rxPerformer.cap(1)));
bool ok = false;
unsigned int temp = rxYear.cap(1).toUInt(&ok);
if(ok) currentTrack->metaInfo().setYear(temp);
@ -831,7 +831,7 @@ double CueSheetModel::parseTimeIndex(const QString &index)
}
}
qWarning(" Bad time index: '%s'", index.toUtf8().constData());
qWarning(" Bad time index: '%s'", QUTF8(index));
return std::numeric_limits<double>::quiet_NaN();
}

View File

@ -494,7 +494,7 @@ int FileListModel::importFromCsv(QWidget *parent, const QString &inFile)
}
else
{
qWarning("Unkonw field '%s' will be ignored!", header.at(j).toUtf8().constData());
qWarning("Unkonw field '%s' will be ignored!", QUTF8(header.at(j)));
ignore[j] = true;
if(!checkArray(ignore, false, nCols))

View File

@ -110,7 +110,7 @@ public:
}
else
{
qWarning("Could not find '%s' in cache, but it has been marked as dirty!", (*iter).toUtf8().constData());
qWarning("Could not find '%s' in cache, but it has been marked as dirty!", QUTF8(*iter));
}
}
m_configFile->sync();
@ -322,7 +322,7 @@ SettingsModel::SettingsModel(void)
continue;
}
}
qWarning("Deleting obsolete group from config: %s", current.toUtf8().constData());
qWarning("Deleting obsolete group from config: %s", QUTF8(current));
REMOVE_GROUP(configFile, current);
}
@ -463,9 +463,9 @@ QString SettingsModel::defaultLanguage(void) const
//Detect system langauge
QLocale systemLanguage= QLocale::system();
qDebug("[Locale]");
qDebug("Language: %s (%d)", QLocale::languageToString(systemLanguage.language()).toUtf8().constData(), systemLanguage.language());
qDebug("Country is: %s (%d)", QLocale::countryToString(systemLanguage.country()).toUtf8().constData(), systemLanguage.country());
qDebug("Script is: %s (%d)\n", QLocale::scriptToString(systemLanguage.script()).toUtf8().constData(), systemLanguage.script());
qDebug("Language: %s (%d)", QUTF8(QLocale::languageToString(systemLanguage.language())), systemLanguage.language());
qDebug("Country is: %s (%d)", QUTF8(QLocale::countryToString(systemLanguage.country())), systemLanguage.country());
qDebug("Script is: %s (%d)\n", QUTF8(QLocale::scriptToString(systemLanguage.script())), systemLanguage.script());
//Check if we can use the default translation
if(systemLanguage.language() == QLocale::English /*|| systemLanguage.language() == QLocale::C*/)

View File

@ -21,6 +21,8 @@
#include "PlaylistImporter.h"
#include "Global.h"
#include <QString>
#include <QStringList>
#include <QDir>
@ -167,7 +169,7 @@ bool PlaylistImporter::parsePlaylist_m3u(QFile &data, QStringList &fileList, con
if(filename.exists() && filename.isFile())
{
qDebug("Found: \"%s\"", filePath[i].toUtf8().constData());
qDebug("Found: \"%s\"", QUTF8(filePath[i]));
if(isPlaylist(filename.canonicalFilePath()) == notPlaylist)
{
fileList << filename.canonicalFilePath();

View File

@ -64,7 +64,7 @@ CueSplitter::CueSplitter(const QString &outputDir, const QString &baseName, CueS
for(int i = 0; i < nInputFiles; i++)
{
m_inputFilesInfo.insert(inputFilesInfo[i].filePath(), inputFilesInfo[i]);
qDebug("File %02d: <%s>", i, inputFilesInfo[i].filePath().toUtf8().constData());
qDebug("File %02d: <%s>", i, QUTF8(inputFilesInfo[i].filePath()));
}
qDebug("All input files added.");
@ -95,7 +95,7 @@ void CueSplitter::run()
if(!QDir(m_outputDir).exists())
{
qWarning("Output directory \"%s\" does not exist!", m_outputDir.toUtf8().constData());
qWarning("Output directory \"%s\" does not exist!", QUTF8(m_outputDir));
return;
}
@ -243,12 +243,12 @@ void CueSplitter::handleUpdate(int progress)
void CueSplitter::splitFile(const QString &output, const int trackNo, const QString &file, const double offset, const double length, const AudioFileModel_MetaInfo &metaInfo, const int baseProgress)
{
qDebug("[Track %02d]", trackNo);
qDebug("File: <%s>", file.toUtf8().constData());
qDebug("File: <%s>", QUTF8(file));
qDebug("Offset: <%f> <%s>", offset, indexToString(offset).toLatin1().constData());
qDebug("Length: <%f> <%s>", length, indexToString(length).toLatin1().constData());
qDebug("Artist: <%s>", metaInfo.artist().toUtf8().constData());
qDebug("Title: <%s>", metaInfo.title().toUtf8().constData());
qDebug("Album: <%s>", metaInfo.album().toUtf8().constData());
qDebug("Artist: <%s>", QUTF8(metaInfo.artist()));
qDebug("Title: <%s>", QUTF8(metaInfo.title()));
qDebug("Album: <%s>", QUTF8(metaInfo.album()));
int prevProgress = baseProgress;
@ -261,7 +261,7 @@ void CueSplitter::splitFile(const QString &output, const int trackNo, const QStr
QString baseName = shortName(QFileInfo(output).fileName());
QString decompressedInput = m_decompressedFiles[file];
qDebug("Input: <%s>", decompressedInput.toUtf8().constData());
qDebug("Input: <%s>", QUTF8(decompressedInput));
AudioFileModel outFileInfo(output);
outFileInfo.setMetaInfo(metaInfo);

View File

@ -83,7 +83,7 @@ void DiskObserverThread::observe(void)
{
if(freeSpace < minimumSpace)
{
qWarning("Free diskspace on '%s' dropped below %s MB, only %s MB free!", m_path.toUtf8().constData(), QString::number(minimumSpace / 1048576ui64).toUtf8().constData(), QString::number(freeSpace / 1048576ui64).toUtf8().constData());
qWarning("Free diskspace on '%s' dropped below %s MB, only %s MB free!", QUTF8(m_path), QUTF8(QString::number(minimumSpace / 1048576ui64)), QUTF8(QString::number(freeSpace / 1048576ui64)));
emit messageLogged(tr("Low diskspace on drive '%1' detected (only %2 MB are free), problems can occur!").arg(QDir::toNativeSeparators(m_path), QString::number(freeSpace / 1048576ui64)), ProgressModel::SysMsg_Warning);
minimumSpace = qMin(freeSpace, (minimumSpace >> 1));
}

View File

@ -96,7 +96,7 @@ void AnalyzeTask::run_ex(void)
{
int fileType = fileTypeNormal;
QString currentFile = QDir::fromNativeSeparators(m_inputFile);
qDebug("Analyzing: %s", currentFile.toUtf8().constData());
qDebug("Analyzing: %s", QUTF8(currentFile));
AudioFileModel file = analyzeFile(currentFile, &fileType);
@ -132,12 +132,12 @@ void AnalyzeTask::run_ex(void)
}
else
{
qDebug("Rejected Avisynth file: %s", file.filePath().toUtf8().constData());
qDebug("Rejected Avisynth file: %s", QUTF8(file.filePath()));
}
}
else
{
qDebug("Rejected file of unknown type: %s", file.filePath().toUtf8().constData());
qDebug("Rejected file of unknown type: %s", QUTF8(file.filePath()));
}
}
break;
@ -219,7 +219,7 @@ const AudioFileModel AnalyzeTask::analyzeFile(const QString &filePath, int *type
QString line = QString::fromUtf8(process.readLine().constData()).simplified();
if(!line.isEmpty())
{
//qDebug("Line:%s", line.toUtf8().constData());
//qDebug("Line:%s", QUTF8(line));
int index = line.indexOf('=');
if(index > 0)
@ -278,7 +278,7 @@ const AudioFileModel AnalyzeTask::analyzeFile(const QString &filePath, int *type
void AnalyzeTask::updateInfo(AudioFileModel &audioFile, bool *skipNext, unsigned int *id_val, cover_t *coverType, QByteArray *coverData, const QString &key, const QString &value)
{
//qWarning("'%s' -> '%s'", key.toUtf8().constData(), value.toUtf8().constData());
//qWarning("'%s' -> '%s'", QUTF8(key), QUTF8(value));
/*New Stream*/
if(IS_KEY("Gen_ID") || IS_KEY("Aud_ID"))
@ -393,7 +393,7 @@ void AnalyzeTask::updateInfo(AudioFileModel &audioFile, bool *skipNext, unsigned
}
else
{
qWarning("Unknown key '%s' with value '%s' found!", key.toUtf8().constData(), value.toUtf8().constData());
qWarning("Unknown key '%s' with value '%s' found!", QUTF8(key), QUTF8(value));
}
return;
}
@ -454,13 +454,13 @@ void AnalyzeTask::updateInfo(AudioFileModel &audioFile, bool *skipNext, unsigned
}
else
{
qWarning("Unknown key '%s' with value '%s' found!", key.toUtf8().constData(), value.toUtf8().constData());
qWarning("Unknown key '%s' with value '%s' found!", QUTF8(key), QUTF8(value));
}
return;
}
/*Section not recognized*/
qWarning("Unknown section: %s", key.toUtf8().constData());
qWarning("Unknown section: %s", QUTF8(key));
}
bool AnalyzeTask::checkFile_CDDA(QFile &file)

View File

@ -222,7 +222,7 @@ void InitializationThread::run()
default: THROW("CPU support undefined!");
}
//Allocate maps
//Allocate queues
QQueue<QString> queueToolName;
QQueue<QString> queueChecksum;
QQueue<QString> queueVersInfo;
@ -276,7 +276,7 @@ void InitializationThread::run()
const QByteArray toolHash(checksum.toLatin1());
if(toolHash.size() != 96)
{
qFatal("The checksum for \"%s\" has an invalid size!", toolName.toUtf8().constData());
qFatal("The checksum for \"%s\" has an invalid size!", QUTF8(toolName));
return;
}
@ -284,7 +284,7 @@ void InitializationThread::run()
if(!(resource->isValid() && resource->data()))
{
LAMEXP_DELETE(resource);
qFatal("The resource for \"%s\" could not be found!", toolName.toUtf8().constData());
qFatal("The resource for \"%s\" could not be found!", QUTF8(toolName));
return;
}
@ -419,7 +419,7 @@ void InitializationThread::initTranslations(void)
{
if(lamexp_translation_register(langId, qmFile, langName, systemId, country))
{
qDebug("Registering translation: %s = %s (%u) [%u]", qmFile.toUtf8().constData(), langName.toUtf8().constData(), systemId, country);
qDebug("Registering translation: %s = %s (%u) [%u]", QUTF8(qmFile), QUTF8(langName), systemId, country);
}
else
{
@ -450,7 +450,7 @@ void InitializationThread::initNeroAac(void)
return;
}
qDebug("Found Nero AAC encoder binary:\n%s\n", neroFileInfo[0].canonicalFilePath().toUtf8().constData());
qDebug("Found Nero AAC encoder binary:\n%s\n", QUTF8(neroFileInfo[0].canonicalFilePath()));
LockedFile *neroBin[3];
for(int i = 0; i < 3; i++) neroBin[i] = NULL;
@ -555,8 +555,8 @@ void InitializationThread::initFhgAac(void)
return;
}
qDebug("Found FhgAacEnc cli_exe:\n%s\n", fhgFileInfo[0].canonicalFilePath().toUtf8().constData());
qDebug("Found FhgAacEnc enc_dll:\n%s\n", fhgFileInfo[1].canonicalFilePath().toUtf8().constData());
qDebug("Found FhgAacEnc cli_exe:\n%s\n", QUTF8(fhgFileInfo[0].canonicalFilePath()));
qDebug("Found FhgAacEnc enc_dll:\n%s\n", QUTF8(fhgFileInfo[1].canonicalFilePath()));
LockedFile *fhgBin[5];
for(int i = 0; i < 5; i++) fhgBin[i] = NULL;
@ -654,7 +654,7 @@ void InitializationThread::initQAac(void)
return;
}
qDebug("Found QAAC encoder:\n%s\n", qaacFileInfo[0].canonicalFilePath().toUtf8().constData());
qDebug("Found QAAC encoder:\n%s\n", QUTF8(qaacFileInfo[0].canonicalFilePath()));
LockedFile *qaacBin[2];
for(int i = 0; i < 2; i++) qaacBin[i] = NULL;
@ -800,17 +800,17 @@ void InitializationThread::selfTest(void)
const QByteArray expectedHash = QByteArray(g_lamexp_tools[i].pcHash);
if(g_lamexp_tools[i].uiCpuType & cpu[k])
{
qDebug("%02i -> %s", ++n, toolName.toUtf8().constData());
qDebug("%02i -> %s", ++n, QUTF8(toolName));
QFile resource(QString(":/tools/%1").arg(toolName));
if(!resource.open(QIODevice::ReadOnly))
{
qFatal("The resource for \"%s\" could not be opened!", toolName.toUtf8().constData());
qFatal("The resource for \"%s\" could not be opened!", QUTF8(toolName));
break;
}
QByteArray hash = LockedFile::fileHash(resource);
if(hash.isNull() || _stricmp(hash.constData(), expectedHash.constData()))
{
qFatal("Hash check for tool \"%s\" has failed!", toolName.toUtf8().constData());
qFatal("Hash check for tool \"%s\" has failed!", QUTF8(toolName));
break;
}
resource.close();

View File

@ -69,7 +69,7 @@ void MessageProducerThread::run()
QFileInfo file = QFileInfo(arguments[++i]);
if(file.exists() && file.isFile())
{
lamexp_ipc_send(1, file.canonicalFilePath().toUtf8().constData());
lamexp_ipc_send(1, QUTF8(file.canonicalFilePath()));
}
bSentFiles = true;
}
@ -78,7 +78,7 @@ void MessageProducerThread::run()
QDir dir = QDir(arguments[++i]);
if(dir.exists())
{
lamexp_ipc_send(2, dir.canonicalPath().toUtf8().constData());
lamexp_ipc_send(2, QUTF8(dir.canonicalPath()));
}
bSentFiles = true;
}
@ -87,7 +87,7 @@ void MessageProducerThread::run()
QDir dir = QDir(arguments[++i]);
if(dir.exists())
{
lamexp_ipc_send(3, dir.canonicalPath().toUtf8().constData());
lamexp_ipc_send(3, QUTF8(dir.canonicalPath()));
}
bSentFiles = true;
}