1 /* recent_file_status.cpp
3 * Wireshark - Network traffic analyzer
4 * By Gerald Combs <gerald@wireshark.org>
5 * Copyright 1998 Gerald Combs
7 * SPDX-License-Identifier: GPL-2.0-or-later
10 #include "recent_file_status.h"
12 RecentFileStatus::RecentFileStatus(const QString filename
, QObject
*parent
) :
15 filename_(QString::fromStdU16String(filename
.toStdU16String()))
17 // We're a QObject, which means that we emit a destroyed signal,
18 // which might happen at the wrong time when automatic deletion is
19 // enabled. This will trigger an assert in debug builds (bug 14279).
21 // Qt::QueuedConnection creates a copy of our argument list. This
22 // squelches what appears to be a ThreadSanitizer false positive.
23 connect(this, SIGNAL(statusFound(QString
, qint64
, bool)),
24 parent
, SLOT(itemStatusFinished(QString
, qint64
, bool)), Qt::QueuedConnection
);
27 void RecentFileStatus::run() {
28 fileinfo_
.setFile(filename_
);
30 if (fileinfo_
.isFile() && fileinfo_
.isReadable()) {
31 emit
statusFound(filename_
, fileinfo_
.size(), true);
33 emit
statusFound(filename_
, 0, false);