Skip to content

Commit

Permalink
Merge branch 'pointinsertion' into 'master'
Browse files Browse the repository at this point in the history
Launcher: Fix Insert Above behavior when the directory is added automatically

See merge request OpenMW/openmw!4345
  • Loading branch information
psi29a committed Aug 30, 2024
2 parents 0cb2b71 + f393c40 commit 88cda16
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions apps/launcher/datafilespage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,9 +714,8 @@ void Launcher::DataFilesPage::addSubdirectories(bool append)
// Automatically add the directory selected by user
if (!ui.directoryListWidget->findItems(rootPath, Qt::MatchFixedString).isEmpty())
return;
ui.directoryListWidget->addItem(rootPath);
auto row = ui.directoryListWidget->count() - 1;
auto* item = ui.directoryListWidget->item(row);
ui.directoryListWidget->insertItem(selectedRow, rootPath);
auto* item = ui.directoryListWidget->item(selectedRow);
item->setData(Qt::UserRole, QVariant::fromValue(Config::SettingValue{ rootPath }));
mNewDataDirs.push_back(rootPath);
refreshDataFilesView();
Expand Down

0 comments on commit 88cda16

Please sign in to comment.