Newer
Older
/**************************************************************************
**
** Copyright (C) 2014 BlackBerry Limited. All rights reserved.
** Contact: BlackBerry (qt@blackberry.com)
** Contact: KDAB (info@kdab.com)
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#include "bardescriptordocumentnodehandlers.h"
#include "bardescriptoreditorwidget.h"
#include "bardescriptoreditorassetswidget.h"
#include "bardescriptoreditorauthorinformationwidget.h"
#include "bardescriptoreditorentrypointwidget.h"
#include "bardescriptoreditorenvironmentwidget.h"
#include "bardescriptoreditorgeneralwidget.h"
#include "bardescriptoreditorpackageinformationwidget.h"
#include "bardescriptoreditorpermissionswidget.h"
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
72
73
74
75
76
77
#include <utils/environment.h>
#include <utils/qtcassert.h>
#include <QDomNode>
using namespace Qnx;
using namespace Qnx::Internal;
BarDescriptorDocumentAbstractNodeHandler::BarDescriptorDocumentAbstractNodeHandler(BarDescriptorEditorWidget *editorWidget)
: m_editorWidget(editorWidget)
, m_order(0xFFFF)
{
}
BarDescriptorDocumentAbstractNodeHandler::~BarDescriptorDocumentAbstractNodeHandler()
{
}
bool BarDescriptorDocumentAbstractNodeHandler::handle(const QDomNode &node)
{
if (m_order == 0xFFFF)
m_order = node.lineNumber();
return fromNode(node);
}
void BarDescriptorDocumentAbstractNodeHandler::clear()
{
m_order = 0xFFFF;
}
int BarDescriptorDocumentAbstractNodeHandler::order() const
{
return m_order;
}
BarDescriptorEditorPackageInformationWidget *BarDescriptorDocumentAbstractNodeHandler::packageInformationWidget() const
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
return m_editorWidget->packageInformationWidget();
}
BarDescriptorEditorAuthorInformationWidget *BarDescriptorDocumentAbstractNodeHandler::authorInformationWidget() const
{
return m_editorWidget->authorInformationWidget();
}
BarDescriptorEditorEntryPointWidget *BarDescriptorDocumentAbstractNodeHandler::entryPointWidget() const
{
return m_editorWidget->entryPointWidget();
}
BarDescriptorEditorGeneralWidget *BarDescriptorDocumentAbstractNodeHandler::generalWidget() const
{
return m_editorWidget->generalWidget();
}
BarDescriptorEditorPermissionsWidget *BarDescriptorDocumentAbstractNodeHandler::permissionsWidget() const
{
return m_editorWidget->permissionsWidget();
}
BarDescriptorEditorEnvironmentWidget *BarDescriptorDocumentAbstractNodeHandler::environmentWidget() const
{
return m_editorWidget->environmentWidget();
}
BarDescriptorEditorAssetsWidget *BarDescriptorDocumentAbstractNodeHandler::assetsWidget() const
{
return m_editorWidget->assetsWidget();
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
}
bool BarDescriptorDocumentAbstractNodeHandler::canHandleSimpleTextElement(const QDomNode &node, const QString &tagName) const
{
QDomElement element = node.toElement();
if (element.isNull())
return false;
if (element.tagName().toLower() != tagName.toLower())
return false;
QDomText textNode = element.firstChild().toText();
if (textNode.isNull())
return false;
return true;
}
QString BarDescriptorDocumentAbstractNodeHandler::loadSimpleTextElement(const QDomNode &node)
{
QDomElement element = node.toElement();
QDomText textNode = element.firstChild().toText();
return textNode.data();
}
QDomElement BarDescriptorDocumentAbstractNodeHandler::createSimpleTextElement(QDomDocument &doc, const QString &tagName, const QString &textValue) const
{
if (textValue.isEmpty())
return QDomElement();
QDomElement elem = doc.createElement(tagName);
elem.appendChild(doc.createTextNode(textValue));
return elem;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentIdNodeHandler::BarDescriptorDocumentIdNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentIdNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("id"));
}
bool BarDescriptorDocumentIdNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
packageInformationWidget()->setPackageId(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentIdNodeHandler::toNode(QDomDocument &doc) const
{
return createSimpleTextElement(doc, QLatin1String("id"), packageInformationWidget()->packageId());
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentVersionNumberNodeHandler::BarDescriptorDocumentVersionNumberNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentVersionNumberNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("versionNumber"));
}
bool BarDescriptorDocumentVersionNumberNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
packageInformationWidget()->setPackageVersion(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentVersionNumberNodeHandler::toNode(QDomDocument &doc) const
{
return createSimpleTextElement(doc, QLatin1String("versionNumber"), packageInformationWidget()->packageVersion());
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentBuildIdNodeHandler::BarDescriptorDocumentBuildIdNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentBuildIdNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("buildId"));
}
bool BarDescriptorDocumentBuildIdNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
packageInformationWidget()->setPackageBuildId(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentBuildIdNodeHandler::toNode(QDomDocument &doc) const
{
return createSimpleTextElement(doc, QLatin1String("buildId"), packageInformationWidget()->packageBuildId());
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentApplicationNameNodeHandler::BarDescriptorDocumentApplicationNameNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentApplicationNameNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("name"));
}
bool BarDescriptorDocumentApplicationNameNodeHandler::fromNode(const QDomNode &node)
{
// TODO: Add support for localization
if (!canHandle(node))
return false;
entryPointWidget()->setApplicationName(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentApplicationNameNodeHandler::toNode(QDomDocument &doc) const
{
// TODO: Add support for localization
return createSimpleTextElement(doc, QLatin1String("name"), entryPointWidget()->applicationName());
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentApplicationDescriptionNodeHandler::BarDescriptorDocumentApplicationDescriptionNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentApplicationDescriptionNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("description"));
}
bool BarDescriptorDocumentApplicationDescriptionNodeHandler::fromNode(const QDomNode &node)
{
// TODO: Add support for localization
if (!canHandle(node))
return false;
entryPointWidget()->setApplicationDescription(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentApplicationDescriptionNodeHandler::toNode(QDomDocument &doc) const
{
return createSimpleTextElement(doc, QLatin1String("description"), entryPointWidget()->applicationDescription());
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentApplicationIconNodeHandler::BarDescriptorDocumentApplicationIconNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentApplicationIconNodeHandler::canHandle(const QDomNode &node) const
{
QDomElement element = node.toElement();
if (element.isNull())
return false;
if (element.tagName() != QLatin1String("icon"))
return false;
QDomElement imageElement = element.firstChild().toElement();
if (imageElement.isNull())
return false;
if (imageElement.tagName() != QLatin1String("image"))
return false;
QDomText imageTextNode = imageElement.firstChild().toText();
if (imageTextNode.isNull())
return false;
return true;
}
bool BarDescriptorDocumentApplicationIconNodeHandler::fromNode(const QDomNode &node)
{
// TODO: Add support for localization
if (!canHandle(node))
return false;
QDomNode imageNode = node.firstChild();
QDomText imageTextNode = imageNode.firstChild().toText();
entryPointWidget()->setApplicationIcon(imageTextNode.data());
return true;
}
QDomNode BarDescriptorDocumentApplicationIconNodeHandler::toNode(QDomDocument &doc) const
{
// TODO: Add support for localization
const QString iconFileName = entryPointWidget()->applicationIconFileName();
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
if (iconFileName.isEmpty())
return QDomElement();
QDomElement iconElement = doc.createElement(QLatin1String("icon"));
iconElement.appendChild(createSimpleTextElement(doc, QLatin1String("image"), iconFileName));
return iconElement;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentSplashScreenNodeHandler::BarDescriptorDocumentSplashScreenNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentSplashScreenNodeHandler::canHandle(const QDomNode &node) const
{
QDomElement element = node.toElement();
if (element.isNull())
return false;
if (element.tagName().toLower() != QLatin1String("splashscreens"))
return false;
QDomElement imageElement = element.firstChild().toElement();
if (imageElement.isNull())
return false;
if (imageElement.tagName().toLower() != QLatin1String("image"))
return false;
QDomText imageTextNode = imageElement.firstChild().toText();
if (imageTextNode.isNull())
return false;
return true;
}
bool BarDescriptorDocumentSplashScreenNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
QDomElement imageNode = node.firstChildElement();
while (!imageNode.isNull()) {
if (imageNode.tagName().toLower() == QLatin1String("image")) {
QDomText imageTextNode = imageNode.firstChild().toText();
entryPointWidget()->appendSplashScreen(imageTextNode.data());
}
imageNode = imageNode.nextSiblingElement();
}
return true;
}
QDomNode BarDescriptorDocumentSplashScreenNodeHandler::toNode(QDomDocument &doc) const
{
QStringList splashScreens = entryPointWidget()->splashScreens();
if (splashScreens.isEmpty())
return QDomElement();
QDomElement splashScreenElement = doc.createElement(QLatin1String("splashScreens"));
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
foreach (const QString &splashScreen, splashScreens)
splashScreenElement.appendChild(createSimpleTextElement(doc, QLatin1String("image"), splashScreen));
return splashScreenElement;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentAssetNodeHandler::BarDescriptorDocumentAssetNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentAssetNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("asset"));
}
bool BarDescriptorDocumentAssetNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
QDomElement element = node.toElement();
QString path = element.attribute(QLatin1String("path"));
QString entry = element.attribute(QLatin1String("entry"));
QDomText destNode = element.firstChild().toText();
QString dest = destNode.data();
BarDescriptorAsset asset;
asset.source = path;
asset.destination = dest;
asset.entry = entry == QLatin1String("true");
assetsWidget()->addAsset(asset);
return true;
}
QDomNode BarDescriptorDocumentAssetNodeHandler::toNode(QDomDocument &doc) const
{
QDomDocumentFragment fragment = doc.createDocumentFragment();
QList<BarDescriptorAsset> assets = assetsWidget()->assets();
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
foreach (const BarDescriptorAsset &asset, assets) {
QDomElement assetElem = doc.createElement(QLatin1String("asset"));
assetElem.setAttribute(QLatin1String("path"), asset.source);
if (asset.entry) {
assetElem.setAttribute(QLatin1String("type"), QLatin1String("Qnx/Elf"));
assetElem.setAttribute(QLatin1String("entry"), QLatin1String("true"));
}
assetElem.appendChild(doc.createTextNode(asset.destination));
fragment.appendChild(assetElem);
}
return fragment;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentInitialWindowNodeHandler::BarDescriptorDocumentInitialWindowNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentInitialWindowNodeHandler::canHandle(const QDomNode &node) const
{
QDomElement element = node.toElement();
if (element.isNull())
return false;
if (element.tagName() != QLatin1String("initialWindow"))
return false;
return true;
}
bool BarDescriptorDocumentInitialWindowNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
QDomElement child = node.firstChildElement();
while (!child.isNull()) {
if (child.tagName() == QLatin1String("aspectRatio")) {
generalWidget()->setOrientation(loadSimpleTextElement(child));
} else if (child.tagName() == QLatin1String("autoOrients")) {
if (loadSimpleTextElement(child) == QLatin1String("true"))
generalWidget()->setOrientation(QLatin1String("auto-orient"));
} else if (child.tagName() == QLatin1String("systemChrome")) {
generalWidget()->setChrome(loadSimpleTextElement(child));
} else if (child.tagName() == QLatin1String("transparent")) {
const QString transparent = loadSimpleTextElement(child);
generalWidget()->setTransparent(transparent == QLatin1String("true"));
}
child = child.nextSiblingElement();
}
return true;
}
QDomNode BarDescriptorDocumentInitialWindowNodeHandler::toNode(QDomDocument &doc) const
{
QDomElement element = doc.createElement(QLatin1String("initialWindow"));
if (generalWidget()->orientation() == QLatin1String("auto-orient")) {
element.appendChild(createSimpleTextElement(doc, QLatin1String("autoOrients"), QLatin1String("true")));
} else if (!generalWidget()->orientation().isEmpty()) {
element.appendChild(createSimpleTextElement(doc, QLatin1String("aspectRatio"), generalWidget()->orientation()));
element.appendChild(createSimpleTextElement(doc, QLatin1String("autoOrients"), QLatin1String("false")));
}
element.appendChild(createSimpleTextElement(doc, QLatin1String("systemChrome"), generalWidget()->chrome()));
element.appendChild(createSimpleTextElement(doc, QLatin1String("transparent"), generalWidget()->transparent() ? QLatin1String("true") : QLatin1String("false")));
return element;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentActionNodeHandler::BarDescriptorDocumentActionNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentActionNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("action"));
}
bool BarDescriptorDocumentActionNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
QString value = loadSimpleTextElement(node);
if (value != QLatin1String("run_native")) // This has no representation in the GUI, and is always added
permissionsWidget()->checkPermission(value);
return true;
}
QDomNode BarDescriptorDocumentActionNodeHandler::toNode(QDomDocument &doc) const
{
QDomDocumentFragment frag = doc.createDocumentFragment();
QDomElement runNativeElement = doc.createElement(QLatin1String("action"));
runNativeElement.setAttribute(QLatin1String("system"), QLatin1String("true"));
runNativeElement.appendChild(doc.createTextNode(QLatin1String("run_native")));
frag.appendChild(runNativeElement);
QStringList checkedIdentifiers = permissionsWidget()->checkedPermissions();
foreach (const QString &identifier, checkedIdentifiers)
frag.appendChild(createSimpleTextElement(doc, QLatin1String("action"), identifier));
return frag;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentArgNodeHandler::BarDescriptorDocumentArgNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentArgNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("arg"));
}
bool BarDescriptorDocumentArgNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
generalWidget()->appendApplicationArgument(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentArgNodeHandler::toNode(QDomDocument &doc) const
{
QDomDocumentFragment frag = doc.createDocumentFragment();
QStringList arguments = generalWidget()->applicationArguments();
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
foreach (const QString &argument, arguments)
frag.appendChild(createSimpleTextElement(doc, QLatin1String("arg"), argument));
return frag;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentEnvNodeHandler::BarDescriptorDocumentEnvNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentEnvNodeHandler::canHandle(const QDomNode &node) const
{
QDomElement element = node.toElement();
if (element.isNull())
return false;
if (element.tagName() != QLatin1String("env"))
return false;
if (!element.hasAttribute(QLatin1String("var")) || !element.hasAttribute(QLatin1String("value")))
return false;
return true;
}
bool BarDescriptorDocumentEnvNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
QDomElement element = node.toElement();
QString var = element.attribute(QLatin1String("var"));
QString value = element.attribute(QLatin1String("value"));
Utils::EnvironmentItem item(var, value);
environmentWidget()->appendEnvironmentItem(item);
return true;
}
QDomNode BarDescriptorDocumentEnvNodeHandler::toNode(QDomDocument &doc) const
{
QDomDocumentFragment frag = doc.createDocumentFragment();
QList<Utils::EnvironmentItem> environmentItems = environmentWidget()->environment();
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
foreach (const Utils::EnvironmentItem &item, environmentItems) {
QDomElement element = doc.createElement(QLatin1String("env"));
element.setAttribute(QLatin1String("var"), item.name);
element.setAttribute(QLatin1String("value"), item.value);
frag.appendChild(element);
}
return frag;
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentAuthorNodeHandler::BarDescriptorDocumentAuthorNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentAuthorNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("author"))
|| canHandleSimpleTextElement(node, QLatin1String("publisher"));
}
bool BarDescriptorDocumentAuthorNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
authorInformationWidget()->setAuthor(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentAuthorNodeHandler::toNode(QDomDocument &doc) const
{
return createSimpleTextElement(doc, QLatin1String("author"), authorInformationWidget()->author());
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentAuthorIdNodeHandler::BarDescriptorDocumentAuthorIdNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentAuthorIdNodeHandler::canHandle(const QDomNode &node) const
{
return canHandleSimpleTextElement(node, QLatin1String("authorId"));
}
bool BarDescriptorDocumentAuthorIdNodeHandler::fromNode(const QDomNode &node)
{
if (!canHandle(node))
return false;
authorInformationWidget()->setAuthorId(loadSimpleTextElement(node));
return true;
}
QDomNode BarDescriptorDocumentAuthorIdNodeHandler::toNode(QDomDocument &doc) const
{
return createSimpleTextElement(doc, QLatin1String("authorId"), authorInformationWidget()->authorId());
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
}
// ----------------------------------------------------------------------------
BarDescriptorDocumentUnknownNodeHandler::BarDescriptorDocumentUnknownNodeHandler(BarDescriptorEditorWidget *editorWidget)
: BarDescriptorDocumentAbstractNodeHandler(editorWidget)
{
}
bool BarDescriptorDocumentUnknownNodeHandler::canHandle(const QDomNode &node) const
{
Q_UNUSED(node);
return true;
}
bool BarDescriptorDocumentUnknownNodeHandler::fromNode(const QDomNode &node)
{
m_node = node.cloneNode();
return true;
}
QDomNode BarDescriptorDocumentUnknownNodeHandler::toNode(QDomDocument &doc) const
{
Q_UNUSED(doc);
return m_node;
}