~mterry/+junk/u8

« back to all changes in this revision

Viewing changes to plugins/Wizard/PageList.cpp

Merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2014 Canonical Ltd.
 
2
 * Copyright (C) 2014-2016 Canonical Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it
5
5
 * under the terms of the GNU General Public License version 3, as published
34
34
#include <QDir>
35
35
#include <QSet>
36
36
#include <QStandardPaths>
 
37
#include <QSettings>
37
38
 
38
39
PageList::PageList(QObject *parent)
39
40
    : QObject(parent),
66
67
    Q_FOREACH(const QString &page, disabledPages) {
67
68
        m_pages.remove(page);
68
69
    }
 
70
 
 
71
    // If there was a system update installed, skip until the last page to just greet the user
 
72
    QSettings settings;
 
73
    if (settings.value(QStringLiteral("Wizard/SkipUntilFinishedPage")).toBool()) {
 
74
        const QString lastPage = m_pages.lastKey();
 
75
        Q_FOREACH(const QString &page, m_pages.keys()) {
 
76
            if (Q_UNLIKELY(page != lastPage)) {
 
77
                m_pages.remove(page);
 
78
            }
 
79
        }
 
80
 
 
81
        // ... and reset it again for the next run
 
82
        settings.remove(QStringLiteral("Wizard/SkipUntilFinishedPage"));
 
83
    }
69
84
}
70
85
 
71
86
QStringList PageList::entries() const