Skip to content

Commit

Permalink
Merge pull request #8168 from elpaso/fix-clang-warnings
Browse files Browse the repository at this point in the history
Fix error return-std-move
  • Loading branch information
elpaso authored Oct 11, 2018
2 parents b2df588 + e5ba558 commit 46938c0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions external/o2/src/o2replyserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ QMap<QString, QString> O2ReplyServer::parseQueryParams(QByteArray *data) {
QUrlQuery query(getTokenUrl);
tokens = query.queryItems();
#endif
QMultiMap<QString, QString> queryParams;
QMap<QString, QString> queryParams;
QPair<QString, QString> tokenPair;
foreach (tokenPair, tokens) {
// FIXME: We are decoding key and value again. This helps with Google OAuth, but is it mandated by the standard?
QString key = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.first.trimmed().toLatin1()));
QString value = QUrl::fromPercentEncoding(QByteArray().append(tokenPair.second.trimmed().toLatin1()));
queryParams.insert(key, value);
}
return std::move( queryParams );
return queryParams;
}

void O2ReplyServer::closeServer(QTcpSocket *socket, bool hasparameters)
Expand Down
31 changes: 16 additions & 15 deletions src/plugins/grass/qtermwidget/ColorScheme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,25 +125,25 @@ const char *const ColorScheme::translatedColorNames[TABLE_COLORS] =

ColorScheme::ColorScheme()
{
_table = 0;
_randomTable = 0;
_table = nullptr;
_randomTable = nullptr;
_opacity = 1.0;
}
ColorScheme::ColorScheme( const ColorScheme &other )
: _opacity( other._opacity )
, _table( 0 )
, _randomTable( 0 )
, _table( nullptr )
, _randomTable( nullptr )
{
setName( other.name() );
setDescription( other.description() );

if ( other._table != 0 )
if ( other._table )
{
for ( int i = 0 ; i < TABLE_COLORS ; i++ )
setColorTableEntry( i, other._table[i] );
}

if ( other._randomTable != 0 )
if ( other._randomTable )
{
for ( int i = 0 ; i < TABLE_COLORS ; i++ )
{
Expand Down Expand Up @@ -188,7 +188,7 @@ ColorEntry ColorScheme::colorEntry( int index, uint randomSeed ) const
ColorEntry entry = colorTable()[index];

if ( randomSeed != 0 &&
_randomTable != 0 &&
_randomTable &&
!_randomTable[index].isNull() )
{
const RandomizationRange &range = _randomTable[index];
Expand Down Expand Up @@ -216,7 +216,7 @@ void ColorScheme::getColorTable( ColorEntry *table, uint randomSeed ) const
}
bool ColorScheme::randomizedBackgroundColor() const
{
return _randomTable == 0 ? false : !_randomTable[1].isNull();
return _randomTable ? false : !_randomTable[1].isNull();
}
void ColorScheme::setRandomizedBackgroundColor( bool randomize )
{
Expand All @@ -241,7 +241,7 @@ void ColorScheme::setRandomizationRange( int index, quint16 hue, quint8 saturati
Q_ASSERT( hue <= MAX_HUE );
Q_ASSERT( index >= 0 && index < TABLE_COLORS );

if ( _randomTable == 0 )
if ( ! _randomTable )
_randomTable = new RandomizationRange[TABLE_COLORS];

_randomTable[index].hue = hue;
Expand Down Expand Up @@ -696,15 +696,16 @@ QList<QString> ColorSchemeManager::listKDE3ColorSchemes()
filters << QStringLiteral( "*.schema" );
dir.setNameFilters( filters );
QStringList list = dir.entryList( filters );
QStringList ret;
QList<QString> ret;
foreach ( QString i, list )
ret << dname + "/" + i;
return std::move( ret );
return ret;
//return KGlobal::dirs()->findAllResources("data",
// "konsole/*.schema",
// KStandardDirs::NoDuplicates);
//
}

QList<QString> ColorSchemeManager::listColorSchemes()
{
QString dname( get_color_schemes_dir() );
Expand All @@ -713,10 +714,10 @@ QList<QString> ColorSchemeManager::listColorSchemes()
filters << QStringLiteral( "*.colorscheme" );
dir.setNameFilters( filters );
QStringList list = dir.entryList( filters );
QStringList ret;
QList<QString> ret;
foreach ( QString i, list )
ret << dname + "/" + i;
return std::move( ret );
return ret;
// return KGlobal::dirs()->findAllResources("data",
// "konsole/*.colorscheme",
// KStandardDirs::NoDuplicates);
Expand Down Expand Up @@ -778,11 +779,11 @@ const ColorScheme *ColorSchemeManager::findColorScheme( const QString &name )

qDebug() << "Could not find color scheme - " << name;

return 0;
return nullptr;
}
}

ColorSchemeManager *ColorSchemeManager::sColorSchemeManager = 0;
ColorSchemeManager *ColorSchemeManager::sColorSchemeManager = nullptr;
//K_GLOBAL_STATIC( ColorSchemeManager , colorSchemeManager )
ColorSchemeManager *ColorSchemeManager::instance()
{
Expand Down

0 comments on commit 46938c0

Please sign in to comment.