summaryrefslogtreecommitdiff
path: root/kde-plasma/kdeplasma-addons/files/kdeplasma-addons-5.24.4-fix-comic-widget-dataengine.patch
blob: 4cb01a05ba8490585b58f2eac414fb6f4d5adedd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
https://invent.kde.org/plasma/kdeplasma-addons/-/commit/27710b95a3fd53019b4b053cbdf720354fd939d2
https://bugs.kde.org/show_bug.cgi?id=452596
https://bugs.gentoo.org/840755

From: Alexander Lohnau <alexander.lohnau@gmx.de>
Date: Sun, 17 Apr 2022 06:26:35 +0200
Subject: [PATCH] Remove unneeded check for comic Dataengine being valid

BUG: 452596

We do not really care, if the metadata of the plugin is valid, as long as we can
properly create the dataengine from it.

Test Plan:
With plasma-frameworks master, and this on Plasma/5.24 based revision, the dataengine can properly be loaded.

When intenitionally exporting a defunct plugin:
```cpp
class Dummy : public QObject
{
    Q_OBJECT

public:
    Dummy(QObject *parent, const QVariantList &args) {
    }
};
K_PLUGIN_CLASS_WITH_JSON(Dummy, "plasma-dataengine-comic.json")
```
The applet does not crash.
--- a/applets/comic/comic.cpp
+++ b/applets/comic/comic.cpp
@@ -465,7 +465,7 @@ void ComicApplet::updateComic(const QString &identifierSuffix)
     const QString id = mCurrent.id();
     setConfigurationRequired(id.isEmpty());
 
-    if (!id.isEmpty() && mEngine && mEngine->isValid()) {
+    if (!id.isEmpty() && mEngine) {
         setBusy(true);
 
         const QString identifier = id + QLatin1Char(':') + identifierSuffix;
@@ -485,7 +485,7 @@ void ComicApplet::updateComic(const QString &identifierSuffix)
         slotScaleToContent();
     } else {
         qWarning() << "Either no identifier was specified or the engine could not be created:"
-                   << "id" << id << "engine valid:" << (mEngine && mEngine->isValid());
+                   << "id" << id << "engine valid:" << mEngine;
         setConfigurationRequired(true);
     }
     updateContextMenu();
--- a/applets/comic/comicarchivejob.cpp
+++ b/applets/comic/comicarchivejob.cpp
@@ -80,7 +80,7 @@ bool ComicArchiveJob::isValid() const
         break;
     }
 
-    return mEngine->isValid() && mZip && mZip->isOpen();
+    return mZip && mZip->isOpen();
 }
 
 void ComicArchiveJob::setToIdentifier(const QString &toIdentifier)
GitLab