Commit dc13acd5 authored by Oswald Buddenhagen's avatar Oswald Buddenhagen
Browse files

minor optimization: QList::removeOne() returns a bool

parent 9e7a4c7d
......@@ -401,11 +401,8 @@ void FileManager::fileDestroyed(QObject *obj)
{
IFile *file = static_cast<IFile*>(obj);
// Check the special unwatched first:
if (d->m_filesWithoutWatch.contains(file)) {
d->m_filesWithoutWatch.removeOne(file);
return;
}
removeFileInfo(file);
if (!d->m_filesWithoutWatch.removeOne(file))
removeFileInfo(file);
}
/*!
......@@ -420,14 +417,10 @@ void FileManager::removeFile(IFile *file)
QTC_ASSERT(file, return);
// Special casing unwatched files
if (d->m_filesWithoutWatch.contains(file)) {
disconnect(file, SIGNAL(destroyed(QObject *)), this, SLOT(fileDestroyed(QObject *)));
d->m_filesWithoutWatch.removeOne(file);
return;
if (!d->m_filesWithoutWatch.removeOne(file)) {
removeFileInfo(file);
disconnect(file, SIGNAL(changed()), this, SLOT(checkForNewFileName()));
}
removeFileInfo(file);
disconnect(file, SIGNAL(changed()), this, SLOT(checkForNewFileName()));
disconnect(file, SIGNAL(destroyed(QObject *)), this, SLOT(fileDestroyed(QObject *)));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment