Update .desktop file on Linux (#3109)
What has been done: * Removed deprecated Encoding key * Specified correct WM class for StartupWMClass key * Fixed icon name I also fixed restarting when language is changed and there is no Updater Signed-off-by: Nicholas Guriev <guriev-ns@ya.ru> (github: mymedia2)
This commit is contained in:
		
							parent
							
								
									0ce6e8a33a
								
							
						
					
					
						commit
						2e6c15ff9d
					
				
					 2 changed files with 8 additions and 9 deletions
				
			
		| 
						 | 
					@ -467,16 +467,16 @@ void psRegisterCustomScheme() {
 | 
				
			||||||
			QTextStream s(&f);
 | 
								QTextStream s(&f);
 | 
				
			||||||
			s.setCodec("UTF-8");
 | 
								s.setCodec("UTF-8");
 | 
				
			||||||
			s << "[Desktop Entry]\n";
 | 
								s << "[Desktop Entry]\n";
 | 
				
			||||||
			s << "Encoding=UTF-8\n";
 | 
					 | 
				
			||||||
			s << "Version=1.0\n";
 | 
								s << "Version=1.0\n";
 | 
				
			||||||
			s << "Name=Telegram Desktop\n";
 | 
								s << "Name=Telegram Desktop\n";
 | 
				
			||||||
			s << "Comment=Official desktop version of Telegram messaging app\n";
 | 
								s << "Comment=Official desktop version of Telegram messaging app\n";
 | 
				
			||||||
 | 
								s << "TryExec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << "\n";
 | 
				
			||||||
			s << "Exec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << " -- %u\n";
 | 
								s << "Exec=" << EscapeShell(QFile::encodeName(cExeDir() + cExeName())) << " -- %u\n";
 | 
				
			||||||
			s << "Icon=telegram\n";
 | 
								s << "Icon=telegram\n";
 | 
				
			||||||
			s << "Terminal=false\n";
 | 
								s << "Terminal=false\n";
 | 
				
			||||||
			s << "StartupWMClass=Telegram\n";
 | 
								s << "StartupWMClass=TelegramDesktop\n";
 | 
				
			||||||
			s << "Type=Application\n";
 | 
								s << "Type=Application\n";
 | 
				
			||||||
			s << "Categories=Network;\n";
 | 
								s << "Categories=Network;InstantMessaging;Qt;\n";
 | 
				
			||||||
			s << "MimeType=x-scheme-handler/tg;\n";
 | 
								s << "MimeType=x-scheme-handler/tg;\n";
 | 
				
			||||||
			f.close();
 | 
								f.close();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -541,7 +541,7 @@ bool _execUpdater(bool update = true, const QString &crashreport = QString()) {
 | 
				
			||||||
	static const int MaxLen = 65536, MaxArgsCount = 128;
 | 
						static const int MaxLen = 65536, MaxArgsCount = 128;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char path[MaxLen] = {0};
 | 
						char path[MaxLen] = {0};
 | 
				
			||||||
	QByteArray data(QFile::encodeName(cExeDir() + "Updater"));
 | 
						QByteArray data(QFile::encodeName(cExeDir() + (update ? "Updater" : gExeName)));
 | 
				
			||||||
	memcpy(path, data.constData(), data.size());
 | 
						memcpy(path, data.constData(), data.size());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key", p_path[] = "-workpath", p_startintray[] = "-startintray", p_testmode[] = "-testmode", p_crashreport[] = "-crashreport";
 | 
						char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key", p_path[] = "-workpath", p_startintray[] = "-startintray", p_testmode[] = "-testmode", p_crashreport[] = "-crashreport";
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,12 +1,11 @@
 | 
				
			||||||
[Desktop Entry]
 | 
					[Desktop Entry]
 | 
				
			||||||
Encoding=UTF-8
 | 
					 | 
				
			||||||
Version=1.0
 | 
					Version=1.0
 | 
				
			||||||
Name=Telegram Desktop
 | 
					Name=Telegram Desktop
 | 
				
			||||||
Comment=Official desktop version of Telegram messaging app
 | 
					Comment=Official desktop version of Telegram messaging app
 | 
				
			||||||
Exec=/usr/bin/telegram-desktop -- %u
 | 
					Exec=telegram-desktop -- %u
 | 
				
			||||||
Icon=telegram-desktop
 | 
					Icon=telegram
 | 
				
			||||||
Terminal=false
 | 
					Terminal=false
 | 
				
			||||||
StartupWMClass=Telegram
 | 
					StartupWMClass=TelegramDesktop
 | 
				
			||||||
Type=Application
 | 
					Type=Application
 | 
				
			||||||
Categories=Network;
 | 
					Categories=Network;InstantMessaging;Qt;
 | 
				
			||||||
MimeType=x-scheme-handler/tg;
 | 
					MimeType=x-scheme-handler/tg;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue