[libraries/ktextaddons] textautogeneratetext/core: Add enable/description

Laurent Montel <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit fe5134ed6c52f8e70dcbcc7eede12217da4606d4 by Laurent Montel.
Committed on 23/07/2026 at 06:28.
Pushed by mlaurent into branch 'master'.

Add enable/description

M  +2    -0    textautogeneratetext/core/autotests/textautogenerateprompttest.cpp
M  +22   -0    textautogeneratetext/core/prompts/textautogenerateprompt.cpp
M  +16   -0    textautogeneratetext/core/prompts/textautogenerateprompt.h

https://invent.kde.org/libraries/ktextaddons/-/commit/fe5134ed6c52f8e70dcbcc7eede12217da4606d4

diff --git a/textautogeneratetext/core/autotests/textautogenerateprompttest.cpp b/textautogeneratetext/core/autotests/textautogenerateprompttest.cpp
index 2e3f686b3..0e924d140 100644
--- a/textautogeneratetext/core/autotests/textautogenerateprompttest.cpp
+++ b/textautogeneratetext/core/autotests/textautogenerateprompttest.cpp
@@ -18,6 +18,8 @@ void TextAutoGeneratePromptTest::shouldHaveDefaultValues()
     const TextAutoGenerateText::TextAutoGeneratePrompt prompt;
     QVERIFY(prompt.name().isEmpty());
     QVERIFY(prompt.text().isEmpty());
+    QVERIFY(prompt.description().isEmpty());
+    QVERIFY(prompt.enabled());
 }
 
 #include "moc_textautogenerateprompttest.cpp"
diff --git a/textautogeneratetext/core/prompts/textautogenerateprompt.cpp b/textautogeneratetext/core/prompts/textautogenerateprompt.cpp
index 6bfc26102..d4abf0032 100644
--- a/textautogeneratetext/core/prompts/textautogenerateprompt.cpp
+++ b/textautogeneratetext/core/prompts/textautogenerateprompt.cpp
@@ -30,9 +30,31 @@ void TextAutoGeneratePrompt::setText(const QString &newText)
     mText = newText;
 }
 
+QString TextAutoGeneratePrompt::description() const
+{
+    return mDescription;
+}
+
+void TextAutoGeneratePrompt::setDescription(const QString &newDescription)
+{
+    mDescription = newDescription;
+}
+
+bool TextAutoGeneratePrompt::enabled() const
+{
+    return mEnabled;
+}
+
+void TextAutoGeneratePrompt::setEnabled(bool newEnabled)
+{
+    mEnabled = newEnabled;
+}
+
 QDebug operator<<(QDebug d, const TextAutoGenerateText::TextAutoGeneratePrompt &t)
 {
     d.space() << "name:" << t.name();
     d.space() << "text" << t.text();
+    d.space() << "description:" << t.description();
+    d.space() << "enabled:" << t.enabled();
     return d;
 }
diff --git a/textautogeneratetext/core/prompts/textautogenerateprompt.h b/textautogeneratetext/core/prompts/textautogenerateprompt.h
index 17fb80b86..1df73a49f 100644
--- a/textautogeneratetext/core/prompts/textautogenerateprompt.h
+++ b/textautogeneratetext/core/prompts/textautogenerateprompt.h
@@ -43,9 +43,25 @@ public:
      */
     void setText(const QString &newText);
 
+    /*!
+     */
+    [[nodiscard]] QString description() const;
+    /*!
+     */
+    void setDescription(const QString &newDescription);
+
+    /*!
+     */
+    [[nodiscard]] bool enabled() const;
+    /*!
+     */
+    void setEnabled(bool newEnabled);
+
 private:
     QString mName;
     QString mText;
+    QString mDescription;
+    bool mEnabled = true;
 };
 }
 Q_DECLARE_TYPEINFO(TextAutoGenerateText::TextAutoGeneratePrompt, Q_RELOCATABLE_TYPE);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.