Skip to content

Commit

Permalink
Avoid trailing line breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
akortunov committed Nov 20, 2024
1 parent f0543c5 commit bd59247
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apps/launcher/datafilespage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,17 @@ void Launcher::DataFilesPage::buildView()
void Launcher::DataFilesPage::slotCopySelectedItemsPaths()
{
QClipboard* clipboard = QApplication::clipboard();
QString filepaths;
QStringList filepaths;

for (QListWidgetItem* item : ui.directoryListWidget->selectedItems())
{
QString path = qvariant_cast<Config::SettingValue>(item->data(Qt::UserRole)).originalRepresentation;
filepaths += path + "\n";
filepaths.push_back(path);
}

if (!filepaths.isEmpty())
{
clipboard->setText(filepaths);
clipboard->setText(filepaths.join("\n"));
}
}

Expand Down
6 changes: 3 additions & 3 deletions components/contentselector/view/contentselector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,17 +320,17 @@ void ContentSelectorView::ContentSelector::slotCheckMultiSelectedItems()
void ContentSelectorView::ContentSelector::slotCopySelectedItemsPaths()
{
QClipboard* clipboard = QApplication::clipboard();
QString filepaths;
QStringList filepaths;
for (const QModelIndex& index : ui->addonView->selectionModel()->selectedIndexes())
{
int row = mAddonProxyModel->mapToSource(index).row();
const ContentSelectorModel::EsmFile* file = mContentModel->item(row);
filepaths += file->filePath() + "\n";
filepaths.push_back(file->filePath());
}

if (!filepaths.isEmpty())
{
clipboard->setText(filepaths);
clipboard->setText(filepaths.join("\n"));
}
}

Expand Down

0 comments on commit bd59247

Please sign in to comment.