1 /************************************************************************** 2 ** ** 3 ** Copyright (C) 2018 Lukas Spies ** 4 ** Contact: http://photoqt.org ** 5 ** ** 6 ** This file is part of PhotoQt. ** 7 ** ** 8 ** PhotoQt is free software: you can redistribute it and/or modify ** 9 ** it under the terms of the GNU General Public License as published by ** 10 ** the Free Software Foundation, either version 2 of the License, or ** 11 ** (at your option) any later version. ** 12 ** ** 13 ** PhotoQt is distributed in the hope that it will be useful, ** 14 ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** 15 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** 16 ** GNU General Public License for more details. ** 17 ** ** 18 ** You should have received a copy of the GNU General Public License ** 19 ** along with PhotoQt. If not, see <http://www.gnu.org/licenses/>. ** 20 ** ** 21 **************************************************************************/ 22 23 #ifndef OPENFILE_H 24 #define OPENFILE_H 25 26 #include <QObject> 27 #include <QDir> 28 #include <QFile> 29 #include <QIcon> 30 #include <QXmlStreamWriter> 31 #include <QUrl> 32 #include <thread> 33 #include <QCollator> 34 #include "../../logger.h" 35 #include "../../settings/fileformats.h" 36 #include "../../settings/settings.h" 37 #include <QStorageInfo> 38 39 class GetAndDoStuffOpenFile : public QObject { 40 41 Q_OBJECT 42 43 public: 44 explicit GetAndDoStuffOpenFile(QObject *parent = 0); 45 ~GetAndDoStuffOpenFile(); 46 47 int getNumberFilesInFolder(QString path, int selectionFileTypes); 48 QVariantList getUserPlaces(); 49 QVariantList getStorageInfo(); 50 QVariantList getFoldersIn(QString path, bool getDotDot = true, bool showHidden = false); 51 QVariantList getFilesIn(QString path, QString filter, QString sortby, bool sortbyAscending); 52 QVariantList getFilesWithSizeIn(QString path, int selectionFileTypes, bool showHidden, QString sortby, bool sortbyAscending); 53 void saveUserPlaces(QVariantList enabled); 54 QString getOpenFileLastLocation(); 55 void setOpenFileLastLocation(QString path); 56 void saveLastOpenedImage(QString path); 57 QString getLastOpenedImage(); 58 QString getCurrentWorkingDirectory(); 59 QString getDirectoryDirName(QString path); 60 61 private: 62 FileFormats *formats; 63 64 }; 65 66 67 #endif // OPENFILE_H 68