Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 50a82f4

Browse files
committed
Merge pull request #38 from macgitver/sacu/repoman-extracts
Extracts from the RepoMan branch
2 parents 45ccaef + 84ec9a6 commit 50a82f4

File tree

135 files changed

+578
-580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+578
-580
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ENDIF()
2929

3030
IF(UNIX)
3131
GCC_ADD_FLAG("-Wall")
32+
GCC_ADD_FLAG("-W")
3233
GCC_ADD_FLAG("-fvisibility=hidden")
3334
GCC_ADD_FLAG("-fvisibility-inlines-hidden")
3435
ENDIF()

CfgComp/CfgComp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ int main( int argc, char** argv )
8888

8989
ConfigSection sect( doc.documentElement() );
9090

91-
WriteClassSource wcs( outputFileDir % sect.className() % QLatin1String( ".cpp" ),
92-
sect.className() % QLatin1String( ".hpp" ), sect );
91+
WriteClassSource wcs( outputFileDir % sect.className() % QStringLiteral( ".cpp" ),
92+
sect.className() % QStringLiteral( ".hpp" ), sect );
9393
wcs.generate();
9494

95-
WriteClassHeader wch( outputFileDir % sect.className() % QLatin1String( ".hpp" ), sect );
95+
WriteClassHeader wch( outputFileDir % sect.className() % QStringLiteral( ".hpp" ), sect );
9696
wch.generate();
9797

9898
return 0;

CfgComp/Model.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ ConfigSetting::ConfigSetting( QDomElement el, ConfigSubSection* parent )
2828
{
2929
mSubSection = parent;
3030

31-
mName = el.attribute( QLatin1String( "Name" ) );
32-
mDefaultValue = el.attribute( QLatin1String( "Default" ), QString() );
33-
mType = el.attribute( QLatin1String( "Type" ) );
34-
mSubType = el.attribute( QLatin1String( "Subtype" ), QString() );
35-
mValidatorRule = el.attribute( QLatin1String( "Validate" ), QString() );
31+
mName = el.attribute( QStringLiteral( "Name" ) );
32+
mDefaultValue = el.attribute( QStringLiteral( "Default" ), QString() );
33+
mType = el.attribute( QStringLiteral( "Type" ) );
34+
mSubType = el.attribute( QStringLiteral( "Subtype" ), QString() );
35+
mValidatorRule = el.attribute( QStringLiteral( "Validate" ), QString() );
3636

37-
mEmitSignal = el.attribute( QLatin1String( "Notify" ), QLatin1String( "no" ) ).toLower() !=
38-
QLatin1String( "no" );
37+
mEmitSignal = el.attribute( QStringLiteral( "Notify" ), QStringLiteral( "no" ) ).toLower() !=
38+
QStringLiteral( "no" );
3939
}
4040

4141
bool ConfigSetting::isSubSectioned() const
@@ -102,11 +102,11 @@ QString ConfigSetting::defaultValue() const
102102

103103
QString ConfigSetting::defaultInitializer() const
104104
{
105-
if( mType == QLatin1String( "String" ) )
105+
if( mType == QStringLiteral( "String" ) )
106106
{
107-
return QLatin1String( "QString::fromUtf8( \"" )
107+
return QStringLiteral( "QString::fromUtf8( \"" )
108108
% utf8Encoded( mDefaultValue )
109-
% QLatin1String( "\" )" );
109+
% QStringLiteral( "\" )" );
110110
}
111111
else if( mDefaultValue.isEmpty() )
112112
{
@@ -121,18 +121,18 @@ QString ConfigSetting::defaultInitializer() const
121121
ConfigSubSection::ConfigSubSection( QDomElement el, ConfigSubSection* parent )
122122
{
123123
mParent = parent;
124-
mName = el.attribute( QLatin1String( "Name" ), QString() );
124+
mName = el.attribute( QStringLiteral( "Name" ), QString() );
125125

126126
//qDebug() << "Subsection:" << mName;
127127

128128
QDomElement elChild = el.firstChildElement();
129129
while( elChild.isElement() )
130130
{
131-
if( elChild.tagName() == QLatin1String( "Setting" ) )
131+
if( elChild.tagName() == QStringLiteral( "Setting" ) )
132132
{
133133
mSettings.append( new ConfigSetting( elChild, this ) );
134134
}
135-
else if( elChild.tagName() == QLatin1String( "SubSection" ) )
135+
else if( elChild.tagName() == QStringLiteral( "SubSection" ) )
136136
{
137137
mSections.append( new ConfigSubSection( elChild, this ) );
138138
}
@@ -195,17 +195,17 @@ void ConfigSubSection::addAllSettings( QList< ConfigSetting* >& settings) const
195195

196196
ConfigSection::ConfigSection( QDomElement el )
197197
{
198-
mClassName = el.attribute( QLatin1String( "Class" ) );
199-
mConfigPath = el.attribute( QLatin1String( "ConfigPath" ) );
198+
mClassName = el.attribute( QStringLiteral( "Class" ) );
199+
mConfigPath = el.attribute( QStringLiteral( "ConfigPath" ) );
200200

201201
QDomElement elChild = el.firstChildElement();
202202
while( elChild.isElement() )
203203
{
204-
if( elChild.tagName() == QLatin1String( "Setting" ) )
204+
if( elChild.tagName() == QStringLiteral( "Setting" ) )
205205
{
206206
mSettings.append( new ConfigSetting( elChild ) );
207207
}
208-
else if( elChild.tagName() == QLatin1String( "SubSection" ) )
208+
else if( elChild.tagName() == QStringLiteral( "SubSection" ) )
209209
{
210210
mSections.append( new ConfigSubSection( elChild ) );
211211
}

CfgComp/VariantTypes.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ VariantType::VariantType( const QString& typeName,
4747

4848
bool VariantType::isUserType() const
4949
{
50-
return mType == QLatin1String( "User" );
50+
return mType == QStringLiteral( "User" );
5151
}
5252

5353
bool VariantType::requiresTemplateMagic() const
@@ -77,20 +77,20 @@ QVariant::Type VariantType::typeId() const
7777

7878
QString VariantType::typeIdName() const
7979
{
80-
return QLatin1String( QVariant::typeToName( mTypeId ) );
80+
return QString::fromUtf8(QVariant::typeToName(mTypeId));
8181
}
8282

8383
QString VariantType::defaultCTored() const
8484
{
8585
switch( mTypeId )
8686
{
87-
case QVariant::Bool: return QLatin1String( "false" );
87+
case QVariant::Bool: return QStringLiteral( "false" );
8888
case QVariant::Int:
89-
case QVariant::UInt: return QLatin1String( "0" );
89+
case QVariant::UInt: return QStringLiteral( "0" );
9090
case QVariant::LongLong:
91-
case QVariant::ULongLong: return QLatin1String( "0LL" );
92-
case QVariant::Double: return QLatin1String( "0.0" );
93-
case QVariant::Char: return QLatin1String( "'\\0'" );
91+
case QVariant::ULongLong: return QStringLiteral( "0LL" );
92+
case QVariant::Double: return QStringLiteral( "0.0" );
93+
case QVariant::Char: return QStringLiteral( "'\\0'" );
9494

9595
case QVariant::Map:
9696
case QVariant::List:
@@ -112,28 +112,28 @@ QString VariantType::defaultCTored() const
112112
case QVariant::Point:
113113
case QVariant::PointF:
114114
case QVariant::RegExp:
115-
case QVariant::Hash: return mCppType + QLatin1String( "()" );
116-
default: return QLatin1String( "/* UNSUPPORTED */" );
115+
case QVariant::Hash: return mCppType + QStringLiteral( "()" );
116+
default: return QStringLiteral( "/* UNSUPPORTED */" );
117117
}
118118
}
119119

120120
VariantTypes::VariantTypes()
121121
{
122-
mTypes.append(VariantType(QLatin1String("String"),
122+
mTypes.append(VariantType(QStringLiteral("String"),
123123
QVariant::String,
124-
QLatin1String("QString")));
124+
QStringLiteral("QString")));
125125

126-
mTypes.append(VariantType(QLatin1String("Int"),
126+
mTypes.append(VariantType(QStringLiteral("Int"),
127127
QVariant::Int,
128-
QLatin1String("qint32")));
128+
QStringLiteral("qint32")));
129129

130-
mTypes.append(VariantType(QLatin1String("UInt"),
130+
mTypes.append(VariantType(QStringLiteral("UInt"),
131131
QVariant::UInt,
132-
QLatin1String("quint32")));
132+
QStringLiteral("quint32")));
133133

134-
mTypes.append(VariantType(QLatin1String("Bool"),
134+
mTypes.append(VariantType(QStringLiteral("Bool"),
135135
QVariant::Bool,
136-
QLatin1String("bool")));
136+
QStringLiteral("bool")));
137137
}
138138

139139
VariantTypes* VariantTypes::sSelf = NULL;

CfgComp/WriteClassHeader.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ WriteClassHeader::WriteClassHeader( const QString& outFile, const ConfigSection&
3131

3232
void WriteClassHeader::generate()
3333
{
34-
QString protector = QLatin1String( "CFGCOMP_" ) + mSection.className().toUpper() +
35-
QLatin1String( "_HPP" );
34+
QString protector = QStringLiteral( "CFGCOMP_" ) + mSection.className().toUpper() +
35+
QStringLiteral( "_HPP" );
3636

3737
mOutStream << "\n"
3838
"#ifndef " << protector << "\n"

CfgComp/WriteClassSource.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void WriteClassSource::generate()
106106

107107
foreach( ConfigSetting* setting, mSection.allSettings() )
108108
{
109-
mOutStream << "\n\tif( subPath == QLatin1String( \"" << setting->fullPath() << "\" ) )\n"
109+
mOutStream << "\n\tif( subPath == QStringLiteral( \"" << setting->fullPath() << "\" ) )\n"
110110
"\t{\n"
111111
"\t\tmValue" << setting->fullName() << " = value.";
112112

Libs/libDiffViews/Model/FilePatch.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ namespace DiffViews
4545
{
4646
Q_ASSERT( mPathNames.count() == 2 );
4747

48-
stream << "diff " << mOptions.join( QLatin1String( " " ) );
48+
stream << "diff " << mOptions.join( QStringLiteral( " " ) );
4949
if( mOptions.count() > 0 )
5050
stream << ' ';
51-
stream << mPathNames.join( QLatin1String( " " ) ) << '\n';
51+
stream << mPathNames.join( QStringLiteral( " " ) ) << '\n';
5252

53-
stream << mOptionLines.join( QLatin1String( "\n" ) );
53+
stream << mOptionLines.join( QStringLiteral( "\n" ) );
5454
if( mOptionLines.count() > 0 )
5555
stream << '\n';
5656

Libs/libDiffViews/Model/Hunk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace DiffViews
6060

6161
QString Hunk::area() const
6262
{
63-
return QString( QLatin1String( "@@ %1,%2 %3,%4 @@" ) )
63+
return QString( QStringLiteral( "@@ %1,%2 %3,%4 @@" ) )
6464
.arg( firstLine( 0 ) )
6565
.arg( numLines( 0 ) )
6666
.arg( firstLine( 1 ) )

Libs/libDiffViews/Views/Raw/RawHighlighter.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ namespace DiffViews
3030
{
3131
QColor c = Qt::black;
3232

33-
if( text.startsWith( QLatin1String( "diff" ) ) ||
34-
text.startsWith( QLatin1String( "---" ) ) ||
35-
text.startsWith( QLatin1String( "+++" ) ) )
33+
if( text.startsWith( QStringLiteral( "diff" ) ) ||
34+
text.startsWith( QStringLiteral( "---" ) ) ||
35+
text.startsWith( QStringLiteral( "+++" ) ) )
3636
{
3737
c = Qt::darkGreen;
3838
}
@@ -48,9 +48,9 @@ namespace DiffViews
4848
{
4949
c = Qt::gray;
5050
}
51-
else if( text.startsWith( QLatin1String( "@@" ) ) )
51+
else if( text.startsWith( QStringLiteral( "@@" ) ) )
5252
{
53-
int i = text.indexOf( QLatin1String( "@@" ), 2 );
53+
int i = text.indexOf( QStringLiteral( "@@" ), 2 );
5454
i += 2;
5555
setFormat( 0, i, Qt::darkYellow );
5656
setFormat( i, text.length() - i, Qt::blue );

Libs/libDiffViews/Views/Seq/SeqViewDiffStat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ namespace DiffViews
5454
{
5555
if( mBinary )
5656
{
57-
return QLatin1String( "Bin" );
57+
return QStringLiteral( "Bin" );
5858
}
59-
return QString( QLatin1String( "+%1 -%2" ) ).arg( mAdded ).arg( mRemoved );
59+
return QString( QStringLiteral( "+%1 -%2" ) ).arg( mAdded ).arg( mRemoved );
6060
}
6161

6262
void SeqViewDiffStat::postRendering()

0 commit comments

Comments
 (0)