aboutsummaryrefslogtreecommitdiffstats
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorConfuSomu2023-08-03 17:23:33 +0200
committerConfuSomu2023-08-03 17:23:33 +0200
commitbf73a19e11e5cccd22f58a5c97e1346dab5587c8 (patch)
tree64654503131a2eb77c5e9cbf25478330e8ce261b /src/mainwindow.cpp
parent1500681405804b932761db7a0182d498894ad81c (diff)
downloadActorViewer-bf73a19e11e5cccd22f58a5c97e1346dab5587c8.tar
ActorViewer-bf73a19e11e5cccd22f58a5c97e1346dab5587c8.tar.gz
ActorViewer-bf73a19e11e5cccd22f58a5c97e1346dab5587c8.zip
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.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp6
1 files changed, 4 insertions, 2 deletions
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<std::variant<QString, Archive::InitError>> parse_error = QtConcurrent::run(data_archive, &Archive::init);
archive_thread_watcher.setFuture(parse_error);