SHA256
1
0
forked from pool/krusader
Dominique Leuenberger 2019-03-13 08:14:01 +00:00 committed by Git OBS Bridge
commit c17846e99c
3 changed files with 62 additions and 2 deletions

View File

@ -0,0 +1,51 @@
From 796b33f0e6c8b8545f7eb3bba8f6eb6f373e41c8 Mon Sep 17 00:00:00 2001
From: "Friedrich W. H. Kossebau" <kossebau@kde.org>
Date: Sat, 9 Feb 2019 18:36:30 +0100
Subject: Prefer to find oktetapart by desktop file, not binary name
Summary:
Okteta >= 0.26 installs the oktetapart binary in the kf5/parts subdir
of the plugins, so the old check will not find it.
But that version also installs a desktop file again, so prefer to use that.
Test Plan:
Okteta KParts plugin is found also with devel version of what will be 0.26
in some weeks.
Reviewers: #krusader, nmel
Reviewed By: #krusader, nmel
Subscribers: nmel, yurchor
Differential Revision: https://phabricator.kde.org/D18881
---
krusader/KViewer/panelviewer.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/krusader/KViewer/panelviewer.cpp b/krusader/KViewer/panelviewer.cpp
index c6c6df1..80e69d8 100644
--- a/krusader/KViewer/panelviewer.cpp
+++ b/krusader/KViewer/panelviewer.cpp
@@ -146,8 +146,16 @@ KParts::ReadOnlyPart* PanelViewer::getHexPart()
if (KConfigGroup(krConfig, "General").readEntry("UseOktetaViewer", _UseOktetaViewer)) {
if (mimes->find("oktetapart") == mimes->end()) {
- KPluginLoader loader("oktetapart");
- if (KPluginFactory *factory = loader.factory()) {
+ KPluginFactory* factory = nullptr;
+ // Okteta >= 0.26 provides a desktop file, prefer that as the binary changes name
+ KService::Ptr service = KService::serviceByDesktopName("oktetapart");
+ if (service) {
+ factory = KPluginLoader(*service.data()).factory();
+ } else {
+ // fallback to search for desktopfile-less old variant
+ factory = KPluginLoader("oktetapart").factory();
+ }
+ if (factory) {
if ((part = factory->create<KParts::ReadOnlyPart>(this, this)))
mimes->insert("oktetapart", part);
}
--
cgit v1.1

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Mar 12 06:41:59 UTC 2019 - wbauer@tmo.at
- Add Prefer-to-find-oktetapart-by-desktop-file.patch to make it
compatible with the upcoming okteta 0.26 release
-------------------------------------------------------------------
Sun Aug 12 17:08:29 UTC 2018 - wbauer@tmo.at
@ -585,7 +591,7 @@ Sat May 2 20:32:29 CEST 2009 - dmueller@suse.de
- review/merge to openSUSE Factory
-------------------------------------------------------------------
Sat Apr 18 12:16:01 CET 2009 - bitshuffler #suse@irc.freenode.org
Sat Apr 18 12:16:01 CEST 2009 - bitshuffler #suse@irc.freenode.org
- Updated to 2.0.0

View File

@ -20,12 +20,14 @@ Name: krusader
Version: 2.7.1
Release: 0
Summary: A File Manager
License: GPL-2.0+
License: GPL-2.0-or-later
Group: Productivity/File utilities
Url: https://krusader.org/
Source: http://download.kde.org/stable/krusader/%{version}/%{name}-%{version}.tar.xz
Source1: krusader_browse_iso.desktop
Source2: org.kde.krusader.root-mode.desktop
# PATCH-FIX-UPSTREAM
Patch0: Prefer-to-find-oktetapart-by-desktop-file.patch
BuildRequires: extra-cmake-modules >= 1.7.0
BuildRequires: fdupes
BuildRequires: libacl-devel
@ -84,6 +86,7 @@ An advanced twin panel (commander style) file manager for KDE.
%prep
%setup -q -n %{name}-%{version}
%autopatch -p1
%build
export RPM_OPT_FLAGS="%{optflags} -fpermissive"