forked from qt-creator/qt-creator
Library wizard: Create export symbol correctly.
...if the directory contains a '-'. Export a function to generate identifier correctly and use that. Reviewed-by: con <qtc-committer@nokia.com> Task-number: QTCREATORBUG-248
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
|
||||
namespace Utils {
|
||||
|
||||
static QString toAlphaNum(const QString &s)
|
||||
QTCREATOR_UTILS_EXPORT QString fileNameToCppIdentifier(const QString &s)
|
||||
{
|
||||
QString rc;
|
||||
const int len = s.size();
|
||||
@@ -55,9 +55,9 @@ static QString toAlphaNum(const QString &s)
|
||||
QTCREATOR_UTILS_EXPORT QString headerGuard(const QString &file)
|
||||
{
|
||||
const QFileInfo fi(file);
|
||||
QString rc = toAlphaNum(fi.completeBaseName()).toUpper();
|
||||
QString rc = fileNameToCppIdentifier(fi.completeBaseName()).toUpper();
|
||||
rc += QLatin1Char('_');
|
||||
rc += toAlphaNum(fi.suffix()).toUpper();
|
||||
rc += fileNameToCppIdentifier(fi.suffix()).toUpper();
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user