Bundle icons using the Qt resource system.

Simplify resource loading logic and enable reproducible builds.
Fixes #2582
This commit is contained in:
Janek Bevendorff 2020-03-09 01:27:16 +01:00 committed by Jonathan White
parent 4ff781fa48
commit b045160e4f
56 changed files with 630 additions and 548 deletions

View file

@ -24,9 +24,9 @@
#include <QLineEdit>
#include "core/Config.h"
#include "core/FilePath.h"
#include "core/PasswordGenerator.h"
#include "core/PasswordHealth.h"
#include "core/Resources.h"
#include "gui/Application.h"
#include "gui/Clipboard.h"
@ -38,10 +38,10 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent)
{
m_ui->setupUi(this);
m_ui->buttonGenerate->setIcon(filePath()->icon("actions", "refresh"));
m_ui->buttonGenerate->setIcon(resources()->icon("refresh"));
m_ui->buttonGenerate->setToolTip(
tr("Regenerate password (%1)").arg(m_ui->buttonGenerate->shortcut().toString(QKeySequence::NativeText)));
m_ui->buttonCopy->setIcon(filePath()->icon("actions", "clipboard-text"));
m_ui->buttonCopy->setIcon(resources()->icon("clipboard-text"));
m_ui->buttonClose->setShortcut(Qt::Key_Escape);
connect(m_ui->editNewPassword, SIGNAL(textChanged(QString)), SLOT(updateButtonsEnabled(QString)));
@ -85,7 +85,7 @@ PasswordGeneratorWidget::PasswordGeneratorWidget(QWidget* parent)
m_ui->wordCaseComboBox->addItem(tr("UPPER CASE"), PassphraseGenerator::UPPERCASE);
m_ui->wordCaseComboBox->addItem(tr("Title Case"), PassphraseGenerator::TITLECASE);
QDir path(filePath()->wordlistPath(""));
QDir path(resources()->wordlistPath(""));
QStringList files = path.entryList(QDir::Files);
m_ui->comboBoxWordList->addItems(files);
if (files.size() > 1) {
@ -538,7 +538,7 @@ void PasswordGeneratorWidget::updateGenerator()
m_dicewareGenerator->setWordCount(m_ui->spinBoxWordCount->value());
if (!m_ui->comboBoxWordList->currentText().isEmpty()) {
QString path = filePath()->wordlistPath(m_ui->comboBoxWordList->currentText());
QString path = resources()->wordlistPath(m_ui->comboBoxWordList->currentText());
m_dicewareGenerator->setWordList(path);
}
m_dicewareGenerator->setWordSeparator(m_ui->editWordSeparator->text());