commit konsole for openSUSE:Factory
Hello community, here is the log from the commit of package konsole for openSUSE:Factory checked in at 2016-11-21 14:23:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/konsole (Old) and /work/SRC/openSUSE:Factory/.konsole.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "konsole" Changes: -------- --- /work/SRC/openSUSE:Factory/konsole/konsole.changes 2016-11-12 13:40:44.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.konsole.new/konsole.changes 2016-11-21 14:23:45.000000000 +0100 @@ -1,0 +2,14 @@ +Sun Nov 20 16:48:50 UTC 2016 - wbauer@tmo.at + +- Add only-use-foreground-process-info-if-valid.patch, should fix + "random" crashes (kde#372401, kde#372620, kde#372619, kde#372593) + +------------------------------------------------------------------- +Fri Nov 18 10:13:32 UTC 2016 - wbauer@tmo.at + +- Add fix-reparsing-of-command-line-arguments.patch to make konsole + properly parse the command line options on start when an instance + is already running, and not just reuse them from the already + running instance (boo#1010890, kde#371863) + +------------------------------------------------------------------- New: ---- fix-reparsing-of-command-line-arguments.patch only-use-foreground-process-info-if-valid.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ konsole.spec ++++++ --- /var/tmp/diff_new_pack.XI4rbN/_old 2016-11-21 14:23:46.000000000 +0100 +++ /var/tmp/diff_new_pack.XI4rbN/_new 2016-11-21 14:23:46.000000000 +0100 @@ -32,6 +32,10 @@ Source24: utilities-terminal-su-48.png Source25: utilities-terminal-su-64.png Source26: utilities-terminal-su-128.png +# PATCH-FIX-UPSTREAM fix-reparsing-of-command-line-arguments.patch boo#1010890, kde#371863 -- makes konsole parse the command line options correctly on start and not reuse them from an already running instance +Patch: fix-reparsing-of-command-line-arguments.patch +# PATCH-FIX-UPSTREAM only-use-foreground-process-info-if-valid.patch kde#372401, kde#372620, kde#372619, kde#372593 -- should fix "random" crashes +Patch1: only-use-foreground-process-info-if-valid.patch BuildRequires: fdupes BuildRequires: kbookmarks-devel BuildRequires: kcompletion-devel @@ -82,6 +86,8 @@ %prep %setup -q +%patch -p1 +%patch1 -p1 %build %cmake_kf5 -d build ++++++ fix-reparsing-of-command-line-arguments.patch ++++++
From 4ec9b565800b9e9bdbf45dbb5983530fb95791e7 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark"
Date: Wed, 19 Oct 2016 00:05:05 +0200 Subject: Fix reparsing of command line arguments
If a new Konsole instance is launched via DBus (e. g. single process
mode), it re-used the QCommandLineParser each time, so each new instance
would inherit all parsed options.
Most noticeably is if you have konsole running, press Shift+F4 in
Dolphin to launch a Konsole instance in the current folder (which leads
Konsole to use a temporary profile), and then try to open a new konsole
instance outside of that, it would open in the folder from Dolphin.
REVIEW: 129217
---
src/Application.cpp | 133 +++++++++++++++++++++++++++++++++++++++-------------
src/Application.h | 6 ++-
src/main.cpp | 83 ++++----------------------------
3 files changed, 113 insertions(+), 109 deletions(-)
diff --git a/src/Application.cpp b/src/Application.cpp
index e903981..5bf04cc 100644
--- a/src/Application.cpp
+++ b/src/Application.cpp
@@ -30,6 +30,7 @@
// KDE
#include <KActionCollection>
+#include <KLocalizedString>
// Konsole
#include "SessionManager.h"
@@ -44,11 +45,75 @@
using namespace Konsole;
-Application::Application(QCommandLineParser &parser) : m_parser(parser)
+Application::Application(QSharedPointer<QCommandLineParser> parser) : m_parser(parser)
{
_backgroundInstance = 0;
}
+void Application::populateCommandLineParser(QCommandLineParser *parser)
+{
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("profile"),
+ i18nc("@info:shell", "Name of profile to use for new Konsole instance"),
+ QStringLiteral("name")));
+ parser->addOption(QCommandLineOption(QStringList(QStringLiteral("fallback-profile")),
+ i18nc("@info:shell", "Use the internal FALLBACK profile")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("workdir"),
+ i18nc("@info:shell", "Set the initial working directory of the new tab or"
+ " window to 'dir'"),
+ QStringLiteral("dir")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("hold") << QStringLiteral("noclose"),
+ i18nc("@info:shell", "Do not close the initial session automatically when it"
+ " ends.")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("new-tab"),
+ i18nc("@info:shell", "Create a new tab in an existing window rather than"
+ " creating a new window")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("tabs-from-file"),
+ i18nc("@info:shell", "Create tabs as specified in given tabs configuration"
+ " file"),
+ QStringLiteral("file")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("background-mode"),
+ i18nc("@info:shell", "Start Konsole in the background and bring to the front"
+ " when Ctrl+Shift+F12 (by default) is pressed")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("separate"), i18n("Run in a separate process")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("show-menubar"), i18nc("@info:shell", "Show the menubar, overriding the default setting")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("hide-menubar"), i18nc("@info:shell", "Hide the menubar, overriding the default setting")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("show-tabbar"), i18nc("@info:shell", "Show the tabbar, overriding the default setting")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("hide-tabbar"), i18nc("@info:shell", "Hide the tabbar, overriding the default setting")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("fullscreen"), i18nc("@info:shell", "Start Konsole in fullscreen mode")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("notransparency"),
+ i18nc("@info:shell", "Disable transparent backgrounds, even if the system"
+ " supports them.")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("list-profiles"),
+ i18nc("@info:shell", "List the available profiles")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("list-profile-properties"),
+ i18nc("@info:shell", "List all the profile properties names and their type"
+ " (for use with -p)")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("p"),
+ i18nc("@info:shell", "Change the value of a profile property."),
+ QStringLiteral("property=value")));
+ parser->addOption(QCommandLineOption(QStringList() << QStringLiteral("e"),
+ i18nc("@info:shell", "Command to execute. This option will catch all following"
+ " arguments, so use it as the last option."),
+ QStringLiteral("cmd")));
+ parser->addPositionalArgument(QStringLiteral("[args]"),
+ i18nc("@info:shell", "Arguments passed to command"));
+
+ // Add a no-op compatibility option to make Konsole compatible with
+ // Debian's policy on X terminal emulators.
+ // -T is technically meant to set a title, that is not really meaningful
+ // for Konsole as we have multiple user-facing options controlling
+ // the title and overriding whatever is set elsewhere.
+ // https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532029
+ // https://www.debian.org/doc/debian-policy/ch-customized-programs.html#s11.8.3
+ auto titleOption = QCommandLineOption(QStringList() << QStringLiteral("T"),
+ QStringLiteral("Debian policy compatibility, not used"),
+ QStringLiteral("value"));
+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
+ titleOption.setHidden(true);
+#endif
+ parser->addOption(titleOption);
+}
+
Application::~Application()
{
SessionManager::instance()->closeAllSessions();
@@ -57,7 +122,7 @@ Application::~Application()
MainWindow* Application::newMainWindow()
{
- WindowSystemInfo::HAVE_TRANSPARENCY = !m_parser.isSet(QStringLiteral("notransparency"));
+ WindowSystemInfo::HAVE_TRANSPARENCY = !m_parser->isSet(QStringLiteral("notransparency"));
MainWindow* window = new MainWindow();
@@ -106,7 +171,7 @@ int Application::newInstance()
// create a new window or use an existing one
MainWindow* window = processWindowArgs(createdNewMainWindow);
- if (m_parser.isSet(QStringLiteral("tabs-from-file"))) {
+ if (m_parser->isSet(QStringLiteral("tabs-from-file"))) {
// create new session(s) as described in file
if (!processTabsFromFileArgs(window)) {
return 0;
@@ -123,13 +188,13 @@ int Application::newInstance()
// create new session
Session* session = window->createSession(newProfile, QString());
- if (m_parser.isSet(QStringLiteral("noclose"))) {
+ if (m_parser->isSet(QStringLiteral("noclose"))) {
session->setAutoClose(false);
}
// if the background-mode argument is supplied, start the background
// session ( or bring to the front if it already exists )
- if (m_parser.isSet(QStringLiteral("background-mode"))) {
+ if (m_parser->isSet(QStringLiteral("background-mode"))) {
startBackgroundMode(window);
} else {
// Qt constrains top-level windows which have not been manually
@@ -176,7 +241,7 @@ profile: Zsh
bool Application::processTabsFromFileArgs(MainWindow* window)
{
// Open tab configuration file
- const QString tabsFileName(m_parser.value(QStringLiteral("tabs-from-file")));
+ const QString tabsFileName(m_parser->value(QStringLiteral("tabs-from-file")));
QFile tabsFile(tabsFileName);
if (!tabsFile.open(QFile::ReadOnly)) {
qWarning() << "ERROR: Cannot open tabs file "
@@ -253,8 +318,8 @@ void Application::createTabFromArgs(MainWindow* window,
shouldUseNewProfile = true;
}
- if (m_parser.isSet(QStringLiteral("workdir"))) {
- newProfile->setProperty(Profile::Directory, m_parser.value(QStringLiteral("workdir")));
+ if (m_parser->isSet(QStringLiteral("workdir"))) {
+ newProfile->setProperty(Profile::Directory, m_parser->value(QStringLiteral("workdir")));
shouldUseNewProfile = true;
}
@@ -267,7 +332,7 @@ void Application::createTabFromArgs(MainWindow* window,
Profile::Ptr theProfile = shouldUseNewProfile ? newProfile : baseProfile;
Session* session = window->createSession(theProfile, QString());
- if (m_parser.isSet(QStringLiteral("noclose"))) {
+ if (m_parser->isSet(QStringLiteral("noclose"))) {
session->setAutoClose(false);
}
@@ -288,7 +353,7 @@ void Application::createTabFromArgs(MainWindow* window,
MainWindow* Application::processWindowArgs(bool &createdNewMainWindow)
{
MainWindow* window = 0;
- if (m_parser.isSet(QStringLiteral("new-tab"))) {
+ if (m_parser->isSet(QStringLiteral("new-tab"))) {
QListIterator
From 40b1f0e851c115e1a2df79e7ec4bc4fe726d9e43 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark"
Date: Sun, 20 Nov 2016 14:36:38 +0100 Subject: Only use foreground process info if valid
getProcessInfo() returned _foregroundProcessInfo without checking the return value of updateForegroundProcessInfo() indicating whether _foregroundProcessInfo was non-existent or invalid. I think this might be the solution to a bunch of recent crash bugs, but not closing them as I can't test. Also skipping RB because it is a simple patch and RB is down from here. CCBUG: 372401 CCBUG: 372620 CCBUG: 372619 CCBUG: 372593 --- src/Session.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Session.cpp b/src/Session.cpp index 3269550..d63c8a0 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -961,8 +961,7 @@ ProcessInfo* Session::getProcessInfo() { ProcessInfo* process = 0; - if (isForegroundProcessActive()) { - updateForegroundProcessInfo(); + if (isForegroundProcessActive() && updateForegroundProcessInfo()) { process = _foregroundProcessInfo; } else { updateSessionProcessInfo(); -- cgit v0.11.2
participants (1)
-
root@hilbert.suse.de