Gui: Use auto and range-based for (#7481)
* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. * When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
@@ -83,7 +83,7 @@ ToolBarItem* ToolBarItem::findItem(const std::string& name)
|
||||
|
||||
ToolBarItem* ToolBarItem::copy() const
|
||||
{
|
||||
ToolBarItem* root = new ToolBarItem;
|
||||
auto root = new ToolBarItem;
|
||||
root->setCommand( command() );
|
||||
|
||||
QList<ToolBarItem*> items = getItems();
|
||||
@@ -138,7 +138,7 @@ ToolBarItem& ToolBarItem::operator << (ToolBarItem* item)
|
||||
|
||||
ToolBarItem& ToolBarItem::operator << (const std::string& command)
|
||||
{
|
||||
ToolBarItem* item = new ToolBarItem(this);
|
||||
auto item = new ToolBarItem(this);
|
||||
item->setCommand(command);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user