Browse Source

UI: Convert QTStr macro to inline function

Using inline functions improves IDE integration and avoids potential
pitfalls of that using macros has.

(cherry picked from commit 44f3f7929678292f2680f1962ceddefa9766d590)
gxalpha 2 năm trước cách đây
mục cha
commit
5c9cf1fba1
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      UI/obs-app.hpp

+ 4 - 1
UI/obs-app.hpp

@@ -250,7 +250,10 @@ inline const char *Str(const char *lookup)
 {
 	return App()->GetString(lookup);
 }
-#define QTStr(lookupVal) QString::fromUtf8(Str(lookupVal))
+inline QString QTStr(const char *lookupVal)
+{
+	return QString::fromUtf8(Str(lookupVal));
+}
 
 bool GetFileSafeName(const char *name, std::string &file);
 bool GetClosestUnusedFileName(std::string &path, const char *extension);