diff options
| author | Felix (xq) Queißner <git@mq32.de> | 2021-03-06 20:26:21 +0100 |
|---|---|---|
| committer | Felix (xq) Queißner <git@mq32.de> | 2021-03-06 20:29:50 +0100 |
| commit | 0396fdb01d12e51bd2cc63478819b366c0453d29 (patch) | |
| tree | 082fcd53b7b61c0dc2a0dc6b676729e155c07fd2 /src/widgets | |
| parent | 21c821c49ef82d1e84b0b9c8c3d357dc559479d4 (diff) | |
| download | kristall-0396fdb01d12e51bd2cc63478819b366c0453d29.tar.gz | |
Moves all globals into a structure that can be deleted before the app exists. Fixes #193.
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/browsertabbar.cpp | 4 | ||||
| -rw-r--r-- | src/widgets/kristalltextbrowser.cpp | 5 | ||||
| -rw-r--r-- | src/widgets/searchbar.cpp | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/widgets/browsertabbar.cpp b/src/widgets/browsertabbar.cpp index 541ee96..4faaf67 100644 --- a/src/widgets/browsertabbar.cpp +++ b/src/widgets/browsertabbar.cpp @@ -13,7 +13,7 @@ BrowserTabBar::BrowserTabBar(QWidget *parent) : new_tab_btn = new QPushButton("+", this); new_tab_btn->setFixedSize(NEWTAB_BTN_SIZE, NEWTAB_BTN_SIZE); connect(new_tab_btn, &QPushButton::clicked, this, &BrowserTabBar::on_newTabClicked); - this->new_tab_btn->setVisible(kristall::options.enable_newtab_btn); + this->new_tab_btn->setVisible(kristall::globals().options.enable_newtab_btn); } void BrowserTabBar::mouseReleaseEvent(QMouseEvent *event) @@ -27,7 +27,7 @@ void BrowserTabBar::mouseReleaseEvent(QMouseEvent *event) void BrowserTabBar::moveNewTabButton() { - if (!kristall::options.enable_newtab_btn) + if (!kristall::globals().options.enable_newtab_btn) { return; } diff --git a/src/widgets/kristalltextbrowser.cpp b/src/widgets/kristalltextbrowser.cpp index 67e7976..5f34c10 100644 --- a/src/widgets/kristalltextbrowser.cpp +++ b/src/widgets/kristalltextbrowser.cpp @@ -7,6 +7,7 @@ #include <QTouchDevice> #include <QRegularExpression> #include <QLineEdit> +#include <QApplication> const Qt::CursorShape KristallTextBrowser::NORMAL_CURSOR = Qt::IBeamCursor; @@ -133,7 +134,7 @@ void KristallTextBrowser::betterCopy() if (text.contains(REGEX_ONLY_QUOTES)) { // Copy the original text. - kristall::clipboard->setText(text); + qApp->clipboard()->setText(text); return; } @@ -151,5 +152,5 @@ void KristallTextBrowser::betterCopy() text.replace(QChar(0x2029), "\n"); #endif - kristall::clipboard->setText(text); + qApp->clipboard()->setText(text); } diff --git a/src/widgets/searchbar.cpp b/src/widgets/searchbar.cpp index d157912..24705f9 100644 --- a/src/widgets/searchbar.cpp +++ b/src/widgets/searchbar.cpp @@ -7,7 +7,7 @@ SearchBar::SearchBar(QWidget *parent) : QLineEdit(parent) { QCompleter *completer = new QCompleter(this); - completer->setModel(&kristall::favourites); + completer->setModel(&kristall::globals().favourites); completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setCompletionRole(Qt::DisplayRole); this->setCompleter(completer); |
