refact: return early in identifyWindowByPidEnv
-
This commit is contained in:
		
				
					committed by
					
						![deepin-bot[bot]](/avatar/ec7a5713ed1e69523b52b3d059a08601?size=40) deepin-bot[bot]
						deepin-bot[bot]
					
				
			
			
				
	
			
			
			
						parent
						
							010d0c40f6
						
					
				
				
					commit
					4e43ef0cdb
				
			| @ -223,7 +223,11 @@ AppInfo *WindowIdentify::identifyWindowByPidEnv(Dock *_dock, WindowInfoX *winInf | ||||
|     int pid = winInfo->getPid(); | ||||
|     auto process = winInfo->getProcess(); | ||||
|     qInfo() << "identifyWindowByPidEnv: pid=" << pid << " WindowId=" << winInfo->getXid(); | ||||
|     if (pid != 0 && process) { | ||||
|  | ||||
|     if (pid == 0 || !process) { | ||||
|         return ret; | ||||
|     } | ||||
|  | ||||
|     QString launchedDesktopFile = process->getEnv("GIO_LAUNCHED_DESKTOP_FILE").c_str(); | ||||
|     QString launchedDesktopFilePidStr = process->getEnv("GIO_LAUNCHED_DESKTOP_FILE_PID").c_str(); | ||||
|     int launchedDesktopFilePid = launchedDesktopFilePidStr.toInt(); | ||||
| @ -255,7 +259,6 @@ AppInfo *WindowIdentify::identifyWindowByPidEnv(Dock *_dock, WindowInfoX *winInf | ||||
|         ret = new AppInfo(launchedDesktopFile); | ||||
|         innerId = ret->getInnerId(); | ||||
|     } | ||||
|     } | ||||
|  | ||||
|     return ret; | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user