mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02: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:
parent
2830e83246
commit
27bb89d687
3 changed files with 24 additions and 6 deletions
|
@ -259,7 +259,8 @@ char *image_type_to_string(byte type,int style)
|
|||
}
|
||||
|
||||
#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)
|
||||
OSVERSIONINFO osvi;
|
||||
|
@ -278,7 +279,14 @@ static const char *get_default_photo_command(void)
|
|||
#elif defined(__riscos__)
|
||||
return "Filer_Run %I";
|
||||
#else
|
||||
return "xloadimage -fork -quiet -title 'KeyID 0x%k' stdin";
|
||||
if(path_access("xloadimage",X_OK)==0)
|
||||
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
|
||||
|
@ -316,6 +324,12 @@ void show_photos(const struct user_attribute *attrs,
|
|||
opt.photo_viewer=get_default_photo_command();
|
||||
#endif
|
||||
|
||||
if(!*opt.photo_viewer)
|
||||
{
|
||||
log_info(_("no photo viewer set\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* make command grow */
|
||||
command=pct_expando(opt.photo_viewer,&args);
|
||||
if(!command)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue