mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kdecore: remove redundant locks in KMimeTypeRepository
once the globs and magic rules are parsed locking is redundant Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
32445250ef
commit
268b2cc053
1 changed files with 5 additions and 9 deletions
|
@ -221,7 +221,6 @@ QStringList KMimeTypeRepository::findFromFileName(const QString &fileName, QStri
|
|||
{
|
||||
parseGlobs();
|
||||
|
||||
std::lock_guard<std::recursive_mutex> lock(m_mutex);
|
||||
// First try the high weight matches (>=50), if any.
|
||||
QStringList matchingMimeTypes;
|
||||
QString foundExt;
|
||||
|
@ -258,8 +257,6 @@ KMimeType::Ptr KMimeTypeRepository::findFromContent(QIODevice* device, int* accu
|
|||
parseMagic();
|
||||
|
||||
// Apply magic rules
|
||||
{
|
||||
std::lock_guard<std::recursive_mutex> lock(m_mutex);
|
||||
Q_FOREACH ( const KMimeMagicRule& rule, m_magicRules ) {
|
||||
if (rule.match(device, deviceSize, beginning)) {
|
||||
if (accuracy) {
|
||||
|
@ -268,7 +265,6 @@ KMimeType::Ptr KMimeTypeRepository::findFromContent(QIODevice* device, int* accu
|
|||
return findMimeTypeByName(rule.mimetype());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do fallback code so that we never return 0
|
||||
// Nothing worked, check if the file contents looks like binary or text
|
||||
|
|
Loading…
Add table
Reference in a new issue