passwordsortproxymodel.h (1513B)
1 /* 2 * Copyright (C) 2018 Daniel Vrátil <dvratil@kde.org> 3 * 2021 Willy Goiffon <contact@z3bra.org> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU Library General Public License as 7 * published by the Free Software Foundation; either version 2, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details 14 * 15 * You should have received a copy of the GNU Library General Public 16 * License along with this program; if not, write to the 17 * Free Software Foundation, Inc., 18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef PASSWORDSORTPROXYMODEL_H_ 22 #define PASSWORDSORTPROXYMODEL_H_ 23 24 #include <QSortFilterProxyModel> 25 26 class PasswordSortProxyModel : public QSortFilterProxyModel 27 { 28 Q_OBJECT 29 public: 30 explicit PasswordSortProxyModel(QObject *parent = nullptr); 31 32 Q_INVOKABLE void setPassphrase(const QString &passphrase); 33 Q_INVOKABLE void forgetPassphrase(); 34 Q_INVOKABLE void addPassword(const QModelIndex &parent, const QString &name, 35 const QString &password, const QString &extra); 36 37 protected: 38 bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; 39 }; 40 41 #endif