generic: proper support for icon and caption in .desktop files

This commit is contained in:
Ivailo Monev 2015-09-21 00:26:31 +00:00
parent 00975278a4
commit a8a54f0484
6 changed files with 12 additions and 12 deletions

View file

@ -292,7 +292,7 @@ QString KGlobal::caption()
PRIVATE_DATA; PRIVATE_DATA;
// Caption set from command line ? // Caption set from command line ?
KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kde"); KCmdLineArgs *args = KCmdLineArgs::parsedArgs("kde");
if (args && args->isSet("caption")) { if (args && args->isSet("caption") && !args->getOption("caption").trimmed().isEmpty()) {
return args->getOption("caption"); return args->getOption("caption");
} else { } else {
// We have some about data ? // We have some about data ?

View file

@ -501,7 +501,7 @@ namespace KGlobal
* Returns a text for the window caption. * Returns a text for the window caption.
* *
* This may be set by * This may be set by
* "-caption", otherwise it will be equivalent to the name of the * "--caption", otherwise it will be equivalent to the name of the
* executable. * executable.
* @return the text for the window caption * @return the text for the window caption
*/ */

View file

@ -802,7 +802,7 @@ void KApplicationPrivate::parseCommandLine( )
} }
if ( q->type() != KApplication::Tty ) { if ( q->type() != KApplication::Tty ) {
if (args && args->isSet("icon")) if (args && args->isSet("icon") && !args->getOption("icon").trimmed().isEmpty())
{ {
q->setWindowIcon(KIcon(args->getOption("icon"))); q->setWindowIcon(KIcon(args->getOption("icon")));
} }

View file

@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Exec=kmailservice %u Exec=kmailservice --icon '%i' --caption '%c' %u
Icon=mail-message-new Icon=mail-message-new
MimeType=x-scheme-handler/mailto; MimeType=x-scheme-handler/mailto;

View file

@ -1,6 +1,6 @@
[Desktop Entry] [Desktop Entry]
Type=Application Type=Application
Exec=ktelnetservice %u Exec=ktelnetservice --icon '%i' --caption '%c' %u
Icon=utilities-terminal Icon=utilities-terminal
MimeType=x-scheme-handler/telnet;x-scheme-handler/rlogin;x-scheme-handler/ssh; MimeType=x-scheme-handler/telnet;x-scheme-handler/rlogin;x-scheme-handler/ssh;