summaryrefslogtreecommitdiff
path: root/archivers/ark/files/patch-git_cd8ad27
blob: 229d8cd202c47d6d01827b688b7a8d803f2ca99d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
commit cd8ad2761d41d1ec0a18cff7f4d166b53c899fc2
Author: Raphael Kubo da Costa <rakuco@FreeBSD.org>
Date:   Mon Nov 24 01:37:06 2014 +0200

    Stop crashing on exit when being used solely as a KPart.
    
    This change fixes a crash introduced by commit 3b981ca ("Remove Part
    from KXMLGUIFactory on exit").
    
    Part::~Part() is the wrong place to call KXMLGUIFactory::removeClient(),
    as it assumes addClient() had been called in the first place.
    
    This is only true if Ark is called as a standalone program, since that
    is done in MainWindow::loadPart()'s call to KXMLGuiWindow::createGUI().
    
    Conversely, if the Ark KPart is being used as an embedded viewer in,
    say, Konqueror or to preview an archive inside an archive (ie. Ark
    inside Ark) that does not hold true and we try to access a
    KXMLGUIFactory that does not exist.
    
    Instead, call KXMLGuiWindow::removeClient() in MainWindow's destructor,
    since in this case we are certain that addClient() was been called
    before.
    
    CCBUG:      341187
    
    (cherry picked from commit 9c30f30b38c36a31e6fcb3aa047a0247ac5a22fb)
    This was committed for completeness, as there will be no additional
    releases from the KDE/4.14 branch.
    
    Conflicts:
    	part/part.cpp

--- app/mainwindow.cpp
+++ app/mainwindow.cpp
@@ -38,6 +38,7 @@
 #include <KDebug>
 #include <KEditToolBar>
 #include <KShortcutsDialog>
+#include <KXMLGUIFactory>
 
 #include <QDragEnterEvent>
 #include <QDragMoveEvent>
@@ -69,6 +70,8 @@ MainWindow::~MainWindow()
     if (m_recentFilesAction) {
         m_recentFilesAction->saveEntries(KGlobal::config()->group("Recent Files"));
     }
+
+    guiFactory()->removeClient(m_part);
     delete m_part;
     m_part = 0;
 }
--- part/part.cpp
+++ part/part.cpp
@@ -53,7 +53,6 @@
 #include <KStandardGuiItem>
 #include <KTempDir>
 #include <KToggleAction>
-#include <KXMLGUIFactory>
 
 #include <QAction>
 #include <QCursor>
@@ -138,8 +137,6 @@ Part::Part(QWidget *parentWidget, QObject *parent, const QVariantList& args)
 
 Part::~Part()
 {
-    factory()->removeClient(this);
-
     saveSplitterSizes();
 
     m_extractFilesAction->menu()->deleteLater();