diff options
Diffstat (limited to 'src/dbviewer.cpp')
-rw-r--r-- | src/dbviewer.cpp | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/src/dbviewer.cpp b/src/dbviewer.cpp index eb8c1e5..64aec4e 100644 --- a/src/dbviewer.cpp +++ b/src/dbviewer.cpp @@ -32,6 +32,8 @@ #include <kstandarddirs.h> #include <kiconloader.h> +#include <kurl.h> + #define TAR_BLOCKSIZE 512 #define FILEBUFF 8192 @@ -87,16 +89,9 @@ KlamDB::KlamDB( TQWidget* parent, const char* name, bool modal, WFlags fl ) menu = new TQPopupMenu( VirusList ); TQPixmap gicon; - TQPixmap vicon; TQPixmap ticon; - TQString iconPath = locate("cache", KMimeType::favIconForURL("http://www.viruspool.net")+".png"); - if ( iconPath.isEmpty() ) - vicon = SmallIcon("edit-find"); - else - vicon = TQPixmap( iconPath ); - - iconPath = locate("cache", KMimeType::favIconForURL("http://www.google.com")+".png"); + TQString iconPath = locate("cache", KMimeType::favIconForURL("http://www.google.com")+".png"); if ( iconPath.isEmpty() ) gicon = SmallIcon("edit-find"); else @@ -108,11 +103,12 @@ KlamDB::KlamDB( TQWidget* parent, const char* name, bool modal, WFlags fl ) else ticon = TQPixmap( iconPath ); - menu->insertItem(vicon, i18n("Search in VirusList"), this,SLOT(slotVirusList()) ); - menu->insertItem(vicon, i18n("Search in VirusPool"), this,SLOT(slotVirusPool()) ); menu->insertItem(ticon, i18n("Search with Trend Micro"), this,SLOT(slotTrendMicro()) ); menu->insertItem(gicon, i18n("Search with Google"), this,SLOT(slotGoogle()) ); + googlePrefix = TQString::fromAscii("http://www.google.com/search?ie=ISO-8859-1&q="); + tMicroPrefix = TQString::fromAscii("https://www.trendmicro.com/vinfo/us/threat-encyclopedia/search/"); + connect(VirusList, SIGNAL( contextMenuRequested( TQListViewItem *, const TQPoint& , int ) ), this, SLOT( slotRMB( TQListViewItem *, const TQPoint &, int ) ) ); @@ -924,34 +920,17 @@ void KlamDB::slotOpenPrefix(TQString prefix, TQString title,TQString url) page->openURL(prefix+url); } -void KlamDB::slotVirusPool() -{ - TQString url = VirusList->selectedItem()->text(0); - TQString prefix = TQString("http://www.viruspool.net/virus.cms?&name="); - slotOpenPrefix(prefix,"VirusPool",url); -} - -void KlamDB::slotVirusList() -{ - TQString url = VirusList->selectedItem()->text(0); - TQString prefix = TQString("http://www.viruslist.com/en/find?search_mode=virus&words="); - slotOpenPrefix(prefix,"VirusList",url); -} - void KlamDB::slotGoogle() { - - TQString url = VirusList->selectedItem()->text(0); - TQString prefix = TQString("http://www.google.com/search?ie=ISO-8859-1&q="); - slotOpenPrefix(prefix,"Google",url); + TQString url = KURL::encode_string( VirusList->selectedItem()->text(0) ); + slotOpenPrefix(googlePrefix,"Google",url); } void KlamDB::slotTrendMicro() { - TQString url = VirusList->selectedItem()->text(0); - TQString prefix = TQString("https://www.trendmicro.com/vinfo/us/threat-encyclopedia/search/"); - slotOpenPrefix(prefix,"TrendMicro",url); + TQString url = KURL::encode_string( VirusList->selectedItem()->text(0) ); + slotOpenPrefix(tMicroPrefix,"TrendMicro",url); } void KlamDB::slotExternal(TQString name,TQString service) @@ -959,14 +938,10 @@ void KlamDB::slotExternal(TQString name,TQString service) tdemain->showVirusBrowser(); shouldIShow(this); TQString prefix; - if (service == "VirusPool") - prefix = TQString("http://www.viruspool.net/virus.cms?&name="); - else if (service == "Google") - prefix = TQString("http://www.google.com/search?ie=ISO-8859-1&q="); - else if (service == "VirusList") - prefix = TQString("http://www.viruslist.com/en/find?search_mode=virus&words="); + if (service == "Google") + prefix = googlePrefix; else - prefix = TQString("http://www.trendmicro.com/vinfo/virusencyclo/default2.asp?m=q&virus="); + prefix = tMicroPrefix; slotOpenPrefix(prefix,service,name); } |