TabWidget: code cleanup

Most of the removed code relates to Akregator and is unused by KlamAV.

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/24/head
Mavridis Philippe 3 years ago
parent 677a0585e0
commit 64816b38da
No known key found for this signature in database
GPG Key ID: F8D2D7E2F989A494

@ -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;

@ -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);

Loading…
Cancel
Save