summaryrefslogtreecommitdiffstats
path: root/src/tabwidget.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2021-01-14 19:25:52 +0200
committerMavridis Philippe <[email protected]>2021-01-14 19:25:52 +0200
commit64816b38dabe0bb0b2424c45146460122a203715 (patch)
tree9db2365e7e468b1fba8cc90939381ee6090c834e /src/tabwidget.cpp
parent677a0585e03bf9728c873ef42b01426a5c87e9f6 (diff)
downloadklamav-64816b38dabe0bb0b2424c45146460122a203715.tar.gz
klamav-64816b38dabe0bb0b2424c45146460122a203715.zip
TabWidget: code cleanup
Most of the removed code relates to Akregator and is unused by KlamAV. Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/tabwidget.cpp')
-rw-r--r--src/tabwidget.cpp32
1 files changed, 1 insertions, 31 deletions
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 <ktabbar.h>
#include <tdepopupmenu.h>
#include <tdelocale.h>
-#include <tdehtmlview.h>
-#include <tdehtml_part.h>
#include <kiconloader.h>
-//#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<TDEHTMLView*>(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<TDEHTMLView*>(currentItem)) url = view->part()->url();
- else return;
- TQClipboard *cb = TQApplication::clipboard();
- if(cb) cb->setText(url.prettyURL());
-}
-
void TabWidget::slotCloseTab()
{
if(!currentItem) return;