[libraries/ktextaddons] textautogeneratetext/core: Add identifier here too

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

Add identifier here too

M  +2    -0    textautogeneratetext/core/autotests/textautogenerateskilltest.cpp
M  +17   -1    textautogeneratetext/core/prompts/textautogenerateskill.cpp
M  +18   -0    textautogeneratetext/core/prompts/textautogenerateskill.h

https://invent.kde.org/libraries/ktextaddons/-/commit/28dd7e2667dd2702576376d35d0b8ea363e31ce2

diff --git a/textautogeneratetext/core/autotests/textautogenerateskilltest.cpp b/textautogeneratetext/core/autotests/textautogenerateskilltest.cpp
index 17e85e87c..7e8bdde6c 100644
--- a/textautogeneratetext/core/autotests/textautogenerateskilltest.cpp
+++ b/textautogeneratetext/core/autotests/textautogenerateskilltest.cpp
@@ -19,6 +19,8 @@ void TextAutoGenerateSkillTest::shouldHaveDefaultValues()
     QVERIFY(skill.description().isEmpty());
     QVERIFY(skill.name().isEmpty());
     QVERIFY(skill.instructions().isEmpty());
+    QVERIFY(skill.identifier().isEmpty());
+    QVERIFY(!skill.isValid());
 }
 
 #include "moc_textautogenerateskilltest.cpp"
diff --git a/textautogeneratetext/core/prompts/textautogenerateskill.cpp b/textautogeneratetext/core/prompts/textautogenerateskill.cpp
index a81691bc6..101a9e4b1 100644
--- a/textautogeneratetext/core/prompts/textautogenerateskill.cpp
+++ b/textautogeneratetext/core/prompts/textautogenerateskill.cpp
@@ -40,10 +40,26 @@ void TextAutoGenerateSkill::setInstructions(const QString &newInstructions)
     mInstructions = newInstructions;
 }
 
+QByteArray TextAutoGenerateSkill::identifier() const
+{
+    return mIdentifier;
+}
+
+void TextAutoGenerateSkill::setIdentifier(const QByteArray &newIdentifier)
+{
+    mIdentifier = newIdentifier;
+}
+
+bool TextAutoGenerateSkill::isValid() const
+{
+    return !mIdentifier.isEmpty();
+}
+
 QDebug operator<<(QDebug d, const TextAutoGenerateText::TextAutoGenerateSkill &t)
 {
     d.space() << "name:" << t.name();
     d.space() << "description:" << t.description();
-    d.space() << "instructions" << t.instructions();
+    d.space() << "instructions:" << t.instructions();
+    d.space() << "identifier:" << t.identifier();
     return d;
 }
diff --git a/textautogeneratetext/core/prompts/textautogenerateskill.h b/textautogeneratetext/core/prompts/textautogenerateskill.h
index 0487791ef..b5bd82b0e 100644
--- a/textautogeneratetext/core/prompts/textautogenerateskill.h
+++ b/textautogeneratetext/core/prompts/textautogenerateskill.h
@@ -50,10 +50,28 @@ public:
      */
     void setInstructions(const QString &newInstructions);
 
+    /*!
+     * \brief identifier
+     * \return
+     */
+    [[nodiscard]] QByteArray identifier() const;
+    /*!
+     * \brief setIdentifier
+     * \param newIdentifier
+     */
+    void setIdentifier(const QByteArray &newIdentifier);
+
+    /*!
+     * \brief isValid
+     * \return
+     */
+    [[nodiscard]] bool isValid() const;
+
 private:
     QString mName;
     QString mDescription;
     QString mInstructions;
+    QByteArray mIdentifier;
 };
 }
 Q_DECLARE_TYPEINFO(TextAutoGenerateText::TextAutoGenerateSkill, 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.