summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-08 21:06:45 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-11-08 21:06:45 +0100
commite386248fcc7906d150cb476024f2c3d8ae760a38 (patch)
tree9af04b8611aede87ad839709bb36e6866950578b
parenta28416472f90894fb73aafc97a576bf3f7d8a011 (diff)
changed .desktop file to use filenames instead of URIs
-rw-r--r--deadbeef.desktop.in2
-rw-r--r--main.c20
2 files changed, 12 insertions, 10 deletions
diff --git a/deadbeef.desktop.in b/deadbeef.desktop.in
index bc729a64..17d16ba9 100644
--- a/deadbeef.desktop.in
+++ b/deadbeef.desktop.in
@@ -2,7 +2,7 @@
Name=Deadbeef
GenericName=Audio Player
Comment=Play music
-Exec=deadbeef %U
+Exec=deadbeef %f
MimeType=application/ogg;audio/x-vorbis+ogg;application/x-ogg;audio/mp3;audio/prs.sid;audio/x-flac;audio/mpeg;audio/x-mpeg;audio/x-mod;audio/x-it;audio/x-s3m;audio/x-xm;
Categories=AudioVideo;Player;
Terminal=false
diff --git a/main.c b/main.c
index 3fc1715e..fc079dae 100644
--- a/main.c
+++ b/main.c
@@ -240,17 +240,19 @@ exec_command_line (const char *cmdline, int len, int filter) {
}
while (parg < pend) {
char resolved[PATH_MAX];
- if (!realpath (parg, resolved)) {
- fprintf (stderr, "error: cannot expand filename %s, file will not play\n", parg);
+ const char *pname;
+ if (realpath (parg, resolved)) {
+ pname = resolved;
}
else {
- if (pl_add_file (resolved, NULL, NULL) >= 0) {
- if (queue) {
- exitcode = 3;
- }
- else {
- exitcode = 2;
- }
+ pname = parg;
+ }
+ if (pl_add_file (pname, NULL, NULL) >= 0) {
+ if (queue) {
+ exitcode = 3;
+ }
+ else {
+ exitcode = 2;
}
}
parg += strlen (parg);