From 28c5f06597f011e9f2aa38c5ae2994d9f36b6576 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 20 Nov 2016 17:17:24 +0100 Subject: [PATCH] =?UTF-8?q?build=20system:=20remove=20obsolete=20translati?= =?UTF-8?q?on=20macros;=20simplify=20.ui=20=E2=86=92=20.h=20conversion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The removed macros are outdated and not used anymore. The simplification of the generation of .h files from .ui files is done by telling uic to use the QTR macro directly. This may be a fix for #1812. --- Rakefile | 23 +---------------------- src/common/common.h | 4 ---- src/common/qt.h | 3 +-- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/Rakefile b/Rakefile index 6bf9ca774..d67ddadd6 100755 --- a/Rakefile +++ b/Rakefile @@ -319,23 +319,7 @@ end # Qt files rule '.h' => '.ui' do |t| - temp = Tempfile.new("mkvtoolnix-uic") - begin - temp.close - - runq "uic", t.source, "#{c(:UIC)} -tr QPTR #{t.sources.join(" ")} > #{temp.path}" - - # Convert calls to QPTR(…, 0) to QT(…) - output = IO. - readlines(temp.path). - map { |line| line.force_encoding("UTF-8").gsub(/QPTR\((.+?\"), 0\)/, 'QTR(\1)') }. - join("") - - IO.write(t.name, output, encoding: "UTF-8", mode: "w") - - ensure - temp.unlink - end + runq "uic", t.source, "#{c(:UIC)} --translate QTR #{t.sources.join(" ")} > #{t.name}" end rule '.cpp' => '.qrc' do |t| @@ -376,14 +360,9 @@ file "po/mkvtoolnix.pot" => $all_sources + $all_headers + $gui_ui_h_files + %w{R keywords = %w{--keyword=Y --keyword=NY:1,2} # singular & plural forms returning std::string keywords += %w{--keyword=YF --keyword=NYF:1,2} # singular & plural forms returning std::string which aren't format strings - keywords += %w{--keyword=PY:1c,2} # singular form with context returning std::string - keywords += %w{--keyword=PNY:1c,2,3} # plural form with context returning std::string keywords += %w{--keyword=YT} # singular form returning translatable_string_c keywords += %w{--keyword=QTR} # singular form returning QString, used by uic - keywords += %w{--keyword=QPTR:2c,1} # singular form with context returning QString, used by uic keywords += %w{--keyword=QY --keyword=QNY:1,2} # singular & plural forms returning QString - keywords += %w{--keyword=QPY:1c,2} # singular form with context returning QString - keywords += %w{--keyword=QPNY:1c,2,3} # plural form with context returning QString keywords += %w{--keyword=QYH} # singular form returning HTML-escaped QString flags = %w{--flag=QY:1:no-c-format --flag=QNY:1:no-c-format} diff --git a/src/common/common.h b/src/common/common.h index f19d6097c..a7a6ed449 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -78,15 +78,11 @@ namespace brng = boost::range; # if !defined Y # define Y(s) gettext(s) # define NY(s_singular, s_plural, count) ngettext(s_singular, s_plural, count) -# define PY(context, s) pgettext(context, s) -# define PNY(context, s_singular, s_plural, count) pngettext(context, s_singular, s_plural, count) # endif #else /* HAVE_LIBINTL_H */ # if !defined Y # define Y(s) (s) # define NY(s_singular, s_plural, count) ((count) != 1 ? (s_plural) : (s_singular)) -# define PY(context, s) (s) -# define PNY(context, s_singular, s_plural, count) ((count) != 1 ? (s_plural) : (s_singular)) # endif #endif diff --git a/src/common/qt.h b/src/common/qt.h index f137e8191..61fd8965b 100644 --- a/src/common/qt.h +++ b/src/common/qt.h @@ -24,8 +24,7 @@ #define QY(s) to_qs(Y(s)) #define QYH(s) to_qs(Y(s)).toHtmlEscaped() #define QNY(singular, plural, count) to_qs(NY(singular, plural, count)) -#define QTR(s) to_qs(Y(s)) -#define QPTR(s, context) to_qs(PY(context, s)) +#define QTR(s, dummy) to_qs(Y(s)) inline QChar to_qs(char const source) {