From 986e76398e67da75d0cb2631a8abd3221afc86e7 Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Tue, 27 Sep 2016 20:11:49 +0900
Subject: [PATCH] Import archive types

---
 src/handlers/xdgurl.cpp | 10 ++++++++++
 src/handlers/xdgurl.h   |  1 +
 2 files changed, 11 insertions(+)

diff --git a/src/handlers/xdgurl.cpp b/src/handlers/xdgurl.cpp
index ad737da..b51ddd3 100644
--- a/src/handlers/xdgurl.cpp
+++ b/src/handlers/xdgurl.cpp
@@ -16,6 +16,7 @@ XdgUrl::XdgUrl(const QString &xdgUrl, Core::Config *appConfig, Core::Config *use
 {
     _meta = _parse();
     _destinations = _importDestinations();
+    _archiveTypes = _importArchiveTypes();
 }
 
 QJsonObject XdgUrl::_parse()
@@ -88,6 +89,15 @@ QJsonObject XdgUrl::_importDestinations()
     return destinations;
 }
 
+QJsonObject XdgUrl::_importArchiveTypes()
+{
+    //QJsonObject archiveTypes;
+    //QJsonObject appConfigArchiveTypes = _appConfig->get("archive_types");
+
+    //return archiveTypes;
+    return _appConfig->get("archive_types");
+}
+
 bool XdgUrl::_installPlasmapkg(const QString &path, const QString &type)
 {
     return true;
diff --git a/src/handlers/xdgurl.h b/src/handlers/xdgurl.h
index 2503b6a..6a94f50 100644
--- a/src/handlers/xdgurl.h
+++ b/src/handlers/xdgurl.h
@@ -33,6 +33,7 @@ public:
 private:
     QJsonObject _parse();
     QJsonObject _importDestinations();
+    QJsonObject _importArchiveTypes();
     bool _installPlasmapkg(const QString &path, const QString &type = "plasmoid");
     bool _uncompressArchive(const QString &path, const QString &targetDir);
     bool _download();
-- 
GitLab