OSDN Git Service

Changed creation of QFileSystemModel. Object will now be created when the user first...
[lamexp/LameXP.git] / src / Model_FileSystem.h
index 4e548cc..df15e16 100644 (file)
@@ -1,6 +1,6 @@
 ///////////////////////////////////////////////////////////////////////////////
 // LameXP - Audio Encoder Front-End
-// Copyright (C) 2004-2010 LoRd_MuldeR <MuldeR2@GMX.de>
+// Copyright (C) 2004-2012 LoRd_MuldeR <MuldeR2@GMX.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
 #pragma once
 
 #include <QFileSystemModel>
+#include <QMutex>
+
+class QFileIconProviderEx;
 
 class QFileSystemModelEx : public QFileSystemModel
 {
 public:
        QFileSystemModelEx();
+       ~QFileSystemModelEx();
+
        virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const;
+       //virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
+       virtual void fetchMore(const QModelIndex &parent);
+       virtual QModelIndex index(const QString &path, int column = 0) const;
+       virtual void flushCache(void);
+
+private:
+       QFileIconProviderEx *m_myIconProvider;
+       
+       static QHash<const QString, bool> s_hasSubfolderCache;
+       static QMutex s_hasSubfolderMutex;
+
+       static void *FindFirstFileExPtr;
+       static bool FindFirstFileExInitialized;
+       static bool FindFirstFileExInfoBasicOK;
+
+       static bool hasSubfolders(const QString &path);
+       static bool hasSubfoldersCached(const QString &path);
+       static void removeFromCache(const QString &path);
+       static void removeAllFromCache(void);
 };