summaryrefslogtreecommitdiffstats
path: root/tdelfeditor
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-02 09:54:49 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-02 09:54:49 -0600
commitc5bca102dd4e45626e1e76b0684ef065935918ed (patch)
tree5f13e0b27facb5e725d31e13e4b77977bb2d76c5 /tdelfeditor
parent6ddacfff536fc6fcedff929b315fd43c494bb02c (diff)
downloadtdelibs-c5bca102dd4e45626e1e76b0684ef065935918ed.tar.gz
tdelibs-c5bca102dd4e45626e1e76b0684ef065935918ed.zip
Add preferred icon metadata field
Diffstat (limited to 'tdelfeditor')
-rw-r--r--tdelfeditor/tdelfeditor.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/tdelfeditor/tdelfeditor.cpp b/tdelfeditor/tdelfeditor.cpp
index b6f52c199..4515474c6 100644
--- a/tdelfeditor/tdelfeditor.cpp
+++ b/tdelfeditor/tdelfeditor.cpp
@@ -73,7 +73,8 @@ typedef enum {
PARAM_ORGANIZATION = 9,
PARAM_VERSION = 10,
PARAM_DATETIME = 11,
- PARAM_NOTES = 12,
+ PARAM_SYSICON = 12,
+ PARAM_NOTES = 13,
} eParams;
typedef struct {
@@ -209,7 +210,7 @@ int handle_arguments(int argc, char **argv, eMode *mode)
break;
case 'm':
*mode = MODE_SET_METADATA;
- required_params = 13;
+ required_params = 14;
break;
case 'r':
*mode = MODE_RETRIEVE_ICON;
@@ -240,7 +241,7 @@ print_icon_usage:
fprintf(stderr, _("usage: %s [-c|-e|-g] elf-file-name\n"), argv[PARAM_PROGNAME]);
fprintf(stderr, _("usage: %s [-s] elf-file-name uuid\n"), argv[PARAM_PROGNAME]);
fprintf(stderr, _("usage: %s [-s] elf-file-name uuid\n"), argv[PARAM_PROGNAME]);
- fprintf(stderr, _("usage: %s [-m] elf-file-name \"executable name\" \"description\" \"license\" \"copyright\" \"authors\" \"product\" \"organization\" \"version\" \"datetime\" \"notes\"\n"), argv[PARAM_PROGNAME]);
+ fprintf(stderr, _("usage: %s [-m] elf-file-name \"executable name\" \"description\" \"license\" \"copyright\" \"authors\" \"product\" \"organization\" \"version\" \"datetime\" \"sysicon\" \"notes\"\n"), argv[PARAM_PROGNAME]);
fprintf(stderr, _("If -t is set the TDEDIRS environment variable must include your TDE installation prefix\n"));
fprintf(stderr, _("for example: TDEDIRS=/opt/trinity ./tdelfeditor -t ./konqueror konqueror\n"));
for(i=0;i<ELFICON_OPTIONS;i++)
@@ -490,6 +491,7 @@ int main_console(int argc, char **argv)
if (strlen(argv[PARAM_ORGANIZATION]) > 0) add_resource_string(handle, ".metadata_organization", argv[PARAM_ORGANIZATION]);
if (strlen(argv[PARAM_VERSION]) > 0) add_resource_string(handle, ".metadata_version", argv[PARAM_VERSION]);
if (strlen(argv[PARAM_DATETIME]) > 0) add_resource_string(handle, ".metadata_datetime", argv[PARAM_DATETIME]);
+ if (strlen(argv[PARAM_SYSICON]) > 0) add_resource_string(handle, ".metadata_sysicon", argv[PARAM_SYSICON]);
if (strlen(argv[PARAM_NOTES]) > 0) add_resource_string(handle, ".metadata_notes", argv[PARAM_NOTES]);
} break;
case MODE_SET_EMPTY_UUID:
@@ -546,7 +548,8 @@ int main_console(int argc, char **argv)
TQString systemIcon = KGlobal::iconLoader()->iconPath(argv[PARAM_ICON_NAME], 0, true);
if (systemIcon.isNull()) {
systemIcon = KGlobal::iconLoader()->iconPath(argv[PARAM_ICON_NAME], 0, false);
- printf("NOT FOUND, using %s\n\r", systemIcon.ascii());
+ printf("NOT FOUND, refusing to add unknown icon (this message is harmless)\n\r");
+ goto fail;
}
else {
printf("found %s\n\r", systemIcon.ascii());