mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kinit: keep reference to the QByteArray object in KLauncher::cancel_service_startup_info()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
24a903d65f
commit
bf28b99836
1 changed files with 5 additions and 5 deletions
|
@ -882,17 +882,17 @@ KLauncher::cancel_service_startup_info( KLaunchRequest* request, const QByteArra
|
|||
request->startup_id = "0"; // krazy:exclude=doublequote_chars
|
||||
if( !startup_id.isEmpty() && startup_id != "0" )
|
||||
{
|
||||
QString dpy_str;
|
||||
QByteArray dpy_bytes;
|
||||
foreach (const QString &env, envs) {
|
||||
if (env.startsWith(QLatin1String("DISPLAY=")))
|
||||
dpy_str = env.mid(8);
|
||||
dpy_bytes = env.mid(8).toLatin1();
|
||||
}
|
||||
Display* dpy = NULL;
|
||||
if( !dpy_str.isEmpty() && mCached_dpy != NULL
|
||||
&& dpy_str != QString::fromLatin1(XDisplayString( mCached_dpy )) )
|
||||
if( !dpy_bytes.isEmpty() && mCached_dpy != NULL
|
||||
&& dpy_bytes != XDisplayString( mCached_dpy ) )
|
||||
dpy = mCached_dpy;
|
||||
if( dpy == NULL )
|
||||
dpy = XOpenDisplay( dpy_str.toLatin1().constData() );
|
||||
dpy = XOpenDisplay( dpy_bytes.constData() );
|
||||
if( dpy == NULL )
|
||||
return;
|
||||
KStartupInfoId id;
|
||||
|
|
Loading…
Add table
Reference in a new issue