From kde-commits Tue Feb 11 02:52:13 2003 From: Dirk Mueller Date: Tue, 11 Feb 2003 02:52:13 +0000 To: kde-commits Subject: kdelibs/kio/kio X-MARC-Message: https://marc.info/?l=kde-commits&m=104493207421274 CVS commit by mueller: stop crashing my KDE session, thank you. M +13 -16 krun.cpp 1.218 --- kdelibs/kio/kio/krun.cpp #1.217:1.218 @@ -548,5 +548,5 @@ QString KRun::binaryName( const QString } -static pid_t runCommandInternal( KProcess* proc, const KService::Ptr& service, const QString& binName, +static pid_t runCommandInternal( KProcess* proc, const KService* service, const QString& binName, const QString &execName_P, const QString & iconName_P ) { @@ -554,5 +554,5 @@ static pid_t runCommandInternal( KProces QString execName = execName_P; QString iconName = iconName_P; - if ( service != NULL && !KDesktopFile::isAuthorizedDesktopFile( service->desktopEntryPath() )) + if ( service && !KDesktopFile::isAuthorizedDesktopFile( service->desktopEntryPath() )) { KMessageBox::sorry(0, i18n("You are not authorized to execute this file.")); @@ -563,7 +563,5 @@ static pid_t runCommandInternal( KProces QCString wmclass; KStartupInfoId id; - if( service != NULL ) - { - if( service->property( "X-KDE-StartupNotify" ).isValid()) + if( service && service->property( "X-KDE-StartupNotify" ).isValid()) { startup_notify = service->property( "X-KDE-StartupNotify" ).toBool(); @@ -572,5 +570,5 @@ static pid_t runCommandInternal( KProces else // non-compliant app ( .desktop file ) { - if( service->type() == "Application" ) + if( service && service->type() == "Application" ) { startup_notify = true; // doesn't have .desktop entries needed @@ -578,5 +576,4 @@ static pid_t runCommandInternal( KProces } } - } if( startup_notify ) { @@ -648,5 +645,5 @@ static pid_t runTempService( const KServ *proc << arg; } - return runCommandInternal( proc, KService::Ptr( new KService( _service ) ), _service.exec(), _service.name(), _service.icon() ); + return runCommandInternal( proc, &_service, _service.exec(), _service.name(), _service.icon() ); } @@ -726,5 +723,5 @@ pid_t KRun::runCommand( const QString& c QString bin = binaryName( cmd, false ); KService::Ptr service = KService::serviceByDesktopName( bin ); - return runCommandInternal( proc, service, bin, execName, iconName ); + return runCommandInternal( proc, &(*service), bin, execName, iconName ); }