diff options
author | Ken Moore <moorekou@gmail.com> | 2015-08-25 15:43:53 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-08-25 15:43:53 -0400 |
commit | 88507c36076b100e26a8e2c85533d667675f9daa (patch) | |
tree | 53fc42d5b8b83924e19aa5d6618dae446ba698a4 /lumina-fm/DirData.h | |
parent | Disable the "size" output of a directory in lumina-fm: this needs some better... (diff) | |
download | lumina-88507c36076b100e26a8e2c85533d667675f9daa.tar.gz lumina-88507c36076b100e26a8e2c85533d667675f9daa.tar.bz2 lumina-88507c36076b100e26a8e2c85533d667675f9daa.zip |
Commit a major overhaul of lumina-fm: PLEASE TEST!!
1) Seemlessly embed the ZFS rollback options into the main dir browser (simple time slider at the top).
2) Take all the main widgets and put them into separate classes/files (widgets/*)
3) Add support for both tabs and columns for multiple directory viewing
4) Remove the "icon" view mode, and replace it with an icon sizing option (larger/smaller)
5) Add the ability for the multimedia player and slideshow viewer to be running within separate tabs while still browsing the system (new files will be added to the queue instead of replacing it)
6) Ensure that only selected files are added to the player/slideshow on demand.
7) Add the ability to zoom in/out on a slideshow image.
KNOWN ISSUES:
1) The new file/dir functionality has not been replaced/re-implemented yet.
2) The drag and drop functionality has been removed until a new implementation is put in.
PLEASE TEST:
ZFS snapshot use, multimedia file player, browsing and other UI changes
Diffstat (limited to 'lumina-fm/DirData.h')
-rw-r--r-- | lumina-fm/DirData.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lumina-fm/DirData.h b/lumina-fm/DirData.h index cbfa1855..bd2657e1 100644 --- a/lumina-fm/DirData.h +++ b/lumina-fm/DirData.h @@ -20,6 +20,8 @@ #define ZSNAPDIR QString("/.zfs/snapshot/") +#define DEBUG 0 + //Need some extra information not usually available by a QFileInfo class LFileInfo : public QFileInfo{ private: @@ -71,7 +73,8 @@ public: //Functions for accessing the extra information // -- Return the mimetype for the file QString mimetype(){ - return mime; + if(mime=="inode/directory"){ return ""; } + else{ return mime; } } // -- Return the icon to use for this file @@ -80,7 +83,9 @@ public: return icon; }else{ if(!mime.isEmpty()){ - return mime.replace("/","-"); + QString tmp = mime; + tmp.replace("/","-"); + return tmp; }else if(this->isExecutable()){ return "application-x-executable"; } @@ -109,6 +114,7 @@ public: return (mime.startsWith("audio/") || mime.startsWith("video/") ); } }; +typedef QList<LFileInfo> LFileInfoList; class LDirInfoList{ public: @@ -187,7 +193,7 @@ private: QHash<QString, LDirInfoList> HASH; //Where we cache any info for rapid access later signals: - void DirDataAvailable(QString, QString, QList<LFileInfo>); //[ID, Dirpath, DATA] + void DirDataAvailable(QString, QString, LFileInfoList); //[ID, Dirpath, DATA] void SnapshotDataAvailable(QString, QString, QStringList); //[ID, BaseSnapDir, SnapNames] public: @@ -204,6 +210,7 @@ public: public slots: void GetDirData(QString ID, QString dirpath){ + if(DEBUG){ qDebug() << "GetDirData:" << ID << dirpath; } //The ID is used when returning the info in a moment //Make sure to use the canonical path in the HASH search - don't use QString canon = QFileInfo(dirpath).canonicalFilePath(); @@ -218,10 +225,12 @@ public slots: HASH[canon].update(showHidden); } } + if(DEBUG){ qDebug() << " -- Dir Data Found:" << ID << dirpath << HASH.value(canon).list.length(); } emit DirDataAvailable(ID, dirpath, HASH.value(canon).list); } void GetSnapshotData(QString ID, QString dirpath){ + if(DEBUG){ qDebug() << "GetSnapshotData:" << ID << dirpath; } QString base; QStringList snaps; //Only check if ZFS is flagged as available if(zfsavailable){ @@ -239,11 +248,12 @@ public slots: //Good snapshot directory found - read off the current snapshots (can change regularly - don't cache this) base = HASH.value(dirpath).snapdir; QDir dir(base); - snaps = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time); + snaps = dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time |QDir::Reversed ); //NOTE: snaps are sorted oldest -> newest } } + if(DEBUG){ qDebug() << " -- Snap Data Found:" << ID << base << snaps; } emit SnapshotDataAvailable(ID, base, snaps); } |