1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-24 15:17:02 +01:00

* options.skel, photoid.c (get_default_photo_command): Find an image

viewer at runtime.  Seems FC5 doesn't have xloadimage.
This commit is contained in:
David Shaw 2006-04-11 19:20:08 +00:00
parent 2830e83246
commit 27bb89d687
3 changed files with 24 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2006-04-11 David Shaw <dshaw@jabberwocky.com>
* options.skel, photoid.c (get_default_photo_command): Find an
image viewer at runtime. Seems FC5 doesn't have xloadimage.
2006-04-08 David Shaw <dshaw@jabberwocky.com> 2006-04-08 David Shaw <dshaw@jabberwocky.com>
* getkey.c (parse_auto_key_locate): Fix dupe-removal code. * getkey.c (parse_auto_key_locate): Fix dupe-removal code.

View File

@ -182,14 +182,13 @@ keyserver hkp://subkeys.pgp.net
# input is the best way to do this as it avoids the time and effort in # input is the best way to do this as it avoids the time and effort in
# generating and then cleaning up a secure temp file. # generating and then cleaning up a secure temp file.
# #
# The default program is "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin" # If no photo-viewer is provided, GnuPG will look for xloadimage, eog,
# On Mac OS X and Windows, the default is to use your regular JPEG image # or display (ImageMagick). On Mac OS X and Windows, the default is
# viewer. # to use your regular JPEG image viewer.
# #
# Some other viewers: # Some other viewers:
# photo-viewer "qiv %i" # photo-viewer "qiv %i"
# photo-viewer "ee %i" # photo-viewer "ee %i"
# photo-viewer "display -title 'KeyID 0x%k'"
# #
# This one saves a copy of the photo ID in your home directory: # This one saves a copy of the photo ID in your home directory:
# photo-viewer "cat > ~/photoid-for-key-%k.%t" # photo-viewer "cat > ~/photoid-for-key-%k.%t"

View File

@ -259,7 +259,8 @@ char *image_type_to_string(byte type,int style)
} }
#if !defined(FIXED_PHOTO_VIEWER) && !defined(DISABLE_PHOTO_VIEWER) #if !defined(FIXED_PHOTO_VIEWER) && !defined(DISABLE_PHOTO_VIEWER)
static const char *get_default_photo_command(void) static const char *
get_default_photo_command(void)
{ {
#if defined(_WIN32) #if defined(_WIN32)
OSVERSIONINFO osvi; OSVERSIONINFO osvi;
@ -278,7 +279,14 @@ static const char *get_default_photo_command(void)
#elif defined(__riscos__) #elif defined(__riscos__)
return "Filer_Run %I"; return "Filer_Run %I";
#else #else
if(path_access("xloadimage",X_OK)==0)
return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin"; return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
else if(path_access("eog",X_OK)==0)
return "eog %i";
else if(path_access("display",X_OK)==0)
return "display -title 'KeyID 0x%k' %i";
else
return "";
#endif #endif
} }
#endif #endif
@ -316,6 +324,12 @@ void show_photos(const struct user_attribute *attrs,
opt.photo_viewer=get_default_photo_command(); opt.photo_viewer=get_default_photo_command();
#endif #endif
if(!*opt.photo_viewer)
{
log_info(_("no photo viewer set\n"));
goto fail;
}
/* make command grow */ /* make command grow */
command=pct_expando(opt.photo_viewer,&args); command=pct_expando(opt.photo_viewer,&args);
if(!command) if(!command)