mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-03 11:00:14 -05:00
fixed bug in duplication of virtual dir names
This commit is contained in:
parent
761d595cb7
commit
c6df59a421
@ -70,9 +70,8 @@ ShareManager::ShareManager()
|
||||
connect(ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancel()));
|
||||
|
||||
connect(ui.shareddirList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(shareddirListCostumPopupMenu(QPoint)));
|
||||
connect(ui.shareddirList, SIGNAL(currentCellChanged(int,int,int,int)), this, SLOT(shareddirListCurrentCellChanged(int,int,int,int)));
|
||||
|
||||
connect(ui.shareddirList, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(doubleClickedCell(int,int)));
|
||||
connect(ui.shareddirList, SIGNAL(cellChanged(int,int)), this, SLOT(handleCellChange(int,int)));
|
||||
|
||||
connect(NotifyQt::getInstance(), SIGNAL(groupsChanged(int)), this, SLOT(reload()));
|
||||
|
||||
@ -87,6 +86,26 @@ ShareManager::ShareManager()
|
||||
reload();
|
||||
}
|
||||
|
||||
void ShareManager::handleCellChange(int row,int column)
|
||||
{
|
||||
if(isLoading)
|
||||
return ;
|
||||
|
||||
if(column == COLUMN_VIRTUALNAME)
|
||||
{
|
||||
// check if the thing already exists
|
||||
|
||||
for(uint32_t i=0;i<mDirInfos.size();++i)
|
||||
if(i != (uint32_t)row && (mDirInfos[row].virtualname == std::string(ui.shareddirList->item(i,COLUMN_VIRTUALNAME)->text().toUtf8())))
|
||||
{
|
||||
ui.shareddirList->item(row,COLUMN_VIRTUALNAME)->setText(QString::fromUtf8(mDirInfos[row].virtualname.c_str())) ;
|
||||
return ;
|
||||
}
|
||||
|
||||
mDirInfos[row].virtualname = std::string(ui.shareddirList->item(row,COLUMN_VIRTUALNAME)->text().toUtf8()) ;
|
||||
}
|
||||
}
|
||||
|
||||
void ShareManager::doubleClickedCell(int row,int column)
|
||||
{
|
||||
if(column == COLUMN_PATH)
|
||||
|
@ -58,6 +58,7 @@ private slots:
|
||||
void shareddirListCostumPopupMenu( QPoint point );
|
||||
void addShare();
|
||||
void doubleClickedCell(int,int);
|
||||
void handleCellChange(int row,int column);
|
||||
|
||||
void showShareDialog();
|
||||
//void editShareDirectory();
|
||||
|
Loading…
x
Reference in New Issue
Block a user