aboutsummaryrefslogtreecommitdiff
path: root/lib/session_formats
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-05-26 22:23:25 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2020-05-28 19:43:45 +0300
commit9c4dd932c6d692178bb8d5265c634126cb415767 (patch)
tree527300f8e710859965c142aed4e779a16b9d4ab6 /lib/session_formats
parentUpdate ProfileEditor plugin (diff)
downloadsmolbote-9c4dd932c6d692178bb8d5265c634126cb415767.tar.xz
Turn on more warnings by default
- fix clazy warnings - fix various other compiler warnings - bugfix: connect profiles' downloadRequested signal
Diffstat (limited to 'lib/session_formats')
-rw-r--r--lib/session_formats/session_json.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/session_formats/session_json.cpp b/lib/session_formats/session_json.cpp
index eca96f2..96319ac 100644
--- a/lib/session_formats/session_json.cpp
+++ b/lib/session_formats/session_json.cpp
@@ -10,7 +10,7 @@
#include <QJsonArray>
#include <QJsonDocument>
-[[nodiscard]] QVector<Session::MainWindow> toWindowList(const QString &profile, const QStringList &urls)
+[[nodiscard]] inline QVector<Session::MainWindow> toWindowList(const QString &profile, const QStringList &urls)
{
Session::SubWindow main_;
main_.profile = profile;
@@ -22,7 +22,7 @@
return { main };
}
-[[nodiscard]] QJsonObject toJson(const QVector<Session::MainWindow> &windows)
+[[nodiscard]] inline QJsonObject toJson(const QVector<Session::MainWindow> &windows)
{
QJsonObject root;
QJsonArray windows_;
@@ -76,12 +76,18 @@ QByteArray JsonSession::serialize() const
QVector<Session::MainWindow> JsonSession::get() const
{
QVector<Session::MainWindow> windows;
- for(const auto &windowData : root["windows"].toArray()) {
+ const auto root_array = root["windows"].toArray();
+ for(const auto &windowData : root_array) {
Session::MainWindow window;
- for(const auto &subwindowData : windowData.toObject()["subwindows"].toArray()) {
+
+ const auto subwindows_array = windowData.toObject()["subwindows"].toArray();
+ for(const auto &subwindowData : subwindows_array) {
Session::SubWindow subwindow;
+
subwindow.profile = subwindowData.toObject()["profile"].toString();
- for(const auto &tabData : subwindowData.toObject()["tabs"].toArray()) {
+
+ const auto tabs_array = subwindowData.toObject()["tabs"].toArray();
+ for(const auto &tabData : tabs_array) {
Session::WebView tab{
tabData.toObject()["profile"].toString(),
tabData.toObject()["url"].toString(),