mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-05-28 03:10:28 -04:00
fix: Improve file attachment handling
- Add files to existing list instead of replacing when using attach dialog - Prevent duplicate files from being added to attachment list
This commit is contained in:
parent
1b86b60de8
commit
2814dec3e5
@ -264,10 +264,18 @@ void ChatRootView::showAttachFilesDialog()
|
||||
}
|
||||
|
||||
if (dialog.exec() == QDialog::Accepted) {
|
||||
QStringList filePaths = dialog.selectedFiles();
|
||||
if (!filePaths.isEmpty()) {
|
||||
m_attachmentFiles = filePaths;
|
||||
emit attachmentFilesChanged();
|
||||
QStringList newFilePaths = dialog.selectedFiles();
|
||||
if (!newFilePaths.isEmpty()) {
|
||||
bool filesAdded = false;
|
||||
for (const QString &filePath : newFilePaths) {
|
||||
if (!m_attachmentFiles.contains(filePath)) {
|
||||
m_attachmentFiles.append(filePath);
|
||||
filesAdded = true;
|
||||
}
|
||||
}
|
||||
if (filesAdded) {
|
||||
emit attachmentFilesChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user