mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-06-04 01:28:58 -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,12 +264,20 @@ void ChatRootView::showAttachFilesDialog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dialog.exec() == QDialog::Accepted) {
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
QStringList filePaths = dialog.selectedFiles();
|
QStringList newFilePaths = dialog.selectedFiles();
|
||||||
if (!filePaths.isEmpty()) {
|
if (!newFilePaths.isEmpty()) {
|
||||||
m_attachmentFiles = filePaths;
|
bool filesAdded = false;
|
||||||
|
for (const QString &filePath : newFilePaths) {
|
||||||
|
if (!m_attachmentFiles.contains(filePath)) {
|
||||||
|
m_attachmentFiles.append(filePath);
|
||||||
|
filesAdded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (filesAdded) {
|
||||||
emit attachmentFilesChanged();
|
emit attachmentFilesChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QodeAssist::Chat
|
} // namespace QodeAssist::Chat
|
||||||
|
Loading…
x
Reference in New Issue
Block a user