File indexing completed on 2024-12-01 08:18:36

0001 /***************************************************************************
0002  *   Copyright (C) 2023 by Friedrich W. H. Kossebau                        *
0003  *   kossebau@kde.org                                                      *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef FILEFILTER_H
0012 #define FILEFILTER_H
0013 
0014 #include <kio_version.h>
0015 
0016 #include <QString>
0017 #include <QList>
0018 
0019 class QStringList;
0020 
0021 struct FileFilter
0022 {
0023     QString name;
0024     QString patterns;
0025 };
0026 
0027 class FileFilters : public QList<FileFilter>
0028 {
0029 public:
0030     FileFilters() = default;
0031     FileFilters(const FileFilters& other) = default;
0032     FileFilters(std::initializer_list<FileFilter> list) : QList<FileFilter>(list) {}
0033 
0034     FileFilters &operator=(const QList<FileFilter> &other)
0035     { QList<FileFilter>::operator=(other); return *this; }
0036 
0037 public:
0038     QString toQtStyleString() const;
0039 #if KIO_VERSION >= QT_VERSION_CHECK(5, 108, 0)
0040     QStringList toQtStyleStringList() const;
0041 #else
0042     QString toKDEStyleString() const;
0043 #endif
0044 };
0045 
0046 
0047 #endif
0048