summaryrefslogtreecommitdiff
path: root/ui/qt/file_set_dialog.cpp
diff options
context:
space:
mode:
authorRoland Knall <roland.knall@br-automation.com>2017-01-11 13:55:23 +0100
committerRoland Knall <rknall@gmail.com>2017-01-12 16:04:00 +0000
commit3df81a055064e2e2c8c9548f1c6837ddef5e5034 (patch)
tree484d3a1e56679668e657ddb29fe6aa6a9d964cdf /ui/qt/file_set_dialog.cpp
parentd6d516888122a26d477dcaa39a52fc9cd8b24479 (diff)
downloadwireshark-3df81a055064e2e2c8c9548f1c6837ddef5e5034.tar.gz
Qt: Remove unneccessary Q_DECLARE_METATYPE
Remove unnecessary Q_DECLARE_METATYPE macros and replace calls to QVariant conversions with VariantPointer where necessary Change-Id: Ia4690590095f930bf94644197de7fa30b00ee7ec Reviewed-on: https://code.wireshark.org/review/19611 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
Diffstat (limited to 'ui/qt/file_set_dialog.cpp')
-rw-r--r--ui/qt/file_set_dialog.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ui/qt/file_set_dialog.cpp b/ui/qt/file_set_dialog.cpp
index f62f8ce8c9..64c79ceae4 100644
--- a/ui/qt/file_set_dialog.cpp
+++ b/ui/qt/file_set_dialog.cpp
@@ -28,6 +28,8 @@
#include "ui/help_url.h"
+#include <ui/qt/variant_pointer.h>
+
#include <wsutil/str_util.h>
#include "file_set_dialog.h"
@@ -42,8 +44,6 @@
#include <QTreeWidgetItem>
#include <QUrl>
-Q_DECLARE_METATYPE(fileset_entry *)
-
/* this file is a part of the current file set, add it to the dialog */
void
fileset_dlg_add_file(fileset_entry *entry, void *window) {
@@ -124,7 +124,7 @@ void FileSetDialog::addFile(fileset_entry *entry) {
entry_item = new QTreeWidgetItem(fs_ui_->fileSetTree);
entry_item->setToolTip(0, QString(tr("Open this capture file")));
- entry_item->setData(0, Qt::UserRole, qVariantFromValue(entry));
+ entry_item->setData(0, Qt::UserRole, VariantPointer<fileset_entry>::asQVariant(entry));
entry_item->setText(0, entry->name);
entry_item->setText(1, created);
@@ -184,7 +184,7 @@ void FileSetDialog::on_fileSetTree_currentItemChanged(QTreeWidgetItem *current,
if (!current)
return;
- entry = current->data(0, Qt::UserRole).value<fileset_entry *>();
+ entry = VariantPointer<fileset_entry>::asPtr(current->data(0, Qt::UserRole));
if (!entry || entry->current)
return;