Merge pull request #1322 from phoerious/feature/teamcity-ci

Add TeamCity integration
This commit is contained in:
Janek Bevendorff 2017-12-26 13:05:14 +01:00 committed by GitHub
commit d571f22ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 67 additions and 6 deletions

38
ci/trusty/Dockerfile Normal file
View File

@ -0,0 +1,38 @@
# KeePassXC Linux Release Build Dockerfile
# Copyright (C) 2017 KeePassXC team <https://keepassxc.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 or (at your option)
# version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# TIP: check this Dockerfile using this online tool: https://www.fromlatest.io
FROM ubuntu:trusty
RUN set -x \
&& apt-get -y update \
&& apt-get -y --no-install-recommends install \
git build-essential clang-3.6 libclang-common-3.6-dev clang-format-3.6 cmake3 make \
curl ca-certificates gnupg2 \
libgcrypt20-dev zlib1g-dev libyubikey-dev libykpers-1-dev \
qttools5-dev \
qttools5-dev-tools \
qtbase5-dev \
libqt5x11extras5-dev \
libxi-dev \
libxtst-dev \
xvfb \
&& apt-get autoremove --purge \
&& rm -rf /var/lib/apt/lists/*
VOLUME ["/keepassxc"]
WORKDIR /keepassxc

View File

@ -285,7 +285,7 @@ void EditEntryWidget::setupSSHAgent()
void EditEntryWidget::updateSSHAgent()
{
KeeAgentSettings settings;
settings.fromXml(m_entryAttachments->value("KeeAgent.settings"));
settings.fromXml(m_advancedUi->attachmentsWidget->getAttachment("KeeAgent.settings"));
m_sshAgentUi->addKeyToAgentCheckBox->setChecked(settings.addAtDatabaseOpen());
m_sshAgentUi->removeKeyFromAgentCheckBox->setChecked(settings.removeAtDatabaseClose());
@ -299,7 +299,8 @@ void EditEntryWidget::updateSSHAgent()
m_sshAgentUi->attachmentComboBox->addItem("");
for (QString fileName : m_entryAttachments->keys()) {
auto attachments = m_advancedUi->attachmentsWidget->entryAttachments();
for (const QString& fileName : attachments->keys()) {
if (fileName == "KeeAgent.settings") {
continue;
}
@ -382,10 +383,10 @@ void EditEntryWidget::saveSSHAgentConfig()
// we don't use this either but we don't want it to dirty flag the config
settings.setSaveAttachmentToTempFile(m_sshAgentSettings.saveAttachmentToTempFile());
if (settings.isDefault() && m_entryAttachments->hasKey("KeeAgent.settings")) {
m_entryAttachments->remove("KeeAgent.settings");
if (settings.isDefault()) {
m_advancedUi->attachmentsWidget->removeAttachment("KeeAgent.settings");
} else if (settings != m_sshAgentSettings) {
m_entryAttachments->set("KeeAgent.settings", settings.toXml());
m_advancedUi->attachmentsWidget->setAttachment("KeeAgent.settings", settings.toXml());
}
m_sshAgentSettings = settings;
@ -404,7 +405,7 @@ bool EditEntryWidget::getOpenSSHKey(OpenSSHKey& key)
QByteArray privateKeyData;
if (m_sshAgentUi->attachmentRadioButton->isChecked()) {
privateKeyData = m_entryAttachments->value(m_sshAgentUi->attachmentComboBox->currentText());
privateKeyData = m_advancedUi->attachmentsWidget->getAttachment(m_sshAgentUi->attachmentComboBox->currentText());
} else {
QFile localFile(m_sshAgentUi->externalFileEdit->text());

View File

@ -106,6 +106,23 @@ void EntryAttachmentsWidget::setButtonsVisible(bool buttonsVisible)
emit buttonsVisibleChanged(m_buttonsVisible);
}
QByteArray EntryAttachmentsWidget::getAttachment(const QString &name)
{
return m_entryAttachments->value(name);
}
void EntryAttachmentsWidget::setAttachment(const QString &name, const QByteArray &value)
{
m_entryAttachments->set(name, value);
}
void EntryAttachmentsWidget::removeAttachment(const QString &name)
{
if (!isReadOnly() && m_entryAttachments->hasKey(name)) {
m_entryAttachments->remove(name);
}
}
void EntryAttachmentsWidget::insertAttachments()
{
Q_ASSERT(!isReadOnly());

View File

@ -8,6 +8,7 @@ namespace Ui {
class EntryAttachmentsWidget;
}
class QByteArray;
class EntryAttachments;
class EntryAttachmentsModel;
@ -24,6 +25,10 @@ public:
bool isReadOnly() const;
bool isButtonsVisible() const;
QByteArray getAttachment(const QString& name);
void setAttachment(const QString& name, const QByteArray& value);
void removeAttachment(const QString& name);
public slots:
void setEntryAttachments(const EntryAttachments* attachments);
void clearAttachments();