]> git.datanom.net - lensdb.git/blobdiff - src/main.c
Import and overwrite
[lensdb.git] / src / main.c
index d5c1bc47f8149977386b71076bc220b5f58d995d..468ed1726145e0de2c52a2f14b81523508ca70ed 100644 (file)
 #include <stdio.h>
 #include "sqlite-storage.h"
 #include "gui.h"
+#include "csv.h"
 #include "lib/scanner.h"
 
 gint main(gint argc, gchar** argv) {
        gint status = 0;
-
-       //gchar* path = g_path_get_dirname(argv[0]);
-       gchar* path = g_build_filename(g_get_user_config_dir(), PACKAGE, NULL); //g_strconcat(g_get_home_dir(), "/.local/share/", PACKAGE, NULL);
+       gchar* path = g_build_filename(g_get_user_config_dir(), PACKAGE, NULL);
        if (!g_file_test(path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
                if (g_mkdir(path, 0766)) {
                        fprintf(stderr, "%s: Failed to create dir for database\n", path);
+                       g_free(path);
                        return EXIT_FAILURE;
                }
        }
@@ -50,9 +50,11 @@ gint main(gint argc, gchar** argv) {
        } else {
                gtk_init(&argc, &argv);
                if (init_gui()) {
+                       g_free(path);
+                       close_storage();
                        gchar* err = g_strdup_printf("Failed initializing GUI\n");
                        fprintf(stderr, err);
-                       show_err_msg(GTK_MESSAGE_ERROR, err);
+                       show_message(GTK_MESSAGE_ERROR, err);
                        g_free(err);
                        return EXIT_FAILURE;
                }
This page took 0.546213 seconds and 5 git commands to generate.