ShortcutsDialog.cpp   ShortcutsDialog.cpp 
skipping to change at line 73 skipping to change at line 73
filterModel(new ShortcutsFilterModel(this)), filterModel(new ShortcutsFilterModel(this)),
mainModel(new QStandardItemModel(this)) mainModel(new QStandardItemModel(this))
{ {
actionMgr = StelApp::getInstance().getStelActionManager(); actionMgr = StelApp::getInstance().getStelActionManager();
} }
ShortcutsDialog::~ShortcutsDialog() ShortcutsDialog::~ShortcutsDialog()
{ {
collisionItems.clear(); collisionItems.clear();
delete ui; delete ui;
ui = NULL; ui = Q_NULLPTR;
} }
void ShortcutsDialog::drawCollisions() void ShortcutsDialog::drawCollisions()
{ {
QBrush brush(Qt::red); QBrush brush(Qt::red);
foreach(QStandardItem* item, collisionItems) foreach(QStandardItem* item, collisionItems)
{ {
// change colors of all columns for better visibility // change colors of all columns for better visibility
item->setForeground(brush); item->setForeground(brush);
QModelIndex index = item->index(); QModelIndex index = item->index();
skipping to change at line 413 skipping to change at line 413
return subitem; return subitem;
} }
} }
return 0; return 0;
} }
void ShortcutsDialog::updateShortcutsItem(StelAction *action, void ShortcutsDialog::updateShortcutsItem(StelAction *action,
QStandardItem *shortcutItem) QStandardItem *shortcutItem)
{ {
QVariant shortcutId(action->getId()); QVariant shortcutId(action->getId());
if (shortcutItem == NULL) if (shortcutItem == Q_NULLPTR)
{ {
// search for item // search for item
shortcutItem = findItemByData(shortcutId, Qt::UserRole, 0); shortcutItem = findItemByData(shortcutId, Qt::UserRole, 0);
} }
// we didn't find item, create and add new // we didn't find item, create and add new
QStandardItem* groupItem = NULL; QStandardItem* groupItem = Q_NULLPTR;
if (shortcutItem == NULL) if (shortcutItem == Q_NULLPTR)
{ {
// firstly search for group // firstly search for group
QVariant groupId(action->getGroup()); QVariant groupId(action->getGroup());
groupItem = findItemByData(groupId, Qt::UserRole, 0); groupItem = findItemByData(groupId, Qt::UserRole, 0);
if (groupItem == NULL) if (groupItem == Q_NULLPTR)
{ {
// create and add new group to treeWidget // create and add new group to treeWidget
groupItem = updateGroup(action->getGroup()); groupItem = updateGroup(action->getGroup());
} }
// create shortcut item // create shortcut item
shortcutItem = new QStandardItem(); shortcutItem = new QStandardItem();
shortcutItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelecta ble); shortcutItem->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelecta ble);
groupItem->appendRow(shortcutItem); groupItem->appendRow(shortcutItem);
// store shortcut id, so we can find it when shortcut change d // store shortcut id, so we can find it when shortcut change d
shortcutItem->setData(shortcutId, Qt::UserRole); shortcutItem->setData(shortcutId, Qt::UserRole);
skipping to change at line 479 skipping to change at line 479
foreach (StelAction* action, actions) foreach (StelAction* action, actions)
{ {
updateShortcutsItem(action); updateShortcutsItem(action);
} }
} }
updateText(); updateText();
} }
bool ShortcutsDialog::itemIsEditable(QStandardItem *item) bool ShortcutsDialog::itemIsEditable(QStandardItem *item)
{ {
if (item == NULL) return false; if (item == Q_NULLPTR) return false;
// non-editable items(not group items) have no Qt::ItemIsSelectable flag // non-editable items(not group items) have no Qt::ItemIsSelectable flag
return (Qt::ItemIsSelectable & item->flags()); return (Qt::ItemIsSelectable & item->flags());
} }
void ShortcutsDialog::resetModel() void ShortcutsDialog::resetModel()
{ {
mainModel->clear(); mainModel->clear();
setModelHeader(); setModelHeader();
} }
 End of changes. 5 change blocks. 
6 lines changed or deleted 6 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/