mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
generic: proper support for icon and caption in .desktop files
This commit is contained in:
parent
00975278a4
commit
a8a54f0484
6 changed files with 12 additions and 12 deletions
|
@ -87,24 +87,24 @@
|
||||||
class KCmdLineParsedOptions : public QHash<QByteArray,QByteArray>
|
class KCmdLineParsedOptions : public QHash<QByteArray,QByteArray>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KCmdLineParsedOptions() { }
|
KCmdLineParsedOptions() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class KCmdLineParsedArgs : public QList<QByteArray>
|
class KCmdLineParsedArgs : public QList<QByteArray>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KCmdLineParsedArgs() { }
|
KCmdLineParsedArgs() { }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class KCmdLineArgsList: public QList<KCmdLineArgs*>
|
class KCmdLineArgsList: public QList<KCmdLineArgs*>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
KCmdLineArgsList() { }
|
KCmdLineArgsList() { }
|
||||||
~KCmdLineArgsList() {
|
~KCmdLineArgsList() {
|
||||||
while (count())
|
while (count())
|
||||||
delete takeFirst();
|
delete takeFirst();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -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 ?
|
||||||
|
|
|
@ -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
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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")));
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue