Detect version suffix based on release cycle and version char
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 13 Jun 2014 14:19:02 +0000 (20:19 +0600)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 13 Jun 2014 14:19:02 +0000 (20:19 +0600)
Should make it less error-prone for release tagging/ahoy.

source/blender/windowmanager/intern/wm_operators.c

index 6261f1d271f6c1f0518b799096985c7f27fbce53..a405e6d5d632bc92b1004efe948c9dbf181b9e56 100644 (file)
@@ -1774,6 +1774,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
        int i;
        MenuType *mt = WM_menutype_find("USERPREF_MT_splash", true);
        char url[96];
+       const char *version_suffix = NULL;
 
 #ifndef WITH_HEADLESS
        extern char datatoc_splash_png[];
@@ -1828,15 +1829,19 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar
 
        /* label for 'a' bugfix releases, or 'Release Candidate 1'...
         *  avoids recreating splash for version updates */
-       if (1) {
+       if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "rc")) {
+               version_suffix = "Release Candidate";
+       }
+       else if (STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "release")) {
+               version_suffix = STRINGIFY(BLENDER_VERSION_CHAR);
+       }
+       if (version_suffix != NULL && version_suffix[0]) {
                /* placed after the version number in the image,
                 * placing y is tricky to match baseline */
                int x = 260 - (2 * UI_DPI_WINDOW_FAC);
                int y = 242 + (4 * UI_DPI_WINDOW_FAC);
                int w = 240;
 
-               const char *version_suffix = "Release Candidate";
-
                /* hack to have text draw 'text_sel' */
                uiBlockSetEmboss(block, UI_EMBOSSN);
                but = uiDefBut(block, LABEL, 0, version_suffix, x * U.pixelsize, y * U.pixelsize, w * U.pixelsize, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL);