| 696 | } |
| 697 | |
| 698 | void ChatRootView::addFilesToLinkList(const QStringList &filePaths) |
| 699 | { |
| 700 | if (filePaths.isEmpty()) { |
| 701 | return; |
| 702 | } |
| 703 | |
| 704 | bool filesAdded = false; |
| 705 | QStringList imageFiles; |
| 706 | |
| 707 | for (const QString &filePath : filePaths) { |
| 708 | if (isImageFile(filePath)) { |
| 709 | imageFiles.append(filePath); |
| 710 | continue; |
| 711 | } |
| 712 | |
| 713 | if (!m_linkedFiles.contains(filePath)) { |
| 714 | m_linkedFiles.append(filePath); |
| 715 | filesAdded = true; |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | if (!imageFiles.isEmpty()) { |
| 720 | addFilesToAttachList(imageFiles); |
| 721 | m_lastInfoMessage |
| 722 | = tr("Images automatically moved to Attach zone (%n file(s))", "", imageFiles.size()); |
| 723 | emit lastInfoMessageChanged(); |
| 724 | } |
| 725 | |
| 726 | if (filesAdded) { |
| 727 | emit linkedFilesChanged(); |
| 728 | } |
| 729 | } |
| 730 | |
| 731 | void ChatRootView::removeFileFromLinkList(int index) |
| 732 | { |