File indexing completed on 2024-05-12 15:55:38
0001 // SPDX-FileCopyrightText: 2012-2022 Jesper K. Pedersen <blackie@kde.org> 0002 // 0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 0005 #ifndef MAINWINDOW_DUPLICATEMERGER_H 0006 #define MAINWINDOW_DUPLICATEMERGER_H 0007 0008 #include <DB/MD5.h> 0009 #include <kpabase/FileNameList.h> 0010 0011 #include <QDialog> 0012 #include <QMap> 0013 #include <QWidget> 0014 0015 class QVBoxLayout; 0016 class QRadioButton; 0017 class QLabel; 0018 class QPushButton; 0019 0020 namespace MainWindow 0021 { 0022 0023 class DuplicateMatch; 0024 0025 class DuplicateMerger : public QDialog 0026 { 0027 Q_OBJECT 0028 0029 public: 0030 explicit DuplicateMerger(QWidget *parent = nullptr); 0031 ~DuplicateMerger() override; 0032 0033 private Q_SLOTS: 0034 void selectAll(); 0035 void selectNone(); 0036 void go(); 0037 void updateSelectionCount(); 0038 0039 private: 0040 void findDuplicates(); 0041 void addRow(const DB::MD5 &); 0042 void selectAll(bool b); 0043 void tellThatNoDuplicatesWereFound(); 0044 0045 QMap<DB::MD5, DB::FileNameList> m_matches; 0046 0047 QWidget *m_container; 0048 QVBoxLayout *m_scrollLayout; 0049 QList<DuplicateMatch *> m_selectors; 0050 QRadioButton *m_trash; 0051 QRadioButton *m_deleteFromDisk; 0052 QLabel *m_selectionCount; 0053 0054 QPushButton *m_selectAllButton; 0055 QPushButton *m_selectNoneButton; 0056 QPushButton *m_okButton; 0057 QPushButton *m_cancelButton; 0058 }; 0059 0060 } // namespace MainWindow 0061 0062 #endif // MAINWINDOW_DUPLICATEMERGER_H 0063 0064 // vi:expandtab:tabstop=4 shiftwidth=4: