AbstractCommand *CommandFactory::parseCommand(QString const &command) { QString const normalizedCommand = command.toLower().trimmed(); QStringList const parts = normalizedCommand.split(" ", QString::SkipEmptyParts); if (parts.isEmpty()) { return 0; } AbstractCommand *result = parseCommand(parts); if (result) { result->setParent(this); } else { qDebug() << "Error while parsing command" << command; } return result; }