result list: show preview and edit links only when they can be used

This commit is contained in:
dockes
2006-03-29 13:08:08 +00:00
parent 516a588d04
commit b42df0c260
9 changed files with 93 additions and 17 deletions
+13 -1
View File
@@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.17 2006-03-20 16:05:41 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: mimehandler.cpp,v 1.18 2006-03-29 13:08:08 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
/*
* This program is free software; you can redistribute it and/or modify
@@ -98,3 +98,15 @@ MimeHandler *getMimeHandler(const string &mtype, RclConfig *cfg)
return 0;
}
}
/// Can this mime type be interned (according to config) ?
bool canIntern(const std::string mtype, RclConfig *cfg)
{
if (mtype.empty())
return false;
string hs = cfg->getMimeHandlerDef(mtype);
if (hs.empty())
return false;
return true;
}
+4 -1
View File
@@ -16,7 +16,7 @@
*/
#ifndef _MIMEHANDLER_H_INCLUDED_
#define _MIMEHANDLER_H_INCLUDED_
/* @(#$Id: mimehandler.h,v 1.11 2006-01-30 11:15:27 dockes Exp $ (C) 2004 J.F.Dockes */
/* @(#$Id: mimehandler.h,v 1.12 2006-03-29 13:08:08 dockes Exp $ (C) 2004 J.F.Dockes */
#include <string>
#include <list>
@@ -71,4 +71,7 @@ class MimeHandler {
*/
extern MimeHandler *getMimeHandler(const std::string &mtyp, RclConfig *cfg);
/// Can this mime type be interned ?
extern bool canIntern(const std::string mimetype, RclConfig *cfg);
#endif /* _MIMEHANDLER_H_INCLUDED_ */