From 8aa3b74f80fd321539e828cd106efba44926e5f6 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 18 Aug 2019 12:55:56 +0200 Subject: [PATCH] LibCore: Make it possible to pass a parent to CFile constructors --- Libraries/LibCore/CFile.cpp | 5 +++-- Libraries/LibCore/CFile.h | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Libraries/LibCore/CFile.cpp b/Libraries/LibCore/CFile.cpp index 09d209d4b44..38b5b75a0cd 100644 --- a/Libraries/LibCore/CFile.cpp +++ b/Libraries/LibCore/CFile.cpp @@ -4,8 +4,9 @@ #include #include -CFile::CFile(const StringView& filename) - : m_filename(filename) +CFile::CFile(const StringView& filename, CObject* parent) + : CIODevice(parent) + , m_filename(filename) { } diff --git a/Libraries/LibCore/CFile.h b/Libraries/LibCore/CFile.h index cabf7abb14b..491aa16c942 100644 --- a/Libraries/LibCore/CFile.h +++ b/Libraries/LibCore/CFile.h @@ -6,8 +6,11 @@ class CFile final : public CIODevice { C_OBJECT(CFile) public: - CFile() {} - explicit CFile(const StringView&); + CFile(CObject* parent = nullptr) + : CIODevice(parent) + { + } + explicit CFile(const StringView&, CObject* parent = nullptr); virtual ~CFile() override; String filename() const { return m_filename; }