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

@ -87,24 +87,24 @@
class KCmdLineParsedOptions : public QHash<QByteArray,QByteArray>
{
public:
KCmdLineParsedOptions() { }
KCmdLineParsedOptions() { }
};
class KCmdLineParsedArgs : public QList<QByteArray>
{
public:
KCmdLineParsedArgs() { }
KCmdLineParsedArgs() { }
};
class KCmdLineArgsList: public QList<KCmdLineArgs*>
{
public:
KCmdLineArgsList() { }
~KCmdLineArgsList() {
while (count())
delete takeFirst();
}
KCmdLineArgsList() { }
~KCmdLineArgsList() {
while (count())
delete takeFirst();
}
};
//

View file

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

View file

@ -501,7 +501,7 @@ namespace KGlobal
* Returns a text for the window caption.
*
* 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.
* @return the text for the window caption
*/

View file

@ -802,7 +802,7 @@ void KApplicationPrivate::parseCommandLine( )
}
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")));
}

View file

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

View file

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