1 |
dilfridge 12/04/08 13:39:59 |
2 |
|
3 |
Added: calligra-2.4.0-rdf.patch |
4 |
Log: |
5 |
Fix build with -semantic-desktop, bug 409515 |
6 |
|
7 |
(Portage version: 2.1.10.56/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-office/calligra/files/calligra-2.4.0-rdf.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/calligra/files/calligra-2.4.0-rdf.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/calligra/files/calligra-2.4.0-rdf.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: calligra-2.4.0-rdf.patch |
16 |
=================================================================== |
17 |
From c34af29f458a35b6cf0fbec8574425516be62859 Mon Sep 17 00:00:00 2001 |
18 |
From: Boudewijn Rempt <boud@×××××××.org> |
19 |
Date: Sun, 8 Apr 2012 12:21:50 +0200 |
20 |
Subject: [PATCH] Hide rdf in more places |
21 |
|
22 |
We shouldn't use KoDocumentRdf unless hedged with SHOULD_BUILD_RDF |
23 |
|
24 |
Ok to backport? |
25 |
--- |
26 |
libs/main/KoDocument.cpp | 2 +- |
27 |
libs/main/KoDocument.h | 2 +- |
28 |
libs/main/KoDocumentInfoDlg.cpp | 8 +++++--- |
29 |
libs/main/KoDocumentInfoDlg.h | 4 ++-- |
30 |
words/part/KWOdfLoader.cpp | 3 ++- |
31 |
words/part/KWView.cpp | 6 +++--- |
32 |
words/part/dockers/KWRdfDocker.cpp | 6 +++--- |
33 |
7 files changed, 17 insertions(+), 14 deletions(-) |
34 |
|
35 |
diff --git a/libs/main/KoDocument.cpp b/libs/main/KoDocument.cpp |
36 |
index 2fedde7..775c2c6 100644 |
37 |
--- a/libs/main/KoDocument.cpp |
38 |
+++ b/libs/main/KoDocument.cpp |
39 |
@@ -812,7 +812,7 @@ KoDocumentInfo *KoDocument::documentInfo() const |
40 |
return d->docInfo; |
41 |
} |
42 |
|
43 |
-KoDocumentRdf *KoDocument::documentRdf() const |
44 |
+KoDocumentRdfBase *KoDocument::documentRdf() const |
45 |
{ |
46 |
#ifdef SHOULD_BUILD_RDF |
47 |
if (d->docRdf && d->docRdf->model()) { |
48 |
diff --git a/libs/main/KoDocument.h b/libs/main/KoDocument.h |
49 |
index d69e15c..7cc8cd5 100644 |
50 |
--- a/libs/main/KoDocument.h |
51 |
+++ b/libs/main/KoDocument.h |
52 |
@@ -595,7 +595,7 @@ public: |
53 |
* the RDF system and needs full access to the KoDocumentRdf object. |
54 |
* @see KoDocumentRdf |
55 |
*/ |
56 |
- KoDocumentRdf *documentRdf() const; |
57 |
+ KoDocumentRdfBase *documentRdf() const; |
58 |
|
59 |
/** |
60 |
* Replace the current rdf document with the given rdf document. The existing RDF document |
61 |
diff --git a/libs/main/KoDocumentInfoDlg.cpp b/libs/main/KoDocumentInfoDlg.cpp |
62 |
index 23ae08e..1781e34 100644 |
63 |
--- a/libs/main/KoDocumentInfoDlg.cpp |
64 |
+++ b/libs/main/KoDocumentInfoDlg.cpp |
65 |
@@ -26,8 +26,10 @@ |
66 |
#include "KoDocumentInfo.h" |
67 |
#include "KoDocument.h" |
68 |
#include "KoMainWindow.h" |
69 |
+ |
70 |
#include "rdf/KoDocumentRdfEditWidgetBase.h" |
71 |
#ifdef SHOULD_BUILD_RDF |
72 |
+#include "rdf/KoDocumentRdf.h" |
73 |
#include "rdf/KoDocumentRdfEditWidget.h" |
74 |
#endif |
75 |
|
76 |
@@ -68,7 +70,7 @@ public: |
77 |
QList<KPageWidgetItem*> m_pages; |
78 |
Ui::KoDocumentInfoAboutWidget* m_aboutUi; |
79 |
Ui::KoDocumentInfoAuthorWidget* m_authorUi; |
80 |
- KoDocumentRdf* m_rdf; |
81 |
+ KoDocumentRdfBase* m_rdf; |
82 |
#ifdef SHOULD_BUILD_RDF |
83 |
KoDocumentRdfEditWidget* m_rdfEditWidget; |
84 |
#else |
85 |
@@ -80,7 +82,7 @@ public: |
86 |
}; |
87 |
|
88 |
|
89 |
-KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo, KoDocumentRdf* docRdf) |
90 |
+KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo, KoDocumentRdfBase* docRdf) |
91 |
: KPageDialog(parent) |
92 |
, d(new KoDocumentInfoDlgPrivate) |
93 |
{ |
94 |
@@ -136,7 +138,7 @@ KoDocumentInfoDlg::KoDocumentInfoDlg(QWidget* parent, KoDocumentInfo* docInfo, K |
95 |
d->m_rdfEditWidget = 0; |
96 |
|
97 |
#ifdef SHOULD_BUILD_RDF |
98 |
- d->m_rdfEditWidget = new KoDocumentRdfEditWidget(this, d->m_rdf); |
99 |
+ d->m_rdfEditWidget = new KoDocumentRdfEditWidget(this, (KoDocumentRdf*)d->m_rdf); |
100 |
page = new KPageWidgetItem(d->m_rdfEditWidget->widget(), i18n("Rdf")); |
101 |
page->setHeader(i18n("Rdf")); |
102 |
page->setIcon(KIcon("text-rdf")); |
103 |
diff --git a/libs/main/KoDocumentInfoDlg.h b/libs/main/KoDocumentInfoDlg.h |
104 |
index 9d3e6eb..733f126 100644 |
105 |
--- a/libs/main/KoDocumentInfoDlg.h |
106 |
+++ b/libs/main/KoDocumentInfoDlg.h |
107 |
@@ -24,7 +24,7 @@ |
108 |
#include <kpagedialog.h> |
109 |
|
110 |
class KoDocumentInfo; |
111 |
-class KoDocumentRdf; |
112 |
+class KoDocumentRdfBase; |
113 |
class KPageWidgetItem; |
114 |
|
115 |
/** |
116 |
@@ -55,7 +55,7 @@ public: |
117 |
* @param parent a pointer to the parent widget |
118 |
* @param docInfo a pointer to the shown KoDocumentInfo |
119 |
*/ |
120 |
- KoDocumentInfoDlg(QWidget *parent, KoDocumentInfo* docInfo, KoDocumentRdf* docRdf = 0); |
121 |
+ KoDocumentInfoDlg(QWidget *parent, KoDocumentInfo* docInfo, KoDocumentRdfBase* docRdf = 0); |
122 |
|
123 |
/** The destructor */ |
124 |
virtual ~KoDocumentInfoDlg(); |
125 |
diff --git a/words/part/KWOdfLoader.cpp b/words/part/KWOdfLoader.cpp |
126 |
index 9900102..238c7fe 100644 |
127 |
--- a/words/part/KWOdfLoader.cpp |
128 |
+++ b/words/part/KWOdfLoader.cpp |
129 |
@@ -46,8 +46,9 @@ |
130 |
#include <KoProgressUpdater.h> |
131 |
#include <KoVariableManager.h> |
132 |
#include <KoInlineTextObjectManager.h> |
133 |
+#ifdef SHOULD_BUILD_RDF |
134 |
#include <KoDocumentRdf.h> |
135 |
- |
136 |
+#endif |
137 |
// KDE + Qt includes |
138 |
#include <QTextCursor> |
139 |
#include <KDebug> |
140 |
diff --git a/words/part/KWView.cpp b/words/part/KWView.cpp |
141 |
index 0ac5285..53f7da5 100644 |
142 |
--- a/words/part/KWView.cpp |
143 |
+++ b/words/part/KWView.cpp |
144 |
@@ -163,7 +163,7 @@ KWView::KWView(const QString &viewMode, KWDocument *document, QWidget *parent) |
145 |
connect(m_zoomController, SIGNAL(zoomChanged(KoZoomMode::Mode, qreal)), this, SLOT(zoomChanged(KoZoomMode::Mode, qreal))); |
146 |
|
147 |
#ifdef SHOULD_BUILD_RDF |
148 |
- if (KoDocumentRdf *rdf = m_document->documentRdf()) { |
149 |
+ if (KoDocumentRdf *rdf = dynamic_cast<KoDocumentRdf*>(m_document->documentRdf())) { |
150 |
connect(rdf, SIGNAL(semanticObjectViewSiteUpdated(KoRdfSemanticItem*, const QString&)), |
151 |
this, SLOT(semanticObjectViewSiteUpdated(KoRdfSemanticItem*, const QString&))); |
152 |
} |
153 |
@@ -303,7 +303,7 @@ void KWView::setupActions() |
154 |
action->setWhatsThis(i18n("Stylesheets are used to format contact, event, and location information which is stored in Rdf")); |
155 |
connect(action, SIGNAL(triggered()), this, SLOT(editSemanticStylesheets())); |
156 |
|
157 |
- if (KoDocumentRdf* rdf = m_document->documentRdf()) { |
158 |
+ if (KoDocumentRdf* rdf = dynamic_cast<KoDocumentRdf*>(m_document->documentRdf())) { |
159 |
KAction* createRef = rdf->createInsertSemanticObjectReferenceAction(canvasBase()); |
160 |
actionCollection()->addAction("insert_semanticobject_ref", createRef); |
161 |
KActionMenu *subMenu = new KActionMenu(i18n("Create"), this); |
162 |
@@ -708,7 +708,7 @@ void KWView::pageSettingsDialogFinished() |
163 |
void KWView::editSemanticStylesheets() |
164 |
{ |
165 |
#ifdef SHOULD_BUILD_RDF |
166 |
- if (KoDocumentRdf *rdf = m_document->documentRdf()) { |
167 |
+ if (KoDocumentRdf *rdf = dynamic_cast<KoDocumentRdf*>(m_document->documentRdf())) { |
168 |
KoSemanticStylesheetsEditor *dia = new KoSemanticStylesheetsEditor(this, rdf); |
169 |
dia->show(); |
170 |
// TODO this leaks memory |
171 |
diff --git a/words/part/dockers/KWRdfDocker.cpp b/words/part/dockers/KWRdfDocker.cpp |
172 |
index 0fbf85b..969977b 100644 |
173 |
--- a/words/part/dockers/KWRdfDocker.cpp |
174 |
+++ b/words/part/dockers/KWRdfDocker.cpp |
175 |
@@ -93,8 +93,8 @@ void KWRdfDocker::setCanvas(KoCanvasBase *canvas) |
176 |
} |
177 |
|
178 |
m_document = newDoc; |
179 |
- widgetDocker.semanticView->setDocumentRdf(m_document->documentRdf()); |
180 |
- connect(m_document->documentRdf(), SIGNAL(semanticObjectAdded(KoRdfSemanticItem*)), |
181 |
+ widgetDocker.semanticView->setDocumentRdf(static_cast<KoDocumentRdf*>(m_document->documentRdf())); |
182 |
+ connect(static_cast<KoDocumentRdf*>(m_document->documentRdf()), SIGNAL(semanticObjectAdded(KoRdfSemanticItem*)), |
183 |
this, SLOT(semanticObjectAdded(KoRdfSemanticItem*))); |
184 |
connect(m_document->documentRdf(), SIGNAL(semanticObjectUpdated(KoRdfSemanticItem*)), |
185 |
this, SLOT(semanticObjectUpdated(KoRdfSemanticItem*))); |
186 |
@@ -168,7 +168,7 @@ void KWRdfDocker::updateData() |
187 |
|
188 |
// TODO try to get rid of 'editor' here by remembering the position in the resourceChanged() |
189 |
KoTextEditor *editor = KoTextEditor::getTextEditorFromCanvas(m_canvas); |
190 |
- KoDocumentRdf *rdf = m_document->documentRdf(); |
191 |
+ KoDocumentRdf *rdf = dynamic_cast<KoDocumentRdf*>(m_document->documentRdf()); |
192 |
if (editor && rdf) |
193 |
{ |
194 |
//kDebug(30015) << "m_lastCursorPosition:" << m_lastCursorPosition; |
195 |
-- |
196 |
1.7.9.2 |