diff options
| author | 2022-03-28 23:23:30 +0200 | |
|---|---|---|
| committer | 2022-04-13 15:40:42 +0200 | |
| commit | c1dca21057dd81c66bf1e164f401b161c2d883ea (patch) | |
| tree | d2813bd30c81c610c1509809eb8a8c782c0568ed /dicealias.cpp | |
| parent | 70c279ab847883046ef0a951e4d2ccbf6170d19a (diff) | |
| download | OneRoll-c1dca21057dd81c66bf1e164f401b161c2d883ea.tar.gz OneRoll-c1dca21057dd81c66bf1e164f401b161c2d883ea.zip | |
update to new cmake
Diffstat (limited to 'dicealias.cpp')
| -rw-r--r-- | dicealias.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/dicealias.cpp b/dicealias.cpp index b0402a3..2bc07be 100644 --- a/dicealias.cpp +++ b/dicealias.cpp @@ -128,21 +128,17 @@ QString makeReplament(const QString& pattern, const QString& command, QString cm } DiceAlias::DiceAlias(QString pattern, QString command, QString comment, bool isReplace, bool isEnable) - : m_pattern(pattern), m_command(command), m_comment(comment), m_isEnable(isEnable) + : m_pattern(pattern) + , m_command(command) + , m_comment(comment) + , m_type(isReplace ? REPLACE : REGEXP) + , m_isEnable(isEnable) { - if(isReplace) - { - m_type= REPLACE; - } - else - { - m_type= REGEXP; - } } DiceAlias::~DiceAlias() { - qDebug() << "destructeur of alias!" << this; + // qDebug() << "destructeur of alias!" << this; } DiceAlias::DiceAlias(const DiceAlias& alias) @@ -159,10 +155,9 @@ bool DiceAlias::resolved(QString& str) if(!m_isEnable) return false; - if((m_type == REPLACE) && (str.contains(m_command))) + if((m_type == REPLACE) && (str.contains(m_pattern))) { str= makeReplament(m_pattern, m_command, str); - // str.replace(m_command,m_value); return true; } else if(m_type == REGEXP) |