aboutsummaryrefslogtreecommitdiff
path: root/src-qt5
diff options
context:
space:
mode:
authorZackaryWelch <welch.zackary@gmail.com>2017-10-21 19:30:58 -0400
committerZackaryWelch <welch.zackary@gmail.com>2017-10-21 19:30:58 -0400
commit02a68b94cd343d1958438dbfccd7258ee76f7eef (patch)
treeae27dfd7f44a1d23177b33305fad2fae18548143 /src-qt5
parentAdded some testing code for issues with directories having >10 videos (diff)
downloadlumina-02a68b94cd343d1958438dbfccd7258ee76f7eef.tar.gz
lumina-02a68b94cd343d1958438dbfccd7258ee76f7eef.tar.bz2
lumina-02a68b94cd343d1958438dbfccd7258ee76f7eef.zip
Added preliminary code to disable video thumbnails with settings
Diffstat (limited to 'src-qt5')
-rw-r--r--src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
index a7b07b47..dc00e92f 100644
--- a/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
+++ b/src-qt5/desktop-utils/lumina-fm/BrowserWidget.cpp
@@ -334,15 +334,22 @@ void BrowserWidget::itemDataAvailable(QIcon ico, LFileInfo *info){
treeWidget->addTopLevelItem(it);
}
}else{
+ if(!BROWSER->showingThumbnails() && videoMap.size() !=0) {
+ for(QString file : videoMap.keys()) {
+ QTreeWidgetItem *it = videoMap[file];
+ treeWidget->removeItemWidget(it, 0);
+ }
+ videoMap.clear();
+ }
if( ! treeWidget->findItems(info->fileName(), Qt::MatchExactly, 0).isEmpty() ) {
it = treeWidget->findItems(info->fileName(), Qt::MatchExactly, 0).first();
- }else if(info->isVideo() && videoMap.find(info->absoluteFilePath()) == videoMap.end()){
+ }else if(info->isVideo() && videoMap.find(info->absoluteFilePath()) == videoMap.end() && BROWSER->showingThumbnails()){
it = new CQTreeWidgetItem(treeWidget);
treeWidget->addTopLevelItem(it);
LVideoWidget *widget = new LVideoWidget(info->absoluteFilePath(), treeWidget->iconSize(), treeWidget);
videoMap.insert(info->absoluteFilePath(), it);
treeWidget->setItemWidget(it, 0, widget);
- }else if(info->isVideo()){
+ }else if(info->isVideo() && BROWSER->showingThumbnails()){
it = videoMap[info->absoluteFilePath()];
if(treeWidget->itemWidget(it, 0) != 0) {
LVideoWidget *widget = (LVideoWidget*)treeWidget->itemWidget(it, 0);
@@ -356,7 +363,7 @@ void BrowserWidget::itemDataAvailable(QIcon ico, LFileInfo *info){
}
}
//Now set/update all the data
- if(!info->isVideo())
+ if(!info->isVideo() || (info->isVideo() && !BROWSER->showingThumbnails()))
it->setIcon(0, ico);
it->setText(1, info->isDir() ? "" : LUtils::BytesToDisplaySize(info->size()) ); //size (1)
it->setText(2, info->mimetype() ); //type (2)
bgstack15