simplify conky_version and co. a bit
authorPhil Sutter <phil@nwl.cc>
Mon, 16 Nov 2009 00:37:45 +0000 (01:37 +0100)
committerPhil Sutter <phil@nwl.cc>
Thu, 19 Nov 2009 23:03:15 +0000 (00:03 +0100)
src/conky.c
src/core.c

index bd54960..551bfb7 100644 (file)
@@ -955,15 +955,6 @@ void generate_text_internal(char *p, int p_max_size,
                                new_fg(p, color9);
                        }
 #endif /* X11 */
-                       OBJ(conky_version) {
-                               snprintf(p, p_max_size, "%s", VERSION);
-                       }
-                       OBJ(conky_build_date) {
-                               snprintf(p, p_max_size, "%s", BUILD_DATE);
-                       }
-                       OBJ(conky_build_arch) {
-                               snprintf(p, p_max_size, "%s", BUILD_ARCH);
-                       }
 #if defined(__linux__)
                        OBJ(disk_protect) {
                                snprintf(p, p_max_size, "%s",
index 98e9b0e..5c886ad 100644 (file)
@@ -439,8 +439,14 @@ struct text_object *construct_text_object(const char *s, const char *arg, long
                obj->data.s = scan_font(arg);
 #endif /* X11 */
        END OBJ(conky_version, 0)
+               obj->type = OBJ_text;
+               obj->data.s = strdup(VERSION);
        END OBJ(conky_build_date, 0)
+               obj->type = OBJ_text;
+               obj->data.s = strdup(BUILD_DATE);
        END OBJ(conky_build_arch, 0)
+               obj->type = OBJ_text;
+               obj->data.s = strdup(BUILD_ARCH);
        END OBJ(downspeed, &update_net_stats)
                parse_net_stat_arg(obj, arg, free_at_crash);
        END OBJ(downspeedf, &update_net_stats)