summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2018-10-09 11:12:47 +0200
committerAleix Pol <[email protected]>2018-10-09 11:14:28 +0200
commitbc3e18cb698f2f800837826da36ad4a29c8afca3 (patch)
treef56ad55dfa595dc094bce7e080fa89b1ac256a17
parent03015aa42a1216086a42ade7c974f12eaa7a356a (diff)
Show a big error message in case there are no backends installed
Instead of a sad empty gray page. BUG: 394050
-rw-r--r--discover/DiscoverObject.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/discover/DiscoverObject.cpp b/discover/DiscoverObject.cpp
index 0e96155..ed872a5 100644
--- a/discover/DiscoverObject.cpp
+++ b/discover/DiscoverObject.cpp
@@ -135,6 +135,18 @@ DiscoverObject::DiscoverObject(CompactMode mode)
for(auto o: objs)
delete o;
});
+ auto action = new OneTimeAction(
+ [this]() {
+ if (ResourcesModel::global()->backends().isEmpty())
+ Q_EMIT openErrorPage(i18n("No Discover back-ends found, please report to your distribution."));
+ }
+ , this);
+
+ if (ResourcesModel::global()->backends().isEmpty()) {
+ connect(ResourcesModel::global(), &ResourcesModel::allInitialized, action, &OneTimeAction::trigger);
+ } else {
+ action->trigger();
+ }
}
DiscoverObject::~DiscoverObject()