qt: rename variable

This commit is contained in:
Prince Gupta 2024-03-13 12:34:24 +05:30 committed by Jean-Baptiste Kempf
parent 3d8fa03b17
commit 5f1e80b1b7
1 changed files with 12 additions and 12 deletions

View File

@ -848,7 +848,7 @@ PlaylistContextMenu::PlaylistContextMenu(QObject* parent)
: QObject(parent) : QObject(parent)
{} {}
void PlaylistContextMenu::popup(int currentIndex, QPoint pos ) void PlaylistContextMenu::popup(int selectedIndex, QPoint pos )
{ {
if (!m_controler || !m_model || !m_selectionModel) if (!m_controler || !m_model || !m_selectionModel)
return; return;
@ -860,15 +860,15 @@ void PlaylistContextMenu::popup(int currentIndex, QPoint pos )
for (const int modelIndex : m_selectionModel->selectedIndexesFlat()) for (const int modelIndex : m_selectionModel->selectedIndexesFlat())
selectedUrlList.push_back(m_model->itemAt(modelIndex).getUrl()); selectedUrlList.push_back(m_model->itemAt(modelIndex).getUrl());
PlaylistItem currentItem; PlaylistItem selectedItem;
if (currentIndex >= 0) if (selectedIndex >= 0)
currentItem = m_model->itemAt(currentIndex); selectedItem = m_model->itemAt(selectedIndex);
if (currentItem) if (selectedItem)
{ {
action = m_menu->addAction( qtr("Play") ); action = m_menu->addAction( qtr("Play") );
connect(action, &QAction::triggered, [this, currentIndex]( ) { connect(action, &QAction::triggered, [this, selectedIndex]( ) {
m_controler->goTo(currentIndex, true); m_controler->goTo(selectedIndex, true);
}); });
m_menu->addSeparator(); m_menu->addSeparator();
@ -888,19 +888,19 @@ void PlaylistContextMenu::popup(int currentIndex, QPoint pos )
m_menu->addSeparator(); m_menu->addSeparator();
} }
if (currentItem) { if (selectedItem) {
action = m_menu->addAction( qtr("Information") ); action = m_menu->addAction( qtr("Information") );
action->setIcon(QIcon(":/menu/info.svg")); action->setIcon(QIcon(":/menu/info.svg"));
connect(action, &QAction::triggered, [currentItem]( ) { connect(action, &QAction::triggered, [selectedItem]( ) {
DialogsProvider::getInstance()->mediaInfoDialog(currentItem); DialogsProvider::getInstance()->mediaInfoDialog(selectedItem);
}); });
m_menu->addSeparator(); m_menu->addSeparator();
action = m_menu->addAction( qtr("Show Containing Directory...") ); action = m_menu->addAction( qtr("Show Containing Directory...") );
action->setIcon(QIcon(":/menu/folder.svg")); action->setIcon(QIcon(":/menu/folder.svg"));
connect(action, &QAction::triggered, [this, currentItem]( ) { connect(action, &QAction::triggered, [this, selectedItem]( ) {
m_controler->explore(currentItem); m_controler->explore(selectedItem);
}); });
m_menu->addSeparator(); m_menu->addSeparator();