diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 11:31:17 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-07-24 11:31:17 -0500 |
commit | d598a49a3e1cadea0d72be28d147d219686413e7 (patch) | |
tree | 3111c0383d0b514f59aaeef0a2f656acc595fd8a /src/htmlwidget.cpp | |
parent | 56ffa61b35fc088a0e7e2aa885b9ffed82c8d8be (diff) | |
download | knmap-d598a49a3e1cadea0d72be28d147d219686413e7.tar.gz knmap-d598a49a3e1cadea0d72be28d147d219686413e7.zip |
Convert to TDE R14 API
Diffstat (limited to 'src/htmlwidget.cpp')
-rw-r--r-- | src/htmlwidget.cpp | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/htmlwidget.cpp b/src/htmlwidget.cpp index aea1ff7..4132ba4 100644 --- a/src/htmlwidget.cpp +++ b/src/htmlwidget.cpp @@ -20,15 +20,15 @@ * * ***************************************************************************/ -#include <qfile.h> -#include <qtextstream.h> +#include <ntqfile.h> +#include <ntqtextstream.h> #include <kapplication.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <kdebug.h> #include <khtml_part.h> #include <khtmlview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmessagebox.h> #include <kprocess.h> #include <kstandarddirs.h> @@ -42,8 +42,8 @@ const float HTMLWidget::m_zoomIncrement = 25; // constructor // =========== -HTMLWidget::HTMLWidget( QStringList* stylesheetURLs, QWidget* parent, const char* name ) -: QWidget( parent, name ), +HTMLWidget::HTMLWidget( TQStringList* stylesheetURLs, TQWidget* parent, const char* name ) +: TQWidget( parent, name ), m_dlg( NULL ), m_process( NULL ), m_stylesheetURLs( stylesheetURLs ), @@ -66,7 +66,7 @@ HTMLWidget::~HTMLWidget( ) // gotoAnchor // ========== -void HTMLWidget::gotoAnchor( const QString& anchor ) +void HTMLWidget::gotoAnchor( const TQString& anchor ) { if( !m_htmlPart->gotoAnchor( anchor )) KMessageBox::sorry( this, i18n( "There does not appear to be ANY help available for the item you requested.\nSorry! Now piss off and stop bothering me.\nYou stink.\nYou've got bad breath.\nYour ugly.\nNobody loves you.\nNow for your bad points..." ), i18n( "No help available in Knmap page" )); } @@ -92,16 +92,16 @@ void HTMLWidget::loadKnmapManPage( ) // ================ void HTMLWidget::loadLocalManPage( ) -{ m_process = new KProcess( ); +{ m_process = new TDEProcess( ); *m_process << "man"; *m_process << "-w"; *m_process << "nmap"; - connect( m_process, SIGNAL( processExited( KProcess* )), SLOT( slotManProcessExited( ))); - connect( m_process, SIGNAL( receivedStdout( KProcess*, char*, int )), SLOT( slotManReceivedStdout( KProcess*, char*, int ))); + connect( m_process, SIGNAL( processExited( TDEProcess* )), SLOT( slotManProcessExited( ))); + connect( m_process, SIGNAL( receivedStdout( TDEProcess*, char*, int )), SLOT( slotManReceivedStdout( TDEProcess*, char*, int ))); - m_manPagePath = QString::null; - m_process->start( KProcess::NotifyOnExit, KProcess::Stdout ); + m_manPagePath = TQString::null; + m_process->start( TDEProcess::NotifyOnExit, TDEProcess::Stdout ); } // loadManPage @@ -118,7 +118,7 @@ void HTMLWidget::loadManPage( const bool localManPage ) // ============ void HTMLWidget::readSettings( ) -{ KConfig* config = kapp->config( ); +{ TDEConfig* config = kapp->config( ); config->setGroup( "General" ); m_zoomFactor = config->readDoubleNumEntry( "zoomFactor", 100.0 ); m_stylesheetURL.setPath( config->readPathEntry( "stylesheetURL" )); @@ -127,8 +127,8 @@ void HTMLWidget::readSettings( ) // resizeEvent // =========== -void HTMLWidget::resizeEvent( QResizeEvent* event ) -{ QWidget::resizeEvent( event ); +void HTMLWidget::resizeEvent( TQResizeEvent* event ) +{ TQWidget::resizeEvent( event ); m_htmlPart->view( )->resize( width( ), height( )); } @@ -136,7 +136,7 @@ void HTMLWidget::resizeEvent( QResizeEvent* event ) // ============ void HTMLWidget::saveSettings( ) -{ KConfig* config = kapp->config( ); +{ TDEConfig* config = kapp->config( ); config->setGroup( "General" ); config->writeEntry( "stylesheetURL", m_stylesheetURL.path( )); config->writeEntry( "zoomFactor", m_zoomFactor ); @@ -157,7 +157,7 @@ void HTMLWidget::setStylesheet( ) { m_dlg = new StylesheetDialog( m_stylesheetURL.path( ), *m_stylesheetURLs, this, "man stylesheet dlg" ); connect( m_dlg, SIGNAL( stylesheetRemoved( )), SLOT( slotStylesheetRemoved( ))); - if( m_dlg->exec( ) != QDialog::Accepted ) + if( m_dlg->exec( ) != TQDialog::Accepted ) { delete m_dlg; m_dlg = NULL; return; @@ -185,15 +185,15 @@ void HTMLWidget::slotGunzipProcessExited( ) delete m_process; - m_process = new KProcess( ); + m_process = new TDEProcess( ); *m_process << "man2html"; *m_process << "-"; - connect( m_process, SIGNAL( processExited( KProcess* )), SLOT( slotMan2HTMLProcessExited( ))); - connect( m_process, SIGNAL( receivedStdout( KProcess*, char*, int )), SLOT( slotMan2HTMLReceivedStdout( KProcess*, char*, int ))); + connect( m_process, SIGNAL( processExited( TDEProcess* )), SLOT( slotMan2HTMLProcessExited( ))); + connect( m_process, SIGNAL( receivedStdout( TDEProcess*, char*, int )), SLOT( slotMan2HTMLReceivedStdout( TDEProcess*, char*, int ))); - m_htmlData = QString::null; - m_process->start( KProcess::NotifyOnExit, KProcess::Communication( KProcess::Stdin | KProcess::Stdout )); + m_htmlData = TQString::null; + m_process->start( TDEProcess::NotifyOnExit, TDEProcess::Communication( TDEProcess::Stdin | TDEProcess::Stdout )); m_process->writeStdin( m_manPageData, m_manPageData.length( )); m_process->closeStdin( ); } @@ -201,15 +201,15 @@ void HTMLWidget::slotGunzipProcessExited( ) // slotGunzipReceivedStdout // ======================== -void HTMLWidget::slotGunzipReceivedStdout( KProcess* /* process */, char* buffer, int buflen ) -{ m_manPageData += QString::fromLatin1( buffer, buflen ); +void HTMLWidget::slotGunzipReceivedStdout( TDEProcess* /* process */, char* buffer, int buflen ) +{ m_manPageData += TQString::fromLatin1( buffer, buflen ); } // slotMan2HTMLReceivedStdout // ========================== -void HTMLWidget::slotMan2HTMLReceivedStdout( KProcess* /* process */, char* buffer, int buflen ) -{ m_htmlData += QString::fromLatin1( buffer, buflen ); +void HTMLWidget::slotMan2HTMLReceivedStdout( TDEProcess* /* process */, char* buffer, int buflen ) +{ m_htmlData += TQString::fromLatin1( buffer, buflen ); } // slotMan2HTMLProcessExited @@ -223,24 +223,24 @@ void HTMLWidget::slotMan2HTMLProcessExited( ) m_process = NULL; m_htmlPart->begin( ); - QTextStream textStream( &m_htmlData, IO_ReadOnly ); + TQTextStream textStream( &m_htmlData, IO_ReadOnly ); while( !textStream.atEnd( )) - { QString htmlLine = textStream.readLine( ); + { TQString htmlLine = textStream.readLine( ); if( htmlLine.startsWith( "<H2>TARGET SPECIFICATION</H2>" )) m_htmlPart->write( "<a id='target'>" ); else if( htmlLine.startsWith( "<DT><B>-" )) - { QStringList nmapOptions = QStringList::split( " ", htmlLine.right( htmlLine.length( ) - 7 )); - QString anchors; + { TQStringList nmapOptions = TQStringList::split( " ", htmlLine.right( htmlLine.length( ) - 7 )); + TQString anchors; - for( QStringList::Iterator it = nmapOptions.begin( ); it != nmapOptions.end( ); ++it ) + for( TQStringList::Iterator it = nmapOptions.begin( ); it != nmapOptions.end( ); ++it ) { if( (*it)[ 0 ] != '-' ) break; - QStringList nmapOption = QStringList::split( "<", *it ); - anchors += QString( "<a id='%1'>" ).arg( nmapOption.front( )); + TQStringList nmapOption = TQStringList::split( "<", *it ); + anchors += TQString( "<a id='%1'>" ).arg( nmapOption.front( )); } m_htmlPart->write( anchors ); @@ -279,23 +279,23 @@ void HTMLWidget::slotManProcessExited( ) return; } - m_process = new KProcess( ); + m_process = new TDEProcess( ); *m_process << "gunzip"; *m_process << "-c"; *m_process << m_manPagePath; - connect( m_process, SIGNAL( processExited( KProcess* )), SLOT( slotGunzipProcessExited( ))); - connect( m_process, SIGNAL( receivedStdout( KProcess*, char*, int )), SLOT( slotGunzipReceivedStdout( KProcess*, char*, int ))); + connect( m_process, SIGNAL( processExited( TDEProcess* )), SLOT( slotGunzipProcessExited( ))); + connect( m_process, SIGNAL( receivedStdout( TDEProcess*, char*, int )), SLOT( slotGunzipReceivedStdout( TDEProcess*, char*, int ))); - m_manPageData = QString::null; - m_process->start( KProcess::NotifyOnExit, KProcess::Stdout ); + m_manPageData = TQString::null; + m_process->start( TDEProcess::NotifyOnExit, TDEProcess::Stdout ); } // slotManReceivedStdout // ===================== -void HTMLWidget::slotManReceivedStdout( KProcess* /* process */, char* buffer, int buflen ) -{ m_manPagePath += QString::fromLatin1( buffer, buflen ); +void HTMLWidget::slotManReceivedStdout( TDEProcess* /* process */, char* buffer, int buflen ) +{ m_manPagePath += TQString::fromLatin1( buffer, buflen ); } // slotStylesheetRemoved @@ -312,24 +312,24 @@ void HTMLWidget::slotStylesheetRemoved( ) bool HTMLWidget::tryKnmapFile( ) { #ifdef _DEBUG - QString path = "/home/c/knmap/src/nmap_manpage.html"; + TQString path = "/home/c/knmap/src/nmap_manpage.html"; #else - QString path = locate( "data", "knmap/nmap_manpage.html" ); + TQString path = locate( "data", "knmap/nmap_manpage.html" ); #endif - if( !QFile::exists( path )) + if( !TQFile::exists( path )) return false; - QFile manPageFile( path ); + TQFile manPageFile( path ); if( !manPageFile.open( IO_ReadOnly )) return false; - QTextStream manPageStream( &manPageFile ); + TQTextStream manPageStream( &manPageFile ); m_htmlPart->begin( ); while ( !manPageStream.atEnd( )) - { QString line = manPageStream.read( ); + { TQString line = manPageStream.read( ); m_htmlPart->write( line ); } |