From 0e41ed72dde09fe6ab57cedccc8e961180629d60 Mon Sep 17 00:00:00 2001 From: Felix Geyer Date: Sun, 13 Nov 2011 14:54:11 +0100 Subject: [PATCH] Emit signal when changing the database name. --- src/core/Metadata.cpp | 3 +++ src/core/Metadata.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/core/Metadata.cpp b/src/core/Metadata.cpp index 1e34d6143..3abb4f138 100644 --- a/src/core/Metadata.cpp +++ b/src/core/Metadata.cpp @@ -21,6 +21,7 @@ Metadata::Metadata(Database* parent) : QObject(parent) + , m_parent(parent) { m_recycleBin = 0; m_entryTemplatesGroup = 0; @@ -191,6 +192,8 @@ void Metadata::setGenerator(const QString& value) void Metadata::setName(const QString& value) { m_name = value; + + Q_EMIT nameTextChanged(m_parent); } void Metadata::setNameChanged(const QDateTime& value) diff --git a/src/core/Metadata.h b/src/core/Metadata.h index 39faed157..2aa70da36 100644 --- a/src/core/Metadata.h +++ b/src/core/Metadata.h @@ -91,7 +91,12 @@ public: void addCustomField(const QString& key, const QString& value); void removeCustomField(const QString& key); +Q_SIGNALS: + void nameTextChanged(Database* db); + private: + Database* m_parent; + QString m_generator; QString m_name; QDateTime m_nameChanged;