From 64816b38dabe0bb0b2424c45146460122a203715 Mon Sep 17 00:00:00 2001 From: Mavridis Philippe Date: Thu, 14 Jan 2021 19:25:52 +0200 Subject: TabWidget: code cleanup Most of the removed code relates to Akregator and is unused by KlamAV. Signed-off-by: Mavridis Philippe --- src/tabwidget.cpp | 32 +------------------------------- src/tabwidget.h | 2 -- 2 files changed, 1 insertion(+), 33 deletions(-) (limited to 'src') diff --git a/src/tabwidget.cpp b/src/tabwidget.cpp index a001fb2..92bd8aa 100644 --- a/src/tabwidget.cpp +++ b/src/tabwidget.cpp @@ -14,11 +14,8 @@ #include #include #include -#include -#include #include -//#include "akregatorconfig.h" using namespace KlamAV; @@ -152,41 +149,14 @@ void TabWidget::contextMenu(int i, const TQPoint &p) { currentItem = page(i); TDEPopupMenu popup; - //popup.insertTitle(tabLabel(currentItem)); - //int detachTab = popup.insertItem( SmallIcon("tab_breakoff"), i18n("Detach Tab"), this, SLOT( slotDetachTab() ) ); - //int copyLink = popup.insertItem( i18n("Copy Link Address"), this, SLOT( slotCopyLinkAddress() ) ); - //popup.insertSeparator(); + int closeTab = popup.insertItem( SmallIcon("tab_remove"), i18n("Close Tab"), this, SLOT( slotCloseTab() ) ); if(indexOf(currentItem) == 0) { // you can't detach or close articles tab.. - // popup.setItemEnabled(detachTab, false); popup.setItemEnabled(closeTab, false); - //popup.setItemEnabled(copyLink, false); } popup.exec(p); } -void TabWidget::slotDetachTab() -{ - if(!currentItem) return; - KURL url; - if (TDEHTMLView *view = dynamic_cast(currentItem)) url = view->part()->url(); - else return; - kapp->invokeBrowser(url.url(), "0"); - removePage(currentItem); - delete currentItem; - currentItem = 0; -} - -void TabWidget::slotCopyLinkAddress() -{ - if(!currentItem) return; - KURL url; - if (TDEHTMLView *view = dynamic_cast(currentItem)) url = view->part()->url(); - else return; - TQClipboard *cb = TQApplication::clipboard(); - if(cb) cb->setText(url.prettyURL()); -} - void TabWidget::slotCloseTab() { if(!currentItem) return; diff --git a/src/tabwidget.h b/src/tabwidget.h index 37bd4b4..c16a2f8 100644 --- a/src/tabwidget.h +++ b/src/tabwidget.h @@ -42,8 +42,6 @@ class TabWidget:public KTabWidget private slots: - void slotDetachTab(); - void slotCopyLinkAddress(); void slotCloseTab(); void slotCloseRequest(TQWidget* widget); void contextMenu (int item, const TQPoint &p); -- cgit v1.2.1