[vlmc-devel] Commands::Generic Implement setText() correctly
Yikai Lu
git at videolan.org
Sat Jun 4 11:47:48 CEST 2016
vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun May 22 13:18:28 2016 +0900| [18c7c5cac847e086b0e56a828468fe54994a7290] | committer: Hugo Beauzée-Luyssen
Commands::Generic Implement setText() correctly
> https://code.videolan.org/videolan/vlmc/commit/18c7c5cac847e086b0e56a828468fe54994a7290
---
src/Commands/Commands.cpp | 14 ++++++++++++++
src/Commands/Commands.h | 8 +++++---
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/src/Commands/Commands.cpp b/src/Commands/Commands.cpp
index f54f311..eb1f69e 100644
--- a/src/Commands/Commands.cpp
+++ b/src/Commands/Commands.cpp
@@ -63,6 +63,20 @@ Commands::Generic::isValid() const
return m_valid;
}
+#ifndef WITH_GUI
+void
+Commands::Generic::setText( const QString& text )
+{
+ m_text = text;
+}
+
+QString
+Commands::Generic::text() const
+{
+ return m_text;
+}
+#endif
+
void
Commands::Generic::redo()
{
diff --git a/src/Commands/Commands.h b/src/Commands/Commands.h
index f974d41..d27a215 100644
--- a/src/Commands/Commands.h
+++ b/src/Commands/Commands.h
@@ -53,16 +53,18 @@ namespace Commands
void redo();
void undo();
bool isValid() const;
+#ifndef WITH_GUI
+ void setText( const QString& text ) ;
+ QString text() const;
+#endif
private:
bool m_valid;
+ QString m_text;
protected slots:
virtual void retranslate() = 0;
void invalidate();
signals:
void invalidated();
-#ifndef WITH_GUI
- virtual void setText( const QString& ) {}
-#endif
};
#ifdef WITH_GUI
More information about the Vlmc-devel
mailing list