瀏覽代碼

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 年之前
父節點
當前提交
5c9cf1fba1
共有 1 個文件被更改,包括 4 次插入1 次删除
  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);