[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [tellico] src/models: Don't try to load an image until the model knows that images are available
From:       Robby Stephenson <null () kde ! org>
Date:       2017-08-01 0:49:16
Message-ID: E1dcLN6-0001gt-Hq () code ! kde ! org
[Download RAW message or body]

Git commit 54a4060e0ed676d79173f33c0c095d011b759153 by Robby Stephenson.
Committed on 30/07/2017 at 19:10.
Pushed by rstephenson into branch 'master'.

Don't try to load an image until the model knows that images are available

This likely doesn't fix the true cause of BUG 382572 but does keep the
code internally consistent, with the rest of EntryMode::data()

CCBUG: 382572

M  +2    -2    src/models/entrymodel.cpp

https://commits.kde.org/tellico/54a4060e0ed676d79173f33c0c095d011b759153

diff --git a/src/models/entrymodel.cpp b/src/models/entrymodel.cpp
index 84394c79..3d650812 100644
--- a/src/models/entrymodel.cpp
+++ b/src/models/entrymodel.cpp
@@ -133,8 +133,8 @@ QVariant EntryModel::data(const QModelIndex& index_, int role_) const {
       // image field is first in the collection
       if(index_.column() == 0 || field->name() == QLatin1String("title")) {
         // return entry image in this case
-        QString fieldName = imageField(entry->collection());
-        if(fieldName.isEmpty()) {
+        const QString fieldName = imageField(entry->collection());
+        if(fieldName.isEmpty() || !m_imagesAreAvailable) {
           return defaultIcon(entry->collection());
         }
         const QString id = entry->field(fieldName);

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic