From 93f4ea8838ee93f830785d5a3ff8f9a638106bb8 Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Sat, 13 Oct 2012 01:37:48 +0000 Subject: Always initiailize member variables in constructors, even if it's just to NULL. Use C++'s initializer syntax more. svn path=/trunk/; revision=45519 --- ui/qt/packet_list_record.cpp | 4 ++-- ui/qt/progress_bar.cpp | 2 +- ui/qt/recent_file_status.cpp | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ui/qt/packet_list_record.cpp b/ui/qt/packet_list_record.cpp index 4ee0c78f78..15905104fa 100644 --- a/ui/qt/packet_list_record.cpp +++ b/ui/qt/packet_list_record.cpp @@ -23,9 +23,9 @@ #include "packet_list_record.h" -PacketListRecord::PacketListRecord(frame_data *frameData) +PacketListRecord::PacketListRecord(frame_data *frameData) : + col_text(NULL), col_text_len(NULL), fdata(frameData) { - fdata = frameData; } QVariant PacketListRecord::data(int col_num, column_info *cinfo) const diff --git a/ui/qt/progress_bar.cpp b/ui/qt/progress_bar.cpp index 666a2ce252..bccfbc9434 100644 --- a/ui/qt/progress_bar.cpp +++ b/ui/qt/progress_bar.cpp @@ -111,7 +111,7 @@ destroy_progress_dlg(progdlg_t *dlg) // XXX - We need to show the task and item titles. Maybe as a tooltip or popped // into our sibling status message? ProgressBar::ProgressBar(QWidget *parent) : - QProgressBar(parent) + QProgressBar(parent), m_terminate_is_stop(false), m_stop_flag(NULL) { m_dlg.progressBar = this; m_dlg.topLevelWindow = window(); diff --git a/ui/qt/recent_file_status.cpp b/ui/qt/recent_file_status.cpp index 205c49c7c0..0da8c23340 100644 --- a/ui/qt/recent_file_status.cpp +++ b/ui/qt/recent_file_status.cpp @@ -28,9 +28,8 @@ // Sigh. The Qt 4 documentation says we should subclass QThread here. Other sources // insist that we should subclass QObject, then move it to a newly created QThread. RecentFileStatus::RecentFileStatus(const QString &filename, QObject *parent) : - QObject(parent) + QObject(parent), m_filename(filename), m_size(0) { - m_filename = filename; } void RecentFileStatus::start(void) { -- cgit v1.2.3