summaryrefslogtreecommitdiff
path: root/handler.c
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-12 10:54:05 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2021-07-12 10:54:05 +0800
commite5429cf6eb8f83be50b4fb7d764375f7c3713265 (patch)
treef5a400d5b7373350544c57a212e8f458d8a0b581 /handler.c
parentb3f865c86c7a000efec39222c4c22b53f757f1b6 (diff)
Link view to give it some delay
before user goes to their catalog. Update the handler to conform to the updated shop results page. Make the stack push relation more generic, that what view gets pushed is decided in the C++ controller, not the QML views. Refactor code.
Diffstat (limited to 'handler.c')
-rw-r--r--handler.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/handler.c b/handler.c
index 118519d..37469ba 100644
--- a/handler.c
+++ b/handler.c
@@ -1,8 +1,11 @@
+#include <stdio.h>
#include <stdbool.h>
#include <tidy.h>
#include <tidybuffio.h>
#include <icclient.h>
+#define SUBDIR "/items"
+
static void recurse_catalog(TidyDoc doc, TidyNode tnod, const char *image_dir,
struct icclient_catalog **catalog)
{
@@ -14,8 +17,8 @@ static void recurse_catalog(TidyDoc doc, TidyNode tnod, const char *image_dir,
recurse_catalog(doc, child, image_dir, catalog);
continue;
}
- static const char *subdir = "/thumb/";
- char prefix[strlen(image_dir) + strlen(subdir) + 1];
+ char prefix[strlen(image_dir) + strlen(SUBDIR) + 1];
+ sprintf(prefix, "%s%s", image_dir, SUBDIR);
size_t prefix_len = strlen(prefix);
bool bail = false;
for (TidyAttr attr = tidyAttrFirst(child); attr; attr = tidyAttrNext(attr))