Fix compilation on Windows.

The moc man page says "The moc does not expand #include or #define,
it simply skips any preprocessor directives it encounters." This means
our signals and slots have to exist everywhere, even if they're empty
on some platforms.

Remove some duplicate definitions.

svn path=/trunk/; revision=44716
This commit is contained in:
Gerald Combs 2012-08-31 23:13:43 +00:00
parent d6ce6168bb
commit cf4ac2931e
4 changed files with 21 additions and 21 deletions

View File

@ -30,6 +30,8 @@
#include "ui/recent.h"
#include "ui/recent_utils.h"
#include "capture_opts.h"
#include <epan/prefs.h>
#include <QHash>

View File

@ -239,12 +239,12 @@ void MainWindow::setPipeInputHandler(gint source, gpointer user_data, int *child
/*g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_input_set_handler: new");*/
if (pipe_timer_) {
disconnect(pipe_timer_, SIGNAL(timeout)), this, SLOT(pipeTimeout)));
disconnect(pipe_timer_, SIGNAL(timeout), this, SLOT(pipeTimeout));
delete pipe_timer_;
}
pipe_timer_ = new QTimer(this);
connect(pipe_timer_, SIGNAL(timeout)), this, SLOT(pipeTimeout)));
connect(pipe_timer_, SIGNAL(timeout), this, SLOT(pipeTimeout));
pipe_timer_->start(200);
#else
if (pipe_notifier_) {
@ -849,13 +849,12 @@ void MainWindow::startCapture() {
}
// Copied from ui/gtk/gui_utils.c
#ifdef _WIN32
void MainWindow::pipeTimeout() {
#ifdef _WIN32
HANDLE handle;
DWORD avail = 0;
gboolean result, result1;
DWORD childstatus;
pipe_input_t *pipe_input = data;
gint iterations = 0;
@ -884,7 +883,6 @@ void MainWindow::pipeTimeout() {
if (!pipe_input_cb_(pipe_source_, pipe_user_data_)) {
g_log(NULL, G_LOG_LEVEL_DEBUG, "pipe_timer_cb: input pipe closed, iterations: %u", iterations);
/* pipe closed, return false so that the old timer is not run again */
return FALSE;
}
}
else {
@ -895,9 +893,11 @@ void MainWindow::pipeTimeout() {
iterations++;
}
#endif // _WIN32
}
#else
void MainWindow::pipeActivated(int source) {
#ifndef _WIN32
g_assert(source == pipe_source_);
pipe_notifier_->setEnabled(false);
@ -906,14 +906,15 @@ void MainWindow::pipeActivated(int source) {
} else {
delete pipe_notifier_;
}
#endif // _WIN32
}
void MainWindow::pipeNotifierDestroyed() {
#ifndef _WIN32
pipe_notifier_ = NULL;
#endif // _WIN32
}
#endif
void MainWindow::stopCapture() {
//#ifdef HAVE_AIRPCAP
// if (airpcap_if_active)

View File

@ -128,12 +128,9 @@ public slots:
private slots:
void startCapture();
#ifdef _WIN32
void pipeTimeout();
#else
void pipeActivated(int source);
void pipeNotifierDestroyed();
#endif
void stopCapture();
void updateRecentFiles();

View File

@ -42,17 +42,17 @@ extern "C" {
#define RECENT_KEY_CAPTURE_FILE "recent.capture_file"
#define RECENT_KEY_REMOTE_HOST "recent.remote_host"
/* Type of capture source */
typedef enum {
CAPTURE_IFLOCAL, /**< Local network interface */
CAPTURE_IFREMOTE /**< Remote network interface */
} capture_source;
///* Type of capture source */
//typedef enum {
// CAPTURE_IFLOCAL, /**< Local network interface */
// CAPTURE_IFREMOTE /**< Remote network interface */
//} capture_source;
/* Type of RPCAPD Authentication */
typedef enum {
CAPTURE_AUTH_NULL, /**< No authentication */
CAPTURE_AUTH_PWD /**< User/password authentication */
} capture_auth;
///* Type of RPCAPD Authentication */
//typedef enum {
// CAPTURE_AUTH_NULL, /**< No authentication */
// CAPTURE_AUTH_PWD /**< User/password authentication */
//} capture_auth;
struct remote_host_t {
gchar *remote_host; /**< Host name or network address for remote capturing */