From f65e97a9484803cbe078f2ac84549c933a82b514 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 30 Aug 2023 22:38:33 +0300 Subject: [PATCH] generic: do not create temporary QString objects for conversion to integer QByteArray::toLong() does the same as QString::toLong() except faster Signed-off-by: Ivailo Monev --- keditfiletype/keditfiletype.cpp | 4 ++-- kwin/clients/oxygen/oxygenclient.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keditfiletype/keditfiletype.cpp b/keditfiletype/keditfiletype.cpp index c8e4b76a..8632492b 100644 --- a/keditfiletype/keditfiletype.cpp +++ b/keditfiletype/keditfiletype.cpp @@ -178,8 +178,8 @@ int main(int argc, char ** argv) FileTypeDialog dlg( mimeTypeData ); if( args->isSet( "parent" )) { - bool ok; - long id = QString(args->getOption("parent")).toLong(&ok); + bool ok = false; + long id = args->getOption("parent").toLong(&ok); if (ok) KWindowSystem::setMainWindow( &dlg, (WId)id ); } diff --git a/kwin/clients/oxygen/oxygenclient.cpp b/kwin/clients/oxygen/oxygenclient.cpp index 0b99fe31..162d7898 100644 --- a/kwin/clients/oxygen/oxygenclient.cpp +++ b/kwin/clients/oxygen/oxygenclient.cpp @@ -1690,7 +1690,7 @@ namespace Oxygen if( widget() != event->source() ) setForceActive( true ); - const long source = QString( groupData->data( tabDragMimeType() ) ).toLong(); + const long source = groupData->data( tabDragMimeType() ).toLong(); const int clickedIndex( tabIndexAt( point, true ) ); if( clickedIndex < 0 ) tab_A_behind_B( source, tabId(_itemData.count()-1) ); else tab_A_before_B( source, tabId(clickedIndex) );