Changeset 30867 in vbox
- Timestamp:
- Jul 16, 2010 9:33:38 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 63698
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMDefs.h
r30681 r30867 81 81 #include <QUuid> 82 82 #include <QVector> 83 #include <Q List>83 #include <QStringList> 84 84 #include <QMetaType> 85 85 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMWrappers.xsl
r30026 r30867 391 391 392 392 void SetExtraDataStringList(const QString &strKey, const QStringList &value); 393 QStringList GetExtraDataStringList(const QString &strKey );393 QStringList GetExtraDataStringList(const QString &strKey, QStringList def = QStringList()); 394 394 395 395 void SetExtraDataIntList(const QString &strKey, const QList<int> &value); 396 QList<int> GetExtraDataIntList(const QString &strKey );396 QList<int> GetExtraDataIntList(const QString &strKey, QList<int> def = QList<int>()); 397 397 398 398 </xsl:text> … … 783 783 <xsl:text>QStringList C</xsl:text> 784 784 <xsl:value-of select="substring(@name,2)"/> 785 <xsl:text>::GetExtraDataStringList(const QString &strKey )</xsl:text>785 <xsl:text>::GetExtraDataStringList(const QString &strKey, QStringList def /* = QStringList() */)</xsl:text> 786 786 <xsl:text> 787 787 { 788 return GetExtraData(strKey).split(","); 788 QString strValue = GetExtraData(strKey); 789 if (strValue.isEmpty()) 790 return def; 791 else 792 return strValue.split(","); 789 793 } 790 794 … … 806 810 <xsl:text>QList<int> C</xsl:text> 807 811 <xsl:value-of select="substring(@name,2)"/> 808 <xsl:text>::GetExtraDataIntList(const QString &strKey )</xsl:text>812 <xsl:text>::GetExtraDataIntList(const QString &strKey, QList<int> def /* = QList<int>() */)</xsl:text> 809 813 <xsl:text> 810 814 { 811 bool fOk;812 QList<int> intList;813 815 QStringList strList = GetExtraDataStringList(strKey); 814 for (int i=0; i < strList.size(); ++i)816 if (strList.size() > 0) 815 817 { 816 intList << strList.at(i).toInt(&fOk); 817 if (!fOk) 818 return QList<int>(); 819 818 QList<int> intList; 819 bool fOk; 820 for (int i=0; i < strList.size(); ++i) 821 { 822 intList << strList.at(i).toInt(&fOk); 823 if (!fOk) 824 return def; 825 } 826 return intList; 820 827 } 821 return intList;828 return def; 822 829 } 823 830
Note:
See TracChangeset
for help on using the changeset viewer.