Skip to content

Commit

Permalink
Merge branch 'fix_spreadsheet_crashes' into 'master'
Browse files Browse the repository at this point in the history
Fix spreadsheet crashes

See merge request mer-core/calligra!3
  • Loading branch information
pvuorela committed Mar 25, 2019
2 parents 1a1181a + 3a2c5eb commit e12681c
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 38 deletions.
32 changes: 1 addition & 31 deletions rpm/calligra-sheets.patch
Expand Up @@ -4,7 +4,6 @@ Date: Tue, 11 Dec 2018 13:25:21 +0100
Subject: [PATCH 07/11] Disable various dependencies in sheets.

---
sheets/CalculationSettings.cpp | 6 ++--
sheets/commands/AbstractRegionCommand.cpp | 14 ++++-----
sheets/commands/SpellCheckCommand.cpp | 26 ++++++++--------
sheets/commands/SpellCheckCommand.h | 2 +-
Expand All @@ -13,37 +12,8 @@ Subject: [PATCH 07/11] Disable various dependencies in sheets.
sheets/part/dialogs/PreferenceDialog.cpp | 36 +++++++++++++----------
sheets/ui/CellToolBase.cpp | 12 ++++----
sheets/ui/HyperlinkStrategy.cpp | 4 +++
9 files changed, 66 insertions(+), 58 deletions(-)
8 files changed, 63 insertions(+), 55 deletions(-)

diff --git a/sheets/CalculationSettings.cpp b/sheets/CalculationSettings.cpp
index 1717c37372a..c6d685ff133 100644
--- a/sheets/CalculationSettings.cpp
+++ b/sheets/CalculationSettings.cpp
@@ -64,7 +64,7 @@ public:
CalculationSettings::CalculationSettings()
: d(new Private)
{
- d->locale = new Localization();
+ // d->locale = new Localization();
d->caseSensitiveComparisons = true;
d->precisionAsShown = false;
d->wholeCellSearchCriteria = true;
@@ -79,13 +79,13 @@ CalculationSettings::CalculationSettings()

CalculationSettings::~CalculationSettings()
{
- delete d->locale;
+ // delete d->locale;
delete d;
}

KLocale* CalculationSettings::locale() const
{
- return d->locale;
+ return 0; // d->locale;
}

void CalculationSettings::setReferenceYear(int year)
diff --git a/sheets/commands/AbstractRegionCommand.cpp b/sheets/commands/AbstractRegionCommand.cpp
index 7d0872af390..808aff118c8 100644
--- a/sheets/commands/AbstractRegionCommand.cpp
Expand Down
12 changes: 8 additions & 4 deletions rpm/calligra.spec
Expand Up @@ -20,8 +20,10 @@ Patch1: kconfigwidgets-no-kauth.patch
Patch2: kservices-no-krash.patch
Patch3: kio-no-solid.patch
Patch4: kxmlgui-no-textwidgets.patch
Patch5: calligra-fake-kde4libs.patch
Patch6: calligra-stage.patch
Patch5: kxmlgui-disable_startup_functions.patch
Patch6: k18n-disable-q_coreapp_startup_function.patch
Patch7: calligra-fake-kde4libs.patch
Patch8: calligra-stage.patch
# to be arrange for later upstream
Patch10: calligra-find.patch
Patch11: calligra-buildsystem.patch
Expand Down Expand Up @@ -171,8 +173,10 @@ BuildRequires: extra-cmake-modules >= 5.34.0
%patch2 -d kservice -p1
%patch3 -d kio -p1
%patch4 -d kxmlgui -p1
%patch5 -d upstream -p1
%patch6 -d upstream -p1
%patch5 -d kxmlgui -p1
%patch6 -d ki18n -p1
%patch7 -d upstream -p1
%patch8 -d upstream -p1
%patch10 -d upstream -p1
%patch11 -d upstream -p1
%patch12 -d upstream -p1
Expand Down
27 changes: 27 additions & 0 deletions rpm/k18n-disable-q_coreapp_startup_function.patch
@@ -0,0 +1,27 @@
From f51e21873aa52bc70a2f1ff09732b5c23b63e3cb Mon Sep 17 00:00:00 2001
From: Pekka Vuorela <pekka.vuorela@jolla.com>
Date: Fri, 22 Mar 2019 10:55:44 +0200
Subject: [PATCH] Disable Q_COREAPP_STARTUP_FUNCTION

This doesn't work with Calligra loaded as plugin and seems partly
pointless event if it did. The QGuiApplication is already created
long ago when this is executed and done it separate thread it
warns on trying to parent QTranslator into object (qapp) in a
different thread.
---
src/main.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.cpp b/src/main.cpp
index 6b46f41..3510f2d 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -50,4 +50,4 @@ static void load()
}
}

-Q_COREAPP_STARTUP_FUNCTION(load)
+//Q_COREAPP_STARTUP_FUNCTION(load)
--
2.20.1

55 changes: 55 additions & 0 deletions rpm/kxmlgui-disable_startup_functions.patch
@@ -0,0 +1,55 @@
From bc0f163db4e91b7669976510d5964957ef70a540 Mon Sep 17 00:00:00 2001
From: Pekka Vuorela <pekka.vuorela@jolla.com>
Date: Fri, 22 Mar 2019 15:31:46 +0200
Subject: [PATCH 2/2] Comment out Q_COREAPP_STARTUP_FUNCTIONs

Warns on qobject parents when loaded as plugin from another thread.
Shouldn't be needed.
---
src/kactionconflictdetector.cpp | 3 ++-
src/kcheckaccelerators.cpp | 3 ++-
src/kswitchlanguagedialog_p.cpp | 3 ++-
3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/kactionconflictdetector.cpp b/src/kactionconflictdetector.cpp
index 6d4f75c..db4cd45 100644
--- a/src/kactionconflictdetector.cpp
+++ b/src/kactionconflictdetector.cpp
@@ -65,4 +65,5 @@ void _k_installConflictDetector()
app->installEventFilter(new KActionConflictDetector(app));
}

-Q_COREAPP_STARTUP_FUNCTION(_k_installConflictDetector)
+// doesn't work when loaded as plugin
+//Q_COREAPP_STARTUP_FUNCTION(_k_installConflictDetector)
diff --git a/src/kcheckaccelerators.cpp b/src/kcheckaccelerators.cpp
index 7c551f1..1c78a89 100644
--- a/src/kcheckaccelerators.cpp
+++ b/src/kcheckaccelerators.cpp
@@ -87,7 +87,8 @@ static void startupFunc()
QMetaObject::invokeMethod(initializer, "initiateIfNeeded", Qt::QueuedConnection);
}

-Q_COREAPP_STARTUP_FUNCTION(startupFunc)
+// doesn't work when loaded as plugin
+//Q_COREAPP_STARTUP_FUNCTION(startupFunc)

KCheckAccelerators::KCheckAccelerators(QObject *parent, int key_, bool autoCheck_, bool copyWidgetText_)
: QObject(parent)
diff --git a/src/kswitchlanguagedialog_p.cpp b/src/kswitchlanguagedialog_p.cpp
index 12a1659..b7261e7 100644
--- a/src/kswitchlanguagedialog_p.cpp
+++ b/src/kswitchlanguagedialog_p.cpp
@@ -87,7 +87,8 @@ static void initializeLanguages()
}
}

-Q_COREAPP_STARTUP_FUNCTION(initializeLanguages)
+// doesn't work when loaded as plugin
+//Q_COREAPP_STARTUP_FUNCTION(initializeLanguages)

namespace KDEPrivate
{
--
2.20.1

6 changes: 3 additions & 3 deletions rpm/kxmlgui-no-textwidgets.patch
@@ -1,7 +1,7 @@
From 85717af9f5e1b5ee36fc8c330778e832a7a9c06d Mon Sep 17 00:00:00 2001
From bdf0f3fa9806485f6f1bd71f031222e880cb7237 Mon Sep 17 00:00:00 2001
From: Damien Caliste <dcaliste@free.fr>
Date: Tue, 11 Dec 2018 13:00:04 +0100
Subject: [PATCH] Disable various dependencies.
Subject: [PATCH 1/2] Disable various dependencies.

---
CMakeLists.txt | 10 +++++-----
Expand Down Expand Up @@ -210,5 +210,5 @@ index 0cd7560..a2c059c 100644
#include <kconfiggroup.h>

--
2.7.4
2.20.1

0 comments on commit e12681c

Please sign in to comment.