Changeset 06bf1a


Ignore:
Timestamp:
12/29/11 17:38:55 (17 months ago)
Author:
Micke Prag <micke.prag@…>
Branches:
('master', 'a231b56d57a69513303d0061f5fa3e3cd51c85c1')('controller-upgrade', '72b31cc86eeeef18f1371a3067b6e8a5ca21abfc')('windows_service_fixes', 'df6bd2788365991d36d5af2a75833b8de2a5860f')
Children:
05d48d1685e596e7c1ccf7eb8dfb9311f25321fd
Parents:
d86e12f1d35f6954f6f6efdd4db276c31ebbf3fd
git-author:
Micke Prag <micke.prag@telldus.se>2011-12-29 17:32:56+01:00
git-committer:
Micke Prag <micke.prag@telldus.se>2011-12-29 17:38:55+01:00
Message:

Add function LiveMessageTokenScriptWrapper::getString()

Location:
telldus-gui/Plugins/Live
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • telldus-gui/Plugins/Live/LiveMessageToken.cpp

    rd86e12 r06bf1a  
    138138} 
    139139 
     140QString LiveMessageTokenScriptWrapper::getString(const QString &key, const QString &defaultValue) const { 
     141        if (p_token.valueType != LiveMessageToken::Dictionary) { 
     142                return defaultValue; 
     143        } 
     144        if (!p_token.dictVal.contains(key)) { 
     145                return defaultValue; 
     146        } 
     147        return p_token.dictVal[key].stringVal; 
     148} 
     149 
    140150int LiveMessageTokenScriptWrapper::intVal() const { 
    141151        return p_token.intVal; 
  • telldus-gui/Plugins/Live/LiveMessageToken.h

    rd86e12 r06bf1a  
    3737 
    3838        int getInt(const QString &key, int defaultValue = 0) const; 
     39        QString getString(const QString &key, const QString &defaultValue = "") const; 
    3940 
    4041        int intVal() const; 
Note: See TracChangeset for help on using the changeset viewer.