@ -32,6 +32,8 @@
# include <kstandarddirs.h>
# include <kstandarddirs.h>
# include <kiconloader.h>
# include <kiconloader.h>
# include <kurl.h>
# define TAR_BLOCKSIZE 512
# define TAR_BLOCKSIZE 512
# define FILEBUFF 8192
# define FILEBUFF 8192
@ -87,16 +89,9 @@ KlamDB::KlamDB( TQWidget* parent, const char* name, bool modal, WFlags fl )
menu = new TQPopupMenu ( VirusList ) ;
menu = new TQPopupMenu ( VirusList ) ;
TQPixmap gicon ;
TQPixmap gicon ;
TQPixmap vicon ;
TQPixmap ticon ;
TQPixmap ticon ;
TQString iconPath = locate ( " cache " , KMimeType : : favIconForURL ( " http://www.viruspool.net " ) + " .png " ) ;
TQString iconPath = locate ( " cache " , KMimeType : : favIconForURL ( " http://www.google.com " ) + " .png " ) ;
if ( iconPath . isEmpty ( ) )
vicon = SmallIcon ( " edit-find " ) ;
else
vicon = TQPixmap ( iconPath ) ;
iconPath = locate ( " cache " , KMimeType : : favIconForURL ( " http://www.google.com " ) + " .png " ) ;
if ( iconPath . isEmpty ( ) )
if ( iconPath . isEmpty ( ) )
gicon = SmallIcon ( " edit-find " ) ;
gicon = SmallIcon ( " edit-find " ) ;
else
else
@ -108,11 +103,12 @@ KlamDB::KlamDB( TQWidget* parent, const char* name, bool modal, WFlags fl )
else
else
ticon = TQPixmap ( iconPath ) ;
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 ( ticon , i18n ( " Search with Trend Micro " ) , this , SLOT ( slotTrendMicro ( ) ) ) ;
menu - > insertItem ( gicon , i18n ( " Search with Google " ) , this , SLOT ( slotGoogle ( ) ) ) ;
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 ) ) ,
connect ( VirusList , SIGNAL ( contextMenuRequested ( TQListViewItem * , const TQPoint & , int ) ) ,
this , SLOT ( slotRMB ( 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 ) ;
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 ( )
void KlamDB : : slotGoogle ( )
{
{
TQString url = KURL : : encode_string ( VirusList - > selectedItem ( ) - > text ( 0 ) ) ;
TQString url = VirusList - > selectedItem ( ) - > text ( 0 ) ;
slotOpenPrefix ( googlePrefix , " Google " , url ) ;
TQString prefix = TQString ( " http://www.google.com/search?ie=ISO-8859-1&q= " ) ;
slotOpenPrefix ( prefix , " Google " , url ) ;
}
}
void KlamDB : : slotTrendMicro ( )
void KlamDB : : slotTrendMicro ( )
{
{
TQString url = VirusList - > selectedItem ( ) - > text ( 0 ) ;
TQString url = KURL : : encode_string ( VirusList - > selectedItem ( ) - > text ( 0 ) ) ;
TQString prefix = TQString ( " https://www.trendmicro.com/vinfo/us/threat-encyclopedia/search/ " ) ;
slotOpenPrefix ( tMicroPrefix , " TrendMicro " , url ) ;
slotOpenPrefix ( prefix , " TrendMicro " , url ) ;
}
}
void KlamDB : : slotExternal ( TQString name , TQString service )
void KlamDB : : slotExternal ( TQString name , TQString service )
@ -959,14 +938,10 @@ void KlamDB::slotExternal(TQString name,TQString service)
tdemain - > showVirusBrowser ( ) ;
tdemain - > showVirusBrowser ( ) ;
shouldIShow ( this ) ;
shouldIShow ( this ) ;
TQString prefix ;
TQString prefix ;
if ( service = = " VirusPool " )
if ( service = = " Google " )
prefix = TQString ( " http://www.viruspool.net/virus.cms?&name= " ) ;
prefix = googlePrefix ;
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= " ) ;
else
else
prefix = TQString( " http://www.trendmicro.com/vinfo/virusencyclo/default2.asp?m=q&virus= " ) ;
prefix = tMicroPrefix ;
slotOpenPrefix ( prefix , service , name ) ;
slotOpenPrefix ( prefix , service , name ) ;
}
}