Skip to content

Commit

Permalink
make it possible to also rename entries in the library tab
Browse files Browse the repository at this point in the history
  • Loading branch information
mhogomchungu committed Aug 27, 2024
1 parent 502f64a commit c9e0176
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,18 @@ void library::addEntrySlot( const directoryEntries::iter& s )

void library::cxMenuRequested( QPoint )
{
QMenu m ;
auto row = m_table.currentRow() ;

if( row == -1 ){

return ;
}

connect( m.addAction( tr( "Delete" ) ),&QAction::triggered,[ this ](){
QMenu m ;

auto row = m_table.currentRow() ;
connect( m.addAction( tr( "Delete" ) ),&QAction::triggered,[ this,row ](){

if( row != -1 && m_table.isSelected( row ) ){
if( m_table.isSelected( row ) ){

auto m = m_currentPath + "/" + m_table.item( row,1 ).text() ;

Expand Down Expand Up @@ -409,9 +414,7 @@ void library::cxMenuRequested( QPoint )
} ) ;
} ) ;

connect( m.addAction( tr( "Rename" ) ),&QAction::triggered,[ this ](){

auto row = m_table.currentRow() ;
connect( m.addAction( tr( "Rename" ) ),&QAction::triggered,[ this,row ](){

auto m = m_table.item( row,1 ).text() ;

Expand Down

0 comments on commit c9e0176

Please sign in to comment.