Просмотр исходного кода

New naming fixes part 1

thanks @Willy-JL !
MX 2 лет назад
Родитель
Сommit
bca106015b
1 измененных файлов с 2 добавлено и 7 удалено
  1. 2 7
      view_info.c

+ 2 - 7
view_info.c

@@ -3,7 +3,7 @@
 
 #include "app.h"
 #include <gui/view.h>
-#include <lib/toolbox/random_name.h>
+#include <toolbox/name_generator.h>
 
 /* This view has subviews accessible navigating up/down. This
  * enumaration is used to track the currently active subview. */
@@ -166,12 +166,7 @@ void str_replace(char* buf, char c1, char c2) {
 
 /* Set a random filename the user can edit. */
 void set_signal_random_filename(ProtoViewApp* app, char* buf, size_t buflen) {
-    char suffix[6];
-    set_random_name(suffix, sizeof(suffix));
-    snprintf(buf, buflen, "%.10s-%s-%d", app->msg_info->decoder->name, suffix, rand() % 1000);
-    str_replace(buf, ' ', '_');
-    str_replace(buf, '-', '_');
-    str_replace(buf, '/', '_');
+    name_generator_make_auto(buf, buflen, app->msg_info->decoder->name);
 }
 
 /* ========================== Signal transmission =========================== */