Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 942928
Collapse All | Expand All

(-)a/CHANGELOG.md (+6 lines)
Lines 7-12 and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Link Here
7
7
8
## [Unreleased]
8
## [Unreleased]
9
9
10
### Fixed
11
12
* Issue #465799: Segmentation fault no longer occurs when .conf file is missing on first launch.
13
14
## [24.08.0]
15
10
### Added
16
### Added
11
17
12
* Added more icons to menu actions.
18
* Added more icons to menu actions.
(-)a/src/preview/htmlpreview.cpp (-12 / +12 lines)
Lines 1-5 Link Here
1
/*
1
/*
2
 * SPDX-FileCopyrightText: 2014-2023 Megan Conkle <megan.conkle@kdemail.net>
2
 * SPDX-FileCopyrightText: 2014-2024 Megan Conkle <megan.conkle@kdemail.net>
3
 *
3
 *
4
 * SPDX-License-Identifier: GPL-3.0-or-later
4
 * SPDX-License-Identifier: GPL-3.0-or-later
5
 */
5
 */
Lines 38-44 class HtmlPreviewPrivate Link Here
38
    HtmlPreviewPrivate(HtmlPreview *q_ptr)
38
    HtmlPreviewPrivate(HtmlPreview *q_ptr)
39
        : q_ptr(q_ptr)
39
        : q_ptr(q_ptr)
40
    {
40
    {
41
        ;
41
        proxy = new PreviewProxy(q_ptr);
42
    }
42
    }
43
43
44
    ~HtmlPreviewPrivate()
44
    ~HtmlPreviewPrivate()
Lines 51-57 class HtmlPreviewPrivate Link Here
51
    MarkdownDocument *document;
51
    MarkdownDocument *document;
52
    bool updateInProgress;
52
    bool updateInProgress;
53
    bool updateAgain;
53
    bool updateAgain;
54
    PreviewProxy proxy;
54
    PreviewProxy *proxy;
55
    QString baseUrl;
55
    QString baseUrl;
56
    QRegularExpression headingTagExp;
56
    QRegularExpression headingTagExp;
57
    Exporter *exporter;
57
    Exporter *exporter;
Lines 91-97 HtmlPreview::HtmlPreview Link Here
91
    d->updateInProgress = false;
91
    d->updateInProgress = false;
92
    d->updateAgain = false;
92
    d->updateAgain = false;
93
    d->exporter = exporter;
93
    d->exporter = exporter;
94
    d->proxy.setMathEnabled(d->exporter->supportsMath());
94
    d->proxy->setMathEnabled(d->exporter->supportsMath());
95
95
96
    d->baseUrl = "";
96
    d->baseUrl = "";
97
97
Lines 153-159 HtmlPreview::HtmlPreview Link Here
153
    this->setZoomFactor((horizontalDpi / 96.0));
153
    this->setZoomFactor((horizontalDpi / 96.0));
154
154
155
    QWebChannel *channel = new QWebChannel(this);
155
    QWebChannel *channel = new QWebChannel(this);
156
    channel->registerObject(QStringLiteral("previewProxy"), &d->proxy);
156
    channel->registerObject(QStringLiteral("previewProxy"), d->proxy);
157
    this->page()->setWebChannel(channel);
157
    this->page()->setWebChannel(channel);
158
158
159
    QFile wrapperHtmlFile(":/resources/preview.html");
159
    QFile wrapperHtmlFile(":/resources/preview.html");
Lines 240-261 void HtmlPreview::setHtmlExporter(Exporter *exporter) Link Here
240
    
240
    
241
    d->exporter = exporter;
241
    d->exporter = exporter;
242
    d->setHtmlContent("");
242
    d->setHtmlContent("");
243
    d->proxy.setMathEnabled(d->exporter->supportsMath());
243
    d->proxy->setMathEnabled(d->exporter->supportsMath());
244
    updatePreview();
244
    updatePreview();
245
}
245
}
246
246
247
void HtmlPreview::setStyleSheet(const QString &css)
247
void HtmlPreview::setStyleSheet(const QString &css)
248
{
248
{
249
    Q_D(HtmlPreview);
249
    Q_D(HtmlPreview);
250
    
250
251
    d->proxy.setStyleSheet(css);
251
    d->proxy->setStyleSheet(css);
252
}
252
}
253
253
254
void HtmlPreview::setMathEnabled(bool enabled)
254
void HtmlPreview::setMathEnabled(bool enabled)
255
{
255
{
256
    Q_D(HtmlPreview);
256
    Q_D(HtmlPreview);
257
    
257
258
    d->proxy.setMathEnabled(enabled);
258
    d->proxy->setMathEnabled(enabled);
259
}
259
}
260
260
261
void HtmlPreviewPrivate::onHtmlReady()
261
void HtmlPreviewPrivate::onHtmlReady()
Lines 312-318 void HtmlPreview::closeEvent(QCloseEvent *event) Link Here
312
312
313
void HtmlPreviewPrivate::setHtmlContent(const QString &html)
313
void HtmlPreviewPrivate::setHtmlContent(const QString &html)
314
{
314
{
315
    this->proxy.setHtmlContent(html);
315
    this->proxy->setHtmlContent(html);
316
}
316
}
317
317
318
QString HtmlPreviewPrivate::exportToHtml
318
QString HtmlPreviewPrivate::exportToHtml
(-)a/src/settings/appsettings.cpp (-6 / +12 lines)
Lines 65-70 class AppSettingsPrivate Link Here
65
    static AppSettings *instance;
65
    static AppSettings *instance;
66
66
67
    AppSettingsPrivate()
67
    AppSettingsPrivate()
68
        : currentHtmlExporter(nullptr)
68
    {
69
    {
69
        ;
70
        ;
70
    }
71
    }
Lines 677-682 void AppSettings::setShowUnbreakableSpaceEnabled(bool enabled) Link Here
677
    d->showUnbreakableSpaceEnabled = enabled;
678
    d->showUnbreakableSpaceEnabled = enabled;
678
    emit showUnbreakableSpaceEnabledChanged(d->showUnbreakableSpaceEnabled);
679
    emit showUnbreakableSpaceEnabledChanged(d->showUnbreakableSpaceEnabled);
679
}
680
}
681
680
AppSettings::AppSettings()
682
AppSettings::AppSettings()
681
    : d_ptr(new AppSettingsPrivate())
683
    : d_ptr(new AppSettingsPrivate())
682
{
684
{
Lines 843-859 AppSettings::AppSettings() Link Here
843
845
844
    QString exporterName = appSettings.value(constants::GW_LAST_USED_EXPORTER_KEY).toString();
846
    QString exporterName = appSettings.value(constants::GW_LAST_USED_EXPORTER_KEY).toString();
845
847
848
    d->currentHtmlExporter = nullptr;
849
846
    if (!exporterName.isEmpty()) {
850
    if (!exporterName.isEmpty()) {
847
        d->currentHtmlExporter = ExporterFactory::instance()->exporterByName(exporterName);
851
        d->currentHtmlExporter = ExporterFactory::instance()->exporterByName(exporterName);
848
    }
849
852
850
    if (d->currentHtmlExporter) {
853
        if (d->currentHtmlExporter) {
851
        auto lastExportOptions = appSettings.value(constants::GW_LAST_USED_EXPORTER_PARAMS_KEY).toString();
854
            auto lastExportOptions = appSettings.value(constants::GW_LAST_USED_EXPORTER_PARAMS_KEY).toString();
852
855
853
        if (!lastExportOptions.isEmpty()) {
856
            if (!lastExportOptions.isEmpty()) {
854
            d->currentHtmlExporter->setOptions(lastExportOptions);
857
                d->currentHtmlExporter->setOptions(lastExportOptions);
858
            }
855
        }
859
        }
856
    } else {
860
    }
861
862
    if (!d->currentHtmlExporter) {
857
        d->currentHtmlExporter = ExporterFactory::instance()->htmlExporters().first();
863
        d->currentHtmlExporter = ExporterFactory::instance()->htmlExporters().first();
858
    }
864
    }
859
}
865
}

Return to bug 942928