1 ///////////////////////////////////////////////////////////////////////////////
2 // LameXP - Audio Encoder Front-End
3 // Copyright (C) 2004-2017 LoRd_MuldeR <MuldeR2@GMX.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version, but always including the *additional*
9 // restrictions defined in the "License.txt" file.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License along
17 // with this program; if not, write to the Free Software Foundation, Inc.,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 // http://www.gnu.org/licenses/gpl-2.0.txt
21 ///////////////////////////////////////////////////////////////////////////////
23 #include "Thread_FileAnalyzer_Task.h"
27 #include "LockedFile.h"
28 #include "Model_AudioFile.h"
29 #include "MimeTypes.h"
32 #include <MUtils/Global.h>
33 #include <MUtils/OSSupport.h>
34 #include <MUtils/Exception.h>
44 #include <QReadLocker>
45 #include <QWriteLocker>
47 #include <QXmlSimpleReader>
48 #include <QXmlInputSource>
49 #include <QXmlStreamReader>
60 ////////////////////////////////////////////////////////////
62 ////////////////////////////////////////////////////////////
64 #define ADD_PROPTERY_MAPPING_1(TYPE, NAME) do \
66 ADD_PROPTERY_MAPPING_2(TYPE, NAME, NAME); \
70 #define ADD_PROPTERY_MAPPING_2(TYPE, MI_NAME, LX_NAME) do \
72 builder->insert(qMakePair(trackType_##TYPE, QString::fromLatin1(#MI_NAME)), propertyId_##LX_NAME); \
77 #define SET_OPTIONAL(TYPE, IF_CMD, THEN_CMD) do \
80 if((IF_CMD)) { THEN_CMD; } \
84 #define STRICMP(A,B) ((A).compare((B), Qt::CaseInsensitive) == 0)
86 ////////////////////////////////////////////////////////////
88 ////////////////////////////////////////////////////////////
90 AnalyzeTask::AnalyzeTask(const int taskId
, const QString
&inputFile
, QAtomicInt
&abortFlag
)
93 m_inputFile(inputFile
),
94 m_mediaInfoBin(lamexp_tools_lookup("mediainfo.exe")),
95 m_mediaInfoVer(lamexp_tools_version("mediainfo.exe")),
96 m_avs2wavBin(lamexp_tools_lookup("avs2wav.exe")),
97 m_abortFlag(abortFlag
),
98 m_propertiesIdx(initPropertiesIdx()),
99 m_trackTypes(initTrackTypes())
101 if(m_mediaInfoBin
.isEmpty() || m_avs2wavBin
.isEmpty())
103 qFatal("Invalid path to MediaInfo binary. Tool not initialized properly.");
107 AnalyzeTask::~AnalyzeTask(void)
109 emit
taskCompleted(m_taskId
);
112 ////////////////////////////////////////////////////////////
113 // Static initialization
114 ////////////////////////////////////////////////////////////
116 QReadWriteLock
AnalyzeTask::s_lock
;
117 QScopedPointer
<const QMap
<QPair
<AnalyzeTask::MI_trackType_t
, QString
>, AnalyzeTask::MI_propertyId_t
>> AnalyzeTask::s_pPropertiesIdx
;
118 QScopedPointer
<const QMap
<QString
, AnalyzeTask::MI_trackType_t
>> AnalyzeTask::s_pTrackTypes
;
120 const QMap
<QPair
<AnalyzeTask::MI_trackType_t
, QString
>, AnalyzeTask::MI_propertyId_t
> &AnalyzeTask::initPropertiesIdx(void)
122 QReadLocker
rdLocker(&s_lock
);
123 if (s_pPropertiesIdx
.isNull())
126 QWriteLocker
wrLocker(&s_lock
);
127 if (s_pPropertiesIdx
.isNull())
129 QMap
<QPair
<MI_trackType_t
, QString
>, MI_propertyId_t
> *const builder
= new QMap
<QPair
<MI_trackType_t
, QString
>, MI_propertyId_t
>();
130 ADD_PROPTERY_MAPPING_2(gen
, format
, container
);
131 ADD_PROPTERY_MAPPING_2(gen
, format_profile
, container_profile
);
132 ADD_PROPTERY_MAPPING_1(gen
, duration
);
133 ADD_PROPTERY_MAPPING_1(gen
, title
);
134 ADD_PROPTERY_MAPPING_2(gen
, track
, title
);
135 ADD_PROPTERY_MAPPING_1(gen
, artist
);
136 ADD_PROPTERY_MAPPING_2(gen
, performer
, artist
);
137 ADD_PROPTERY_MAPPING_1(gen
, album
);
138 ADD_PROPTERY_MAPPING_1(gen
, genre
);
139 ADD_PROPTERY_MAPPING_1(gen
, released_date
);
140 ADD_PROPTERY_MAPPING_2(gen
, recorded_date
, released_date
);
141 ADD_PROPTERY_MAPPING_1(gen
, track_position
);
142 ADD_PROPTERY_MAPPING_1(gen
, comment
);
143 ADD_PROPTERY_MAPPING_1(aud
, format
);
144 ADD_PROPTERY_MAPPING_1(aud
, format_version
);
145 ADD_PROPTERY_MAPPING_1(aud
, format_profile
);
146 ADD_PROPTERY_MAPPING_1(aud
, duration
);
147 ADD_PROPTERY_MAPPING_1(aud
, channel_s_
);
148 ADD_PROPTERY_MAPPING_1(aud
, samplingrate
);
149 ADD_PROPTERY_MAPPING_1(aud
, bitdepth
);
150 ADD_PROPTERY_MAPPING_1(aud
, bitrate
);
151 ADD_PROPTERY_MAPPING_1(aud
, bitrate_mode
);
152 ADD_PROPTERY_MAPPING_1(aud
, encoded_library
);
153 s_pPropertiesIdx
.reset(builder
);
158 return (*s_pPropertiesIdx
);
161 const QMap
<QString
, AnalyzeTask::MI_trackType_t
> &AnalyzeTask::initTrackTypes(void)
163 QReadLocker
rdLocker(&s_lock
);
164 if (s_pTrackTypes
.isNull())
167 QWriteLocker
wrLocker(&s_lock
);
168 if (s_pTrackTypes
.isNull())
170 QMap
<QString
, AnalyzeTask::MI_trackType_t
> *const builder
= new QMap
<QString
, AnalyzeTask::MI_trackType_t
>();
171 builder
->insert("general", trackType_gen
);
172 builder
->insert("audio", trackType_aud
);
173 s_pTrackTypes
.reset(builder
);
178 return (*s_pTrackTypes
);
181 ////////////////////////////////////////////////////////////
183 ////////////////////////////////////////////////////////////
185 void AnalyzeTask::run()
191 catch(const std::exception
&error
)
193 MUTILS_PRINT_ERROR("\nGURU MEDITATION !!!\n\nException error:\n%s\n", error
.what());
194 MUtils::OS::fatal_exit(L
"Unhandeled C++ exception error, application will exit!");
198 MUTILS_PRINT_ERROR("\nGURU MEDITATION !!!\n\nUnknown exception error!\n");
199 MUtils::OS::fatal_exit(L
"Unhandeled C++ exception error, application will exit!");
203 void AnalyzeTask::run_ex(void)
205 int fileType
= fileTypeNormal
;
206 QString currentFile
= QDir::fromNativeSeparators(m_inputFile
);
207 qDebug("Analyzing: %s", MUTILS_UTF8(currentFile
));
209 AudioFileModel
fileInfo(currentFile
);
210 analyzeFile(currentFile
, fileInfo
, &fileType
);
212 if(MUTILS_BOOLIFY(m_abortFlag
))
214 qWarning("Operation cancelled by user!");
221 qWarning("Cannot access file for reading, skipping!");
224 qWarning("Dummy CDDA file detected, skipping!");
227 if(fileInfo
.metaInfo().title().isEmpty() || fileInfo
.techInfo().containerType().isEmpty() || fileInfo
.techInfo().audioType().isEmpty())
229 fileType
= fileTypeUnknown
;
230 if(!QFileInfo(currentFile
).suffix().compare("cue", Qt::CaseInsensitive
))
232 qWarning("Cue Sheet file detected, skipping!");
233 fileType
= fileTypeCueSheet
;
235 else if(!QFileInfo(currentFile
).suffix().compare("avs", Qt::CaseInsensitive
))
237 qDebug("Found a potential Avisynth script, investigating...");
238 if(analyzeAvisynthFile(currentFile
, fileInfo
))
240 fileType
= fileTypeNormal
;
244 qDebug("Rejected Avisynth file: %s", MUTILS_UTF8(fileInfo
.filePath()));
249 qDebug("Rejected file of unknown type: %s", MUTILS_UTF8(fileInfo
.filePath()));
256 emit
fileAnalyzed(m_taskId
, fileType
, fileInfo
);
259 ////////////////////////////////////////////////////////////
261 ////////////////////////////////////////////////////////////
263 const AudioFileModel
& AnalyzeTask::analyzeFile(const QString
&filePath
, AudioFileModel
&audioFile
, int *const type
)
265 *type
= fileTypeNormal
;
266 QFile
readTest(filePath
);
268 if (!readTest
.open(QIODevice::ReadOnly
))
270 *type
= fileTypeDenied
;
274 if (checkFile_CDDA(readTest
))
276 *type
= fileTypeCDDA
;
281 return analyzeMediaFile(filePath
, audioFile
);
284 const AudioFileModel
& AnalyzeTask::analyzeMediaFile(const QString
&filePath
, AudioFileModel
&audioFile
)
286 //bool skipNext = false;
287 QPair
<quint32
, quint32
> id_val(UINT_MAX
, UINT_MAX
);
288 quint32 coverType
= UINT_MAX
;
289 QByteArray coverData
;
292 params
<< QString("--Language=raw");
293 params
<< QString("-f");
294 params
<< QString("--Output=XML");
295 params
<< QDir::toNativeSeparators(filePath
);
298 MUtils::init_process(process
, QFileInfo(m_mediaInfoBin
).absolutePath());
299 process
.start(m_mediaInfoBin
, params
);
304 if(!process
.waitForStarted())
306 qWarning("MediaInfo process failed to create!");
307 qWarning("Error message: \"%s\"\n", process
.errorString().toLatin1().constData());
309 process
.waitForFinished(-1);
313 while(process
.state() != QProcess::NotRunning
)
315 if(MUTILS_BOOLIFY(m_abortFlag
))
318 qWarning("Process was aborted on user request!");
322 if(!process
.waitForReadyRead())
324 if(process
.state() == QProcess::Running
)
326 qWarning("MediaInfo time out. Killing the process now!");
328 process
.waitForFinished(-1);
335 const QByteArray dataNext
= process
.readAll();
336 if (dataNext
.isEmpty()) {
337 break; /*no more input data*/
343 process
.waitForFinished();
344 if (process
.state() != QProcess::NotRunning
)
347 process
.waitForFinished(-1);
350 while (!process
.atEnd())
352 const QByteArray dataNext
= process
.readAll();
353 if (dataNext
.isEmpty()) {
354 break; /*no more input data*/
359 #if defined(DUMP_MI_OUTPUT)
360 qDebug("!!!--START-->>>\n%s\n<<<--END--!!!", data
.constData());
361 #endif //DUMP_MI_OUTPUT
363 return parseMediaInfo(data
, audioFile
);
366 const AudioFileModel
& AnalyzeTask::parseMediaInfo(const QByteArray
&data
, AudioFileModel
&audioFile
)
368 QXmlStreamReader
xmlStream(data
);
369 bool firstFile
= true;
371 if (findNextElement(QLatin1String("MediaInfo"), xmlStream
))
373 const QString version
= findAttribute(QLatin1String("Version"), xmlStream
.attributes());
374 if (version
.isEmpty() || (!STRICMP(version
, QString().sprintf("0.%u.%02u", m_mediaInfoVer
/ 100U, m_mediaInfoVer
% 100))))
376 qWarning("Invalid version property \"%s\" was detected!", MUTILS_UTF8(version
));
379 while (findNextElement(QLatin1String("File"), xmlStream
))
384 parseFileInfo(xmlStream
, audioFile
);
388 qWarning("Skipping non-primary file!");
389 xmlStream
.skipCurrentElement();
394 if (!(audioFile
.techInfo().containerType().isEmpty() || audioFile
.techInfo().audioType().isEmpty()))
396 if (audioFile
.metaInfo().title().isEmpty())
398 QString baseName
= QFileInfo(audioFile
.filePath()).fileName();
400 if ((index
= baseName
.lastIndexOf(".")) >= 0)
402 baseName
= baseName
.left(index
);
404 baseName
= baseName
.replace("_", " ").simplified();
405 if ((index
= baseName
.lastIndexOf(" - ")) >= 0)
407 baseName
= baseName
.mid(index
+ 3).trimmed();
409 audioFile
.metaInfo().setTitle(baseName
);
411 if ((audioFile
.techInfo().audioType().compare("PCM", Qt::CaseInsensitive
) == 0) && (audioFile
.techInfo().audioProfile().compare("Float", Qt::CaseInsensitive
) == 0))
413 if (audioFile
.techInfo().audioBitdepth() == 32) audioFile
.techInfo().setAudioBitdepth(AudioFileModel::BITDEPTH_IEEE_FLOAT32
);
418 qWarning("Audio file format could *not* be recognized!");
424 void AnalyzeTask::parseFileInfo(QXmlStreamReader
&xmlStream
, AudioFileModel
&audioFile
)
426 MI_trackType_t trackType
;
427 QSet
<MI_trackType_t
> tracksProcessed
;
429 while (findNextElement(QLatin1String("Track"), xmlStream
))
431 const QString typeString
= findAttribute(QLatin1String("Type"), xmlStream
.attributes());
432 if ((trackType
= m_trackTypes
.value(typeString
.toLower(), MI_trackType_t(-1))) != MI_trackType_t(-1))
434 if (!tracksProcessed
.contains(trackType
))
436 tracksProcessed
<< trackType
;
437 parseTrackInfo(xmlStream
, trackType
, audioFile
);
441 qWarning("Skipping non-primary '%s' track!", MUTILS_UTF8(typeString
));
442 xmlStream
.skipCurrentElement();
447 qWarning("Skipping unsupported '%s' track!", MUTILS_UTF8(typeString
));
448 xmlStream
.skipCurrentElement();
453 void AnalyzeTask::parseTrackInfo(QXmlStreamReader
&xmlStream
, const MI_trackType_t trackType
, AudioFileModel
&audioFile
)
455 while (xmlStream
.readNextStartElement())
457 qDebug("%d::%s", trackType
, MUTILS_UTF8(xmlStream
.name()));
458 const MI_propertyId_t idx
= s_pPropertiesIdx
->value(qMakePair(trackType
, xmlStream
.name().toString().simplified().toLower()), MI_propertyId_t(-1));
459 if (idx
!= MI_propertyId_t(-1))
461 const QString encoding
= findAttribute(QLatin1String("dt"), xmlStream
.attributes());
462 const QString value
= xmlStream
.readElementText(QXmlStreamReader::SkipChildElements
).simplified();
463 if (!value
.isEmpty())
465 parseProperty(encoding
.isEmpty() ? value
: decodeStr(value
, encoding
), idx
, audioFile
);
470 xmlStream
.skipCurrentElement();
475 void AnalyzeTask::parseProperty(const QString
&value
, const MI_propertyId_t propertyIdx
, AudioFileModel
&audioFile
)
477 qWarning("--> %d: \"%s\"", propertyIdx
, MUTILS_UTF8(value
));
480 case propertyId_container
: audioFile
.techInfo().setContainerType(value
); return;
481 case propertyId_container_profile
: audioFile
.techInfo().setContainerProfile(value
); return;
482 case propertyId_duration
: SET_OPTIONAL(quint32
, parseDuration(value
, _tmp
), audioFile
.techInfo().setDuration(_tmp
)); return;
483 case propertyId_title
: audioFile
.metaInfo().setTitle(value
); return;
484 case propertyId_artist
: audioFile
.metaInfo().setArtist(value
); return;
485 case propertyId_album
: audioFile
.metaInfo().setAlbum(value
); return;
486 case propertyId_genre
: audioFile
.metaInfo().setGenre(value
); return;
487 case propertyId_released_date
: SET_OPTIONAL(quint32
, parseYear(value
, _tmp
), audioFile
.metaInfo().setYear(_tmp
)); return;
488 case propertyId_track_position
: SET_OPTIONAL(quint32
, parseUnsigned(value
, _tmp
), audioFile
.metaInfo().setPosition(_tmp
)); return;
489 case propertyId_comment
: audioFile
.metaInfo().setComment(value
); return;
490 case propertyId_format
: audioFile
.techInfo().setAudioType(value
); return;
491 case propertyId_format_version
: audioFile
.techInfo().setAudioVersion(value
); return;
492 case propertyId_format_profile
: audioFile
.techInfo().setAudioProfile(value
); return;
493 case propertyId_channel_s_
: SET_OPTIONAL(quint32
, parseUnsigned(value
, _tmp
), audioFile
.techInfo().setAudioChannels(_tmp
)); return;
494 case propertyId_samplingrate
: SET_OPTIONAL(quint32
, parseUnsigned(value
, _tmp
), audioFile
.techInfo().setAudioSamplerate(_tmp
)); return;
495 case propertyId_bitdepth
: SET_OPTIONAL(quint32
, parseUnsigned(value
, _tmp
), audioFile
.techInfo().setAudioBitdepth(_tmp
)); return;
496 case propertyId_bitrate
: SET_OPTIONAL(quint32
, parseDuration(value
, _tmp
), audioFile
.techInfo().setAudioBitrate(_tmp
)); return;
497 case propertyId_bitrate_mode
: SET_OPTIONAL(quint32
, parseRCMode(value
, _tmp
), audioFile
.techInfo().setAudioBitrateMode(_tmp
)); return;
498 case propertyId_encoded_library
: audioFile
.techInfo().setAudioEncodeLib(cleanAsciiStr(value
)); return;
499 default: MUTILS_THROW_FMT("Invalid property ID: %d", propertyIdx
);
503 bool AnalyzeTask::checkFile_CDDA(QFile
&file
)
506 QByteArray data
= file
.read(128);
508 int i
= data
.indexOf("RIFF");
509 int j
= data
.indexOf("CDDA");
510 int k
= data
.indexOf("fmt ");
512 return ((i
>= 0) && (j
>= 0) && (k
>= 0) && (k
> j
) && (j
> i
));
516 void AnalyzeTask::retrieveCover(AudioFileModel &audioFile, const quint32 coverType, const QByteArray &coverData)
518 qDebug("Retrieving cover! (MIME_TYPES_MAX=%u)", MIME_TYPES_MAX);
520 static const QString ext = QString::fromLatin1(MIME_TYPES[qBound(0U, coverType, MIME_TYPES_MAX)].ext[0]);
521 if(!(QImage::fromData(coverData, ext.toUpper().toLatin1().constData()).isNull()))
523 QFile coverFile(QString("%1/%2.%3").arg(MUtils::temp_folder(), MUtils::next_rand_str(), ext));
524 if(coverFile.open(QIODevice::WriteOnly))
526 coverFile.write(coverData);
528 audioFile.metaInfo().setCover(coverFile.fileName(), true);
533 qWarning("Image data seems to be invalid :-(");
538 bool AnalyzeTask::analyzeAvisynthFile(const QString
&filePath
, AudioFileModel
&info
)
541 MUtils::init_process(process
, QFileInfo(m_avs2wavBin
).absolutePath());
543 process
.start(m_avs2wavBin
, QStringList() << QDir::toNativeSeparators(filePath
) << "?");
545 if(!process
.waitForStarted())
547 qWarning("AVS2WAV process failed to create!");
548 qWarning("Error message: \"%s\"\n", process
.errorString().toLatin1().constData());
550 process
.waitForFinished(-1);
554 bool bInfoHeaderFound
= false;
556 while(process
.state() != QProcess::NotRunning
)
558 if(MUTILS_BOOLIFY(m_abortFlag
))
561 qWarning("Process was aborted on user request!");
565 if(!process
.waitForReadyRead())
567 if(process
.state() == QProcess::Running
)
569 qWarning("AVS2WAV time out. Killing process and skipping file!");
571 process
.waitForFinished(-1);
578 while(process
.canReadLine())
580 QString line
= QString::fromUtf8(process
.readLine().constData()).simplified();
583 int index
= line
.indexOf(':');
586 QString key
= line
.left(index
).trimmed();
587 QString val
= line
.mid(index
+1).trimmed();
589 if(bInfoHeaderFound
&& !key
.isEmpty() && !val
.isEmpty())
591 if(key
.compare("TotalSeconds", Qt::CaseInsensitive
) == 0)
594 unsigned int duration
= val
.toUInt(&ok
);
595 if(ok
) info
.techInfo().setDuration(duration
);
597 if(key
.compare("SamplesPerSec", Qt::CaseInsensitive
) == 0)
600 unsigned int samplerate
= val
.toUInt(&ok
);
601 if(ok
) info
.techInfo().setAudioSamplerate (samplerate
);
603 if(key
.compare("Channels", Qt::CaseInsensitive
) == 0)
606 unsigned int channels
= val
.toUInt(&ok
);
607 if(ok
) info
.techInfo().setAudioChannels(channels
);
609 if(key
.compare("BitsPerSample", Qt::CaseInsensitive
) == 0)
612 unsigned int bitdepth
= val
.toUInt(&ok
);
613 if(ok
) info
.techInfo().setAudioBitdepth(bitdepth
);
619 if(line
.contains("[Audio Info]", Qt::CaseInsensitive
))
621 info
.techInfo().setAudioType("Avisynth");
622 info
.techInfo().setContainerType("Avisynth");
623 bInfoHeaderFound
= true;
630 process
.waitForFinished();
631 if(process
.state() != QProcess::NotRunning
)
634 process
.waitForFinished(-1);
638 switch(process
.exitCode())
641 qDebug("Avisynth script was analyzed successfully.");
645 qWarning("It appears that Avisynth is not installed on the system!");
649 qWarning("Failed to open the Avisynth script, bad AVS file?");
655 // ---------------------------------------------------------
657 // ---------------------------------------------------------
659 QString
AnalyzeTask::decodeStr(const QString
&str
, const QString
&encoding
)
661 if (STRICMP(encoding
, QLatin1String("binary.base64")))
663 const QString decoded
= QString::fromUtf8(QByteArray::fromBase64(str
.toLatin1()));
669 bool AnalyzeTask::parseUnsigned(const QString
&str
, quint32
&value
)
672 value
= str
.toUInt(&okay
);
675 bool AnalyzeTask::parseDuration(const QString
&str
, quint32
&value
)
677 if (parseUnsigned(str
, value
))
679 value
= (value
+ 500U) / 1000U;
685 bool AnalyzeTask::parseYear(const QString
&str
, quint32
&value
)
687 if (str
.startsWith(QLatin1String("UTC"), Qt::CaseInsensitive
))
689 const QDate date
= QDate::fromString(str
.mid(3).trimmed().left(10), QLatin1String("yyyy-MM-dd"));
699 return parseUnsigned(str
, value
);
703 bool AnalyzeTask::parseRCMode(const QString
&str
, quint32
&value
)
705 if (STRICMP(str
, QLatin1String("CBR")))
707 value
= AudioFileModel::BitrateModeConstant
;
710 if (STRICMP(str
, QLatin1String("VBR")))
712 value
= AudioFileModel::BitrateModeVariable
;
718 QString
AnalyzeTask::cleanAsciiStr(const QString
&str
)
720 QByteArray ascii
= str
.toLatin1();
721 for (QByteArray::Iterator iter
= ascii
.begin(); iter
!= ascii
.end(); ++iter
)
723 if ((*iter
< 0x20) || (*iter
>= 0x7F)) *iter
= 0x3F;
725 return QString::fromLatin1(ascii
).remove(QLatin1Char('?')).simplified();
728 bool AnalyzeTask::findNextElement(const QString
&name
, QXmlStreamReader
&xmlStream
)
730 while (xmlStream
.readNextStartElement())
732 if (STRICMP(xmlStream
.name(), name
))
736 xmlStream
.skipCurrentElement();
741 QString
AnalyzeTask::findAttribute(const QString
&name
, const QXmlStreamAttributes
&xmlAttributes
)
743 for (QXmlStreamAttributes::ConstIterator iter
= xmlAttributes
.constBegin(); iter
!= xmlAttributes
.constEnd(); ++iter
)
745 if (STRICMP(iter
->name(), name
))
747 const QString value
= iter
->value().toString().simplified();
748 if (!value
.isEmpty())
750 return value
; /*found*/
757 ////////////////////////////////////////////////////////////
759 ////////////////////////////////////////////////////////////
763 ////////////////////////////////////////////////////////////
765 ////////////////////////////////////////////////////////////