diff options
author | Saturneric <[email protected]> | 2022-01-23 08:35:59 +0000 |
---|---|---|
committer | Saturneric <[email protected]> | 2022-01-23 08:35:59 +0000 |
commit | a7fb788cd0379bc3f49d5c0fdb0cbdf2b8401f7b (patch) | |
tree | 3299c2bcbddc0eb1fa0b9bb3ae002e5ac856180c /src/ui/widgets/HelpPage.cpp | |
parent | <refactor>(ui): tidy up codes and comments. (diff) | |
download | GpgFrontend-a7fb788cd0379bc3f49d5c0fdb0cbdf2b8401f7b.tar.gz GpgFrontend-a7fb788cd0379bc3f49d5c0fdb0cbdf2b8401f7b.zip |
<refactor>(ui): tidy up codes and comments.
1. tidy up widgets.
Diffstat (limited to 'src/ui/widgets/HelpPage.cpp')
-rw-r--r-- | src/ui/widgets/HelpPage.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/ui/widgets/HelpPage.cpp b/src/ui/widgets/HelpPage.cpp index 0bb54890..04bf609c 100644 --- a/src/ui/widgets/HelpPage.cpp +++ b/src/ui/widgets/HelpPage.cpp @@ -33,32 +33,33 @@ namespace GpgFrontend::UI { HelpPage::HelpPage(const QString& path, QWidget* parent) : QWidget(parent) { - browser = new QTextBrowser(); + browser_ = new QTextBrowser(); auto* mainLayout = new QVBoxLayout(); mainLayout->setSpacing(0); - mainLayout->addWidget(browser); + mainLayout->addWidget(browser_); mainLayout->setContentsMargins(0, 0, 0, 0); setLayout(mainLayout); - connect(browser, SIGNAL(anchorClicked(QUrl)), this, SLOT(slotOpenUrl(QUrl))); - browser->setOpenLinks(false); - browser->setSource(localizedHelp(QUrl(path))); - browser->setFocus(); + connect(browser_, SIGNAL(anchorClicked(QUrl)), this, + SLOT(slot_open_url(QUrl))); + browser_->setOpenLinks(false); + browser_->setSource(localized_help(QUrl(path))); + browser_->setFocus(); } -void HelpPage::slotOpenUrl(const QUrl& url) { - browser->setSource(localizedHelp(url)); +void HelpPage::slot_open_url(const QUrl& url) { + browser_->setSource(localized_help(url)); }; /** - * @brief HelpPage::localizedHelp + * @brief HelpPage::localized_help * check if the requested file is also available with the locale, * e.g. return index.de.html if index.html was requested but the * locale is de and index.de.html is available * @param url * @return */ -QUrl HelpPage::localizedHelp(const QUrl& url) { +QUrl HelpPage::localized_help(const QUrl& url) { QString path = url.toLocalFile(); QString filename = path.mid(path.lastIndexOf("/") + 1); QString filepath = path.left(path.lastIndexOf("/") + 1); @@ -81,6 +82,6 @@ QUrl HelpPage::localizedHelp(const QUrl& url) { } } -QTextBrowser* HelpPage::getBrowser() { return browser; } +QTextBrowser* HelpPage::GetBrowser() { return browser_; } } // namespace GpgFrontend::UI |