author | mickeyl <mickeyl> | 2004-04-23 14:43:53 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-23 14:43:53 (UTC) |
commit | d8a8c7bf9559dd1ad6a72c9e5582d72a176c97f6 (patch) (side-by-side diff) | |
tree | 1a069ffb791230709e5be8ce230afb6e8d510af9 /libopie2/opienet/opcap.cpp | |
parent | 8e32516bbda3fda10314f2afe4ee00eb9a49c013 (diff) | |
download | opie-d8a8c7bf9559dd1ad6a72c9e5582d72a176c97f6.zip opie-d8a8c7bf9559dd1ad6a72c9e5582d72a176c97f6.tar.gz opie-d8a8c7bf9559dd1ad6a72c9e5582d72a176c97f6.tar.bz2 |
disambiguate the API (triggered by gcc 3.4 ;)
-rw-r--r-- | libopie2/opienet/opcap.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp index 067d6b7..f8ebe6b 100644 --- a/libopie2/opienet/opcap.cpp +++ b/libopie2/opienet/opcap.cpp @@ -1254,68 +1254,66 @@ bool OPacketCapturer::open( const QString& name ) odebug << "OPacketCapturer::open(): libpcap [" << name << "] opened successfully." << oendl; _pch = handle; _open = true; _stats.clear(); // in case we have an application object, create a socket notifier if ( qApp ) //TODO: I don't like this here... { _sn = new QSocketNotifier( fileno(), QSocketNotifier::Read ); connect( _sn, SIGNAL( activated(int) ), this, SLOT( readyToReceive() ) ); } return true; } bool OPacketCapturer::openDumpFile( const QString& filename ) { pcap_dumper_t* dump = pcap_dump_open( _pch, const_cast<char*>( (const char*) filename ) ); if ( !dump ) { owarn << "OPacketCapturer::open(): can't open dump with '" << filename << "': " << _errbuf << oendl; return false; } odebug << "OPacketCapturer::open(): dump [" << filename << "] opened successfully." << oendl; _pcd = dump; return true; } -bool OPacketCapturer::open( const QFile& file ) +bool OPacketCapturer::openCaptureFile( const QString& name ) { - QString name = file.name(); - if ( _open ) { close(); if ( name == _name ) // ignore opening an already openend device { return true; } else // close the last opened device { close(); } } _name = name; pcap_t* handle = pcap_open_offline( const_cast<char*>( (const char*) name ), &_errbuf[0] ); if ( handle ) { odebug << "OPacketCapturer::open(): libpcap opened successfully." << oendl; _pch = handle; _open = true; // in case we have an application object, create a socket notifier if ( qApp ) { _sn = new QSocketNotifier( fileno(), QSocketNotifier::Read ); connect( _sn, SIGNAL( activated(int) ), this, SLOT( readyToReceive() ) ); } return true; } |