forked from qt-creator/qt-creator
Reinvent deprecated qSort as Utils::sort
Change-Id: I4f6011cc2b6127037249aabc2426a88ad7108ebf Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "debuggercore.h"
|
||||
#include "debuggerrunconfigurationaspect.h"
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/appmainwindow.h>
|
||||
#include <utils/styledbar.h>
|
||||
#include <utils/qtcassert.h>
|
||||
@@ -440,14 +441,11 @@ QDockWidget *DebuggerMainWindow::createDockWidget(const DebuggerLanguage &langua
|
||||
return dockWidget;
|
||||
}
|
||||
|
||||
static bool sortCommands(Command *cmd1, Command *cmd2)
|
||||
{
|
||||
return cmd1->action()->text() < cmd2->action()->text();
|
||||
}
|
||||
|
||||
void DebuggerMainWindow::addStagedMenuEntries()
|
||||
{
|
||||
qSort(d->m_menuCommandsToAdd.begin(), d->m_menuCommandsToAdd.end(), &sortCommands);
|
||||
Utils::sort(d->m_menuCommandsToAdd, [](Command *cmd1, Command *cmd2) {
|
||||
return cmd1->action()->text() < cmd2->action()->text();
|
||||
});
|
||||
foreach (Command *cmd, d->m_menuCommandsToAdd)
|
||||
d->m_viewsMenu->addAction(cmd);
|
||||
d->m_menuCommandsToAdd.clear();
|
||||
|
||||
Reference in New Issue
Block a user