00001 /*************************************************************************** 00002 * Copyright (C) 2006-2010 by Ilya Kotov * 00003 * forkotov02@hotmail.ru * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #ifndef FILELOADER_H 00021 #define FILELOADER_H 00022 00023 #include <QObject> 00024 #include <QDir> 00025 #include <QThread> 00026 00027 class PlayListItem; 00028 00038 class FileLoader : public QThread 00039 { 00040 Q_OBJECT 00041 public: 00046 FileLoader(QObject *parent = 0); 00050 ~FileLoader(); 00054 void finish(); 00058 void setFilesToLoad(const QStringList&); 00062 void setDirectoryToLoad(const QString&); 00063 signals: 00068 void newPlayListItem(PlayListItem *item); 00069 00070 protected: 00071 virtual void run(); 00072 void addFiles(const QStringList &files); 00073 void addDirectory(const QString& s); 00074 00075 private: 00076 QStringList m_filters; 00077 QStringList m_files_to_load; 00078 QString m_directory; 00079 bool m_finished; 00080 }; 00081 00082 #endif
1.5.9