refactor
This commit is contained in:
parent
8117f62107
commit
58ed6d6492
|
@ -5,9 +5,9 @@
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:49.6878635Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:58.9876786Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:50.2019950Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:59.1749926Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -16,11 +16,11 @@ QString Access::pageRefers() const { return this->summary_refer_store; }
|
||||||
|
|
||||||
Element::Element(std::shared_ptr<const ast_gen::ElementAccess> handle) :Access(handle) {}
|
Element::Element(std::shared_ptr<const ast_gen::ElementAccess> handle) :Access(handle) {}
|
||||||
|
|
||||||
void printer::Element::setPieceRefer(const QString& href) {
|
void printer::Element::setSliceRefer(const QString& href) {
|
||||||
this->refer_store = href;
|
this->refer_store = href;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString printer::Element::pieceRefers() const {
|
QString printer::Element::sliceRefers() const {
|
||||||
return refer_store;
|
return refer_store;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ QString StoryLine::getPageHTML(QDomElement& parent) const {
|
||||||
case NovelNode::FragmentRefer:
|
case NovelNode::FragmentRefer:
|
||||||
case NovelNode::FragmentDefine: {
|
case NovelNode::FragmentDefine: {
|
||||||
auto element_inst = this->getElement(inst_c->element()->signature());
|
auto element_inst = this->getElement(inst_c->element()->signature());
|
||||||
element_inst->getPieceHTML(dom_storyline);
|
element_inst->getSliceHTML(dom_storyline);
|
||||||
}break;
|
}break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -99,7 +99,7 @@ std::shared_ptr<Fragment> printer::FragmentRef::hostFragment() const
|
||||||
return this->host_inst.lock();
|
return this->host_inst.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FragmentRef::getPieceHTML(QDomElement& dom_parent) const {
|
QString FragmentRef::getSliceHTML(QDomElement& dom_parent) const {
|
||||||
auto syntax_element = this->accessPeers()->element();
|
auto syntax_element = this->accessPeers()->element();
|
||||||
auto refer_element = std::dynamic_pointer_cast<const FragmentRefers>(syntax_element);
|
auto refer_element = std::dynamic_pointer_cast<const FragmentRefers>(syntax_element);
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ QString FragmentRef::getPageHTML(QDomElement& parent) const {
|
||||||
refers_dom.appendChild(title_block);
|
refers_dom.appendChild(title_block);
|
||||||
auto title_refer = doc.createElement(u8"a");
|
auto title_refer = doc.createElement(u8"a");
|
||||||
title_refer.appendChild(doc.createTextNode(refer_element->signature()));
|
title_refer.appendChild(doc.createTextNode(refer_element->signature()));
|
||||||
title_refer.setAttribute("href", this->pieceRefers());
|
title_refer.setAttribute("href", this->sliceRefers());
|
||||||
title_block.appendChild(title_refer);
|
title_block.appendChild(title_refer);
|
||||||
|
|
||||||
std::function<void(QList<std::shared_ptr<const ast_gen::ElementAccess>>)> build_cascade =
|
std::function<void(QList<std::shared_ptr<const ast_gen::ElementAccess>>)> build_cascade =
|
||||||
|
@ -175,7 +175,7 @@ QList<std::shared_ptr<FragmentRef>> Fragment::additionals() const {
|
||||||
return this->additionals_store;
|
return this->additionals_store;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Fragment::getPieceHTML(QDomElement& parent) const {
|
QString Fragment::getSliceHTML(QDomElement& parent) const {
|
||||||
auto syntax_access = this->accessPeers();
|
auto syntax_access = this->accessPeers();
|
||||||
auto fragment_inst = std::dynamic_pointer_cast<const FragmentDefine>(syntax_access->element());
|
auto fragment_inst = std::dynamic_pointer_cast<const FragmentDefine>(syntax_access->element());
|
||||||
|
|
||||||
|
@ -332,7 +332,7 @@ std::function<void(const QList<std::shared_ptr<Element>>&, const QString&)> refe
|
||||||
[&](const QList<std::shared_ptr<Element>>& items, const QString& summary_href) {
|
[&](const QList<std::shared_ptr<Element>>& items, const QString& summary_href) {
|
||||||
for (auto& item : items) {
|
for (auto& item : items) {
|
||||||
auto element_addr = QString::number((qulonglong)item->accessPeers()->element().get());
|
auto element_addr = QString::number((qulonglong)item->accessPeers()->element().get());
|
||||||
item->setPieceRefer(summary_href + u8"#" + element_addr);
|
item->setSliceRefer(summary_href + u8"#" + element_addr);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,13 +49,13 @@ namespace printer {
|
||||||
/*
|
/*
|
||||||
* @brief 设置片段URL,从故事汇总页面跳转回出处页面
|
* @brief 设置片段URL,从故事汇总页面跳转回出处页面
|
||||||
*/
|
*/
|
||||||
virtual void setPieceRefer(const QString& href);
|
virtual void setSliceRefer(const QString& href);
|
||||||
virtual QString pieceRefers() const;
|
virtual QString sliceRefers() const;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief 获取故事片段出处的节点HTML
|
* @brief 获取故事片段出处的节点HTML
|
||||||
*/
|
*/
|
||||||
virtual QString getPieceHTML(QDomElement &doc) const = 0;
|
virtual QString getSliceHTML(QDomElement &doc) const = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString refer_store;
|
QString refer_store;
|
||||||
|
@ -109,7 +109,7 @@ namespace printer {
|
||||||
QString getPageHTML(QDomElement& doc) const override;
|
QString getPageHTML(QDomElement& doc) const override;
|
||||||
|
|
||||||
// 通过 Element 继承
|
// 通过 Element 继承
|
||||||
QString getPieceHTML(QDomElement& doc) const override;
|
QString getSliceHTML(QDomElement& doc) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::weak_ptr<Fragment> host_inst;
|
std::weak_ptr<Fragment> host_inst;
|
||||||
|
@ -132,7 +132,7 @@ namespace printer {
|
||||||
QString getPageHTML(QDomElement& doc) const override;
|
QString getPageHTML(QDomElement& doc) const override;
|
||||||
|
|
||||||
// 通过 Element 继承
|
// 通过 Element 继承
|
||||||
QString getPieceHTML(QDomElement& doc) const override;
|
QString getSliceHTML(QDomElement& doc) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:50.6102543Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:59.4171377Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:50.7328441Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:59.5628515Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -5,9 +5,9 @@
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:50.4238856Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:59.2348615Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:50.5434786Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:59.3520172Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -2,9 +2,9 @@
|
||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:50.7936395Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:59.6245932Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<QtLastBackgroundBuild>2024-03-31T14:11:50.9152358Z</QtLastBackgroundBuild>
|
<QtLastBackgroundBuild>2024-04-02T15:18:59.7760855Z</QtLastBackgroundBuild>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue