From bf73a19e11e5cccd22f58a5c97e1346dab5587c8 Mon Sep 17 00:00:00 2001 From: ConfuSomu Date: Thu, 3 Aug 2023 17:23:33 +0200 Subject: Create an Archive base class This class is inherited by MastodonArchive to provide Mastodon (and compatible) archive reading support. A base Archive class allows implementing reading support of other archive formats that are from other services. --- src/mainwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 89f550d..4fc3970 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,6 +1,6 @@ #include "mainwindow.h" #include "./ui_mainwindow.h" -#include "src/archive_parser.h" +#include "src/archive/base_archive.h" #include "src/finddialog.h" #include "src/list_item.h" #include "src/command_line.h" @@ -218,7 +218,9 @@ void MainWindow::open_file(const QString &filename) { open_file_filename = filename; QApplication::setOverrideCursor(Qt::WaitCursor); - data_archive = new Archive(filename, ArchiveType::MASTODON); + + data_archive = Archive::create_archive(ArchiveType::MASTODON, filename); + if (not data_archive) return; QFuture> parse_error = QtConcurrent::run(data_archive, &Archive::init); archive_thread_watcher.setFuture(parse_error); -- cgit v1.2.3-54-g00ecf