Skip to content
This repository was archived by the owner on Dec 25, 2022. It is now read-only.

Commit 2e33ec1

Browse files
committed
Modify action names
The names of the actions added to the link popup were not optimal. Fixed that. Also - I think `reinterpret_cast<>()` is too ... powerfull. We can use `static_cast<>()` or even change the window type properly. Not important now.
1 parent ad191c8 commit 2e33ec1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Tab.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,19 @@ Tab::Tab(QMainWindow* window)
7878
auto global_position = this->mapToGlobal(localPosition);
7979
auto menu = QMenu();
8080

81-
auto action1 = new QAction(tr("Copy Link "));
82-
auto action2 = new QAction(tr("Open link in a new tab"));
81+
auto copyLinkAction = new QAction(tr("Copy Link "));
82+
auto openLinkInTanAction = new QAction(tr("Open link in a new tab"));
8383

84-
menu.addAction(action1);
85-
menu.addAction(action2);
84+
menu.addAction(copyLinkAction);
85+
menu.addAction(openLinkInTanAction);
8686
auto res = menu.exec(global_position);
8787

88-
if (res == action1) {
88+
if (res == copyLinkAction) {
8989
QClipboard *clipboard = QGuiApplication::clipboard();
9090
clipboard->setText(url.toString());
9191
qDebug() << "Copied to clipboard text:" << url.toString();
92-
} else if (res == action2){
93-
auto browser_window = reinterpret_cast<BrowserWindow*>(m_window);
92+
} else if (res == openLinkInTanAction){
93+
auto browser_window = static_cast<BrowserWindow*>(m_window);
9494
return browser_window->new_tab_with_url(url);
9595
}
9696
});

0 commit comments

Comments
 (0)