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 <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-08-30 22:38:33 +03:00
parent db6643a680
commit f65e97a948
2 changed files with 3 additions and 3 deletions

View file

@ -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 );
}

View file

@ -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) );