SHA256
1
0
forked from pool/kded

Accepting request 340634 from home:alarrosa:branches:KDE:Frameworks5

- Removes a Qt warning related to session management, add
  --version and --help command line options and make kded parse 
  the commandline correctly.

OBS-URL: https://build.opensuse.org/request/show/340634
OBS-URL: https://build.opensuse.org/package/show/KDE:Frameworks5/kded?expand=0&rev=66
This commit is contained in:
Raymond Wooninck 2015-10-23 18:48:05 +00:00 committed by Git OBS Bridge
parent fa040d88e2
commit 7055fa468f
3 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,59 @@
diff --git a/src/kded.cpp b/src/kded.cpp
index 6929d7d3f24d3556f1b227d5a9bfb5b02b1c295e..082d3863dcf484a6d609e2c639c49788d9576007 100644
--- a/src/kded.cpp
+++ b/src/kded.cpp
@@ -30,6 +30,7 @@
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QTimer>
+#include <QtCore/QCommandLineParser>
#include <QApplication>
#include <QDBusConnection>
@@ -672,6 +673,7 @@ static void setupAppInfo(QCoreApplication *app)
{
app->setApplicationName("kded5");
app->setOrganizationDomain("kde.org");
+ app->setApplicationVersion(KDED_VERSION_STRING);
}
extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[])
@@ -679,24 +681,27 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char *argv[])
//options.add("check", qi18n("Check Sycoca database only once"));
// WABA: Make sure not to enable session management.
- putenv(qstrdup("SESSION_MANAGER="));
+ qunsetenv("SESSION_MANAGER");
+
+ QApplication app(argc, argv);
+ app.setApplicationDisplayName("KDE Daemon");
+ setupAppInfo(&app);
+ app.setQuitOnLastWindowClosed(false);
+
+ QCommandLineParser parser;
+ parser.addHelpOption();
+ parser.addVersionOption();
+ parser.addOption(QCommandLineOption(QStringLiteral("check"), QStringLiteral("Check cache validity")));
+ parser.process(app);
// Parse command line before checking D-Bus
- if (argc > 1 && QByteArray(argv[1]) == "--check") {
+ if (parser.isSet(QStringLiteral("check"))) {
// KDBusService not wanted here.
- QCoreApplication app(argc, argv);
- setupAppInfo(&app);
-
KSycoca::self()->ensureCacheValid();
runKonfUpdate();
return 0;
}
- QApplication app(argc, argv);
- setupAppInfo(&app);
- app.setApplicationDisplayName("KDE Daemon");
- app.setQuitOnLastWindowClosed(false);
-
KDBusService service(KDBusService::Unique);
KSharedConfig::Ptr config = KSharedConfig::openConfig();

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Fri Oct 23 17:50:20 UTC 2015 - alarrosa@suse.com
- Removes a Qt warning related to session management, add
--version and --help command line options and make kded parse
the commandline correctly.
-------------------------------------------------------------------
Mon Oct 5 17:37:09 UTC 2015 - hrvoje.senjan@gmail.com

View File

@ -48,6 +48,8 @@ License: LGPL-2.1+
Group: System/GUI/KDE
Url: http://www.kde.org
Source: http://download.kde.org/stable/frameworks/%{_tar_path}/%{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE kded-fix-cmdline-parsing.patch alarrosa@suse.com -- Removes a warning and fixes command line parsing
Patch0: kded-fix-cmdline-parsing.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -68,6 +70,7 @@ Development files.
%lang_package
%prep
%setup -q
%patch0 -p1
%build
%cmake_kf5 -d build