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..d6365ac 100644 --- a/kinfocenter5.changes +++ b/kinfocenter5.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Oct 23 17:24:15 UTC 2015 - alarrosa@suse.com + +- Fix the command line parsing, which was crashing when + calling kinfocenter --version + * kinfocenter-fix-cmdline-parsing.patch + ------------------------------------------------------------------- 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