From 37eec9da0bcdc79c47e168416981d37e2265e5b0e1e812b8a4818b077b1823c8 Mon Sep 17 00:00:00 2001 From: Raymond Wooninck Date: Fri, 23 Oct 2015 18:46:46 +0000 Subject: [PATCH] Accepting request 340631 from home:alarrosa:branches:KDE:Frameworks5 - Fix the command line parsing, which was crashing when calling kinfocenter --version OBS-URL: https://build.opensuse.org/request/show/340631 OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kinfocenter5?expand=0&rev=67 --- kinfocenter-fix-cmdline-parsing.patch | 58 +++++++++++++++++++++++++++ kinfocenter5.changes | 6 +++ kinfocenter5.spec | 3 ++ 3 files changed, 67 insertions(+) create mode 100644 kinfocenter-fix-cmdline-parsing.patch diff --git a/kinfocenter-fix-cmdline-parsing.patch b/kinfocenter-fix-cmdline-parsing.patch new file mode 100644 index 0000000..d20d938 --- /dev/null +++ b/kinfocenter-fix-cmdline-parsing.patch @@ -0,0 +1,58 @@ +From: Antonio Larrosa +Date: Fri, 23 Oct 2015 12:57:44 +0000 +Subject: Fix kinfocenter crash when run with --version +X-Git-Url: http://quickgit.kde.org/?p=kinfocenter.git&a=commitdiff&h=fe16e35904587266f37114ac682916e449677054 +--- +Fix kinfocenter crash when run with --version + +Fix the order in which kinfocenter is initialized to first do all +commandline parsing and only then create windows. In other case +running "kinfocenter --version" crashes when unloading dynamic libraries +that shouldn't have been loaded at all. +--- + + +--- a/main.cpp ++++ b/main.cpp +@@ -37,14 +37,7 @@ + { + QApplication::setApplicationDisplayName(i18n("KDE Info Center")); + QApplication::setOrganizationDomain("kde.org"); +- display = new KInfoCenter(); +- display->show(); + +- KDBusService* service = new KDBusService(KDBusService::Unique, this); +-} +- +-int main(int argc, char *argv[]) +-{ + KLocalizedString::setApplicationDomain("kinfocenter"); + + KAboutData aboutData( QStringLiteral("kinfocenter"), i18n("KDE Info Center"), +@@ -60,14 +53,23 @@ + aboutData.addAuthor(i18n("Waldo Bastian"), QString(), QStringLiteral("bastian@kde.org")); + aboutData.addAuthor(i18n("Nicolas Ternisien"), QString(), QStringLiteral("nicolas.ternisien@gmail.com")); + KAboutData::setApplicationData(aboutData); +- KicApp Kic(argc, argv); + + QCommandLineParser parser; + parser.addHelpOption(); + parser.addVersionOption(); + aboutData.setupCommandLine(&parser); +- parser.process(Kic); ++ parser.process(*this); + aboutData.processCommandLine(&parser); ++ ++ display = new KInfoCenter(); ++ display->show(); ++ ++ KDBusService* service = new KDBusService(KDBusService::Unique, this); ++} ++ ++int main(int argc, char *argv[]) ++{ ++ KicApp Kic(argc, argv); + + return Kic.exec(); + } + diff --git a/kinfocenter5.changes b/kinfocenter5.changes index f47400a..6b02fdd 100644 --- a/kinfocenter5.changes +++ b/kinfocenter5.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Oct 23 17:24:15 UTC 2015 - alarrosa@suse.com + +- Fix the command line parsing, which was crashing when + calling kinfocenter --version + ------------------------------------------------------------------- Sun Oct 4 10:43:26 UTC 2015 - hrvoje.senjan@gmail.com diff --git a/kinfocenter5.spec b/kinfocenter5.spec index 74b574f..62fc3b9 100644 --- a/kinfocenter5.spec +++ b/kinfocenter5.spec @@ -28,6 +28,8 @@ Source: kinfocenter-%{version}.tar.xz Source99: %{name}-rpmlintrc # PATCH-FIX-OPENSUSE plasma-session-name.patch Patch0: plasma-session-name.patch +# PATCH-FIX-UPSTREAM kinfocenter-fix-cmdline-parsing.patch -- Fixes crash when run with --version +Patch1: kinfocenter-fix-cmdline-parsing.patch BuildRequires: extra-cmake-modules BuildRequires: kcmutils-devel BuildRequires: kcompletion-devel @@ -71,6 +73,7 @@ KDE Utility that provides information about a computer system. %prep %setup -q -n kinfocenter-%{version} %patch0 -p1 +%patch1 -p1 %build %cmake_kf5 -d build -- -DCMAKE_INSTALL_LOCALEDIR=share/locale/kf5