forked from qt-creator/qt-creator
Support new keywords %MONTH% and %DAY% for C++ template file.
Merge-request: 199 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
committed by
Oswald Buddenhagen
parent
dbd3965241
commit
3b70e944a3
@@ -7324,6 +7324,8 @@
|
||||
|
||||
\list 1
|
||||
\o \c %YEAR%: Year
|
||||
\o \c %MONTH%: Month
|
||||
\o \c %DAY%: Day of the month
|
||||
\o \c %DATE%: Date
|
||||
\o \c %USER%: User name
|
||||
\o \c %FILENAME%: File name
|
||||
|
||||
@@ -116,6 +116,14 @@ static bool keyWordReplacement(const QString &keyWord,
|
||||
*value = QString::number(QDate::currentDate().year());
|
||||
return true;
|
||||
}
|
||||
if (keyWord == QLatin1String("%MONTH%")) {
|
||||
*value = QString::number(QDate::currentDate().month());
|
||||
return true;
|
||||
}
|
||||
if (keyWord == QLatin1String("%DAY%")) {
|
||||
*value = QString::number(QDate::currentDate().day());
|
||||
return true;
|
||||
}
|
||||
if (keyWord == QLatin1String("%CLASS%")) {
|
||||
*value = className;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user