Remove default arguments.

This commit is contained in:
kh1 2011-04-13 11:30:05 +02:00
parent b63f2c3221
commit b5dfa00cea
4 changed files with 11 additions and 10 deletions

View File

@ -114,8 +114,8 @@ static Component* subComponentByName(const Installer *installer, const QString &
if (check != 0 && componentMatches(check, name, version))
return check;
const QList<Component*> rootComponents =
check == 0 ? installer->components(false, AllMode) : check->childComponents();
const QList<Component*> rootComponents = check == 0 ? installer->components(false, AllMode)
: check->childComponents(false, AllMode);
foreach (QInstaller::Component* component, rootComponents) {
Component* const result = subComponentByName(installer, name, version, component);
if (result != 0)
@ -1139,7 +1139,7 @@ QList<Component*> Installer::components(bool recursive, RunMode runMode) const
QList<Component*> result;
foreach (QInstaller::Component *component, d->m_rootComponents) {
result.push_back(component);
result += component->childComponents(true);
result += component->childComponents(true, runMode);
}
return result;

View File

@ -339,16 +339,16 @@ void Component::removeComponent(Component *component)
*/
QList<Component*> Component::childComponents(bool recursive, RunMode runMode) const
{
QList<Component*> result;
if (runMode == UpdaterMode)
return QList<Component*>();
return result;
if (!recursive)
return d->m_allComponents;
QList<Component*> result;
foreach (Component *component, d->m_allComponents) {
result.append(component);
result += component->childComponents(true);
result += component->childComponents(true, runMode);
}
return result;
}

View File

@ -109,7 +109,7 @@ public:
Component *parentComponent() const;
void appendComponent(Component *component);
void removeComponent(Component *component);
QList<Component*> childComponents(bool recursive = false, RunMode runMode = AllMode) const;
QList<Component*> childComponents(bool recursive, RunMode runMode) const;
void loadComponentScript();

View File

@ -150,9 +150,10 @@ int ComponentModelHelper::childCount() const
*/
int ComponentModelHelper::indexInParent() const
{
int index = 0;
if (Component *parent = m_componentPrivate->m_parentComponent->parentComponent())
return parent->childComponents().indexOf(m_componentPrivate->m_parentComponent);
return 0;
index = parent->childComponents(false, AllMode).indexOf(m_componentPrivate->m_parentComponent);
return (index >= 0 ? index : 0);
}
/*!
@ -167,7 +168,7 @@ QList<Component*> ComponentModelHelper::childs() const
QList<Component*> result;
foreach (Component *component, *components) {
result.append(component);
result += component->childComponents(true);
result += component->childComponents(true, AllMode);
}
return result;
}