mirror of https://github.com/KLayout/klayout.git
Enabling Qt-less DB plugins for Qt-enabled applications
This commit is contained in:
parent
eb3be68030
commit
f3cc7cadc0
|
|
@ -119,12 +119,12 @@ std::string tr (const char *s)
|
|||
|
||||
}
|
||||
|
||||
#if ! defined(HAVE_QT)
|
||||
|
||||
std::string tr (const char *s)
|
||||
std::string tr_fallback (const char *s)
|
||||
{
|
||||
#if defined(HAVE_QT)
|
||||
return tl::to_string (QObject::tr (s));
|
||||
#else
|
||||
// TODO: this is a fallback implementation without translation
|
||||
return std::string (s);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,18 @@ inline QString tr (const char *s)
|
|||
return QObject::tr (s);
|
||||
}
|
||||
#else
|
||||
std::string TL_PUBLIC tr (const char *s);
|
||||
|
||||
// NOTE: with this definition in place, we can build plugins without Qt,
|
||||
// by using "tr" and falling back here, even if Qt is enabled
|
||||
|
||||
#define __KLAYOUT_TL_HAVE_TR_FALLBACK
|
||||
std::string TL_PUBLIC tr_fallback (const char *s);
|
||||
|
||||
inline std::string tr (const char *s)
|
||||
{
|
||||
return tl::tr_fallback (s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
namespace tl
|
||||
|
|
|
|||
Loading…
Reference in New Issue