Enlightenment CVS committal

Author  : titan
Project : e17
Module  : proto

Dir     : e17/proto/ephoto/src


Modified Files:
        ephoto.c ephoto_callbacks.c 


Log Message:
Get up to date.

===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/ephoto.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -3 -r1.59 -r1.60
--- ephoto.c    20 Jul 2006 05:12:39 -0000      1.59
+++ ephoto.c    20 Jul 2006 06:23:02 -0000      1.60
@@ -7,10 +7,7 @@
  char *home;
  char *name;
  char ephoto_path[PATH_MAX];
- char album_path[PATH_MAX];
- char slideshow_path[PATH_MAX];
- char album_library[PATH_MAX];
- char slideshow_library[PATH_MAX];
+ char database[PATH_MAX];
  int argint = 1;
  Ecore_List *files; 
  sqlite3 *db;
@@ -28,10 +25,8 @@
 
  home = getenv("HOME");
  snprintf(ephoto_path, PATH_MAX, "%s/.ephoto", home);
- snprintf(album_path, PATH_MAX, "%s/.ephoto/albums", home);
- snprintf(slideshow_path, PATH_MAX, "%s/.ephoto/slideshows", home);
- snprintf(album_library, PATH_MAX, "%s/Complete Library", album_path);
- snprintf(slideshow_library, PATH_MAX, "%s/Complete Library Slideshow", 
slideshow_path);
+ snprintf(database, PATH_MAX, "%s/ephoto_database", ephoto_path);
+ 
  m = calloc(1, sizeof(Main));
  
  if (!ecore_file_exists(ephoto_path))
@@ -39,27 +34,25 @@
   ecore_file_mkdir(ephoto_path);
  }
 
- if (!ecore_file_exists(album_path))
- {
-  ecore_file_mkdir(album_path);
- }
-
- if (!ecore_file_exists(slideshow_path))
- {
-  ecore_file_mkdir(slideshow_path);
- }
-
- if (!ecore_file_exists(album_library))
- {
-  sqlite3_open(album_library, &db);
-  sqlite3_exec(db, "create table images(images varchar(255));", NULL, 0, 0);
-  sqlite3_close(db);
- }
-
- if (!ecore_file_exists(slideshow_library))
+ if (!ecore_file_exists(database))
  {
-  sqlite3_open(slideshow_library, &db);
-  sqlite3_exec(db, "create table slideshows(images varchar(255), settings 
varchar(255));", NULL, 0, 0);
+  sqlite3_open(database, &db);
+  sqlite3_exec(db, "create table albums(id int AUTOINCREMENT primary key,"
+                                       "name varchar(255));", NULL, 0, 0);
+  sqlite3_exec(db, "create table a_images(id int AUTOINCREMENT primary key,"
+                                       "name varchar(255));", NULL, 0, 0);
+  sqlite3_exec(db, "create table albums_full(id int AUTOINCREMENT primary 
key," 
+                               "alubm_id int, image_id int);", NULL, 0, 0);
+  sqlite3_exec(db, "create table slideshows(id int AUTOINCREMENT primary key," 
+                                       "name varchar(255));", NULL, 0, 0);
+  sqlite3_exec(db, "create table s_images(id int AUTOINCREMENT primary key,"
+                                       "name varchar(255));", NULL, 0, 0);
+  sqlite3_exec(db, "create_table slideshows_images_full(id int AUTOINCREMENT 
primary key," 
+                                       "slideshows_id int, images_id int);", 
NULL, 0, 0);
+  sqlite3_exec(db, "create table s_settings(id int AUTOINCREMENT primary key,"
+                                       "name varchar(255));", NULL, 0, 0);
+  sqlite3_exec(db, "create table slideshows_settings_full(id int AUTOINCREMENT 
primary key," 
+                                       "slideshows_id int, settings_id int);", 
NULL, 0, 0);
   sqlite3_close(db);
  }
 
@@ -168,33 +161,6 @@
  ewl_object_fill_policy_set(EWL_OBJECT(m->albums), EWL_FLAG_FILL_ALL);
  ewl_widget_show(m->albums);
 
- files = ecore_list_new();
- files = ecore_file_ls(album_path);
-
- m->icon = ewl_icon_new();
- ewl_icon_label_set(EWL_ICON(m->icon), "Complete Library");
- ewl_object_alignment_set(EWL_OBJECT(m->icon), EWL_FLAG_ALIGN_CENTER);
- ewl_callback_append(m->icon, EWL_CALLBACK_CLICKED, album_clicked_cb, NULL);
- ewl_container_child_append(EWL_CONTAINER(m->albums), m->icon);
- ewl_widget_show(m->icon);
-
- while (!ecore_list_is_empty(files))
- { 
-  name = ecore_list_remove_first(files);
-
-  if (strcmp(name, "Complete Library") != 0)
-  {
-   m->icon = ewl_icon_new();
-   ewl_icon_label_set(EWL_ICON(m->icon), name);
-   ewl_object_alignment_set(EWL_OBJECT(m->icon), EWL_FLAG_ALIGN_CENTER);
-   ewl_callback_append(m->icon, EWL_CALLBACK_CLICKED, album_clicked_cb, NULL);
-   ewl_container_child_append(EWL_CONTAINER(m->albums), m->icon);
-   ewl_widget_show(m->icon);
-  }
- }
-
- ecore_list_destroy(files);
-
  m->slideshows_border = ewl_border_new();
  ewl_border_text_set(EWL_BORDER(m->slideshows_border), "Slideshows");
  ewl_border_label_alignment_set(EWL_BORDER(m->slideshows_border), 
EWL_FLAG_ALIGN_CENTER);
@@ -208,33 +174,6 @@
  ewl_container_child_append(EWL_CONTAINER(m->slideshows_border), 
m->slideshows);
  ewl_object_fill_policy_set(EWL_OBJECT(m->slideshows), EWL_FLAG_FILL_ALL);
  ewl_widget_show(m->slideshows);
-
- files = ecore_list_new();
- files = ecore_file_ls(slideshow_path);
-
- m->icon = ewl_icon_new();
- ewl_icon_label_set(EWL_ICON(m->icon), "Complete Library Slideshow");
- ewl_object_alignment_set(EWL_OBJECT(m->icon), EWL_FLAG_ALIGN_CENTER);
- ewl_callback_append(m->icon, EWL_CALLBACK_CLICKED, slideshow_clicked_cb, 
NULL);
- ewl_container_child_append(EWL_CONTAINER(m->slideshows), m->icon);
- ewl_widget_show(m->icon);
-
- while (!ecore_list_is_empty(files))
- {
-  name = ecore_list_remove_first(files);
-  
-  if (strcmp(name, "Complete Library Slideshow") != 0)
-  {
-   m->icon = ewl_icon_new();
-   ewl_icon_label_set(EWL_ICON(m->icon), name);
-   ewl_object_alignment_set(EWL_OBJECT(m->icon), EWL_FLAG_ALIGN_CENTER);
-   ewl_callback_append(m->icon, EWL_CALLBACK_CLICKED, slideshow_clicked_cb, 
NULL);
-   ewl_container_child_append(EWL_CONTAINER(m->slideshows), m->icon);
-   ewl_widget_show(m->icon);
-  }
- }
-
- ecore_list_destroy(files);
 
  m->viewer_border = ewl_border_new();
  ewl_border_text_set(EWL_BORDER(m->viewer_border), "Viewer");
===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_callbacks.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- ephoto_callbacks.c  20 Jul 2006 05:12:39 -0000      1.1
+++ ephoto_callbacks.c  20 Jul 2006 06:23:02 -0000      1.2
@@ -29,16 +29,12 @@
  home = getenv("HOME");
  entry_text = ewl_text_text_get(EWL_TEXT(data));
 
- snprintf(album_path, PATH_MAX, "%s/.ephoto/albums/%s", home, entry_text);
+ snprintf(album_path, PATH_MAX, "%s/.ephoto/database", home);
  
  if (strcmp(entry_text, " ") != 0)
  {
   if (!ecore_file_exists(album_path))
   {
-   sqlite3_open(album_path, &db);
-   sqlite3_exec(db, "create table images(images varchar(255));", NULL, 0, 0);
-   sqlite3_close(db);
-
    m->icon = ewl_icon_new();
    ewl_icon_label_set(EWL_ICON(m->icon), entry_text);
    ewl_object_alignment_set(EWL_OBJECT(m->icon), EWL_FLAG_ALIGN_CENTER);
@@ -120,16 +116,12 @@
  home = getenv("HOME");
  entry_text = ewl_text_text_get(EWL_TEXT(data));
 
- snprintf(slideshow_path, PATH_MAX, "%s/.ephoto/slideshows/%s", home, 
entry_text);
+ snprintf(slideshow_path, PATH_MAX, "%s/.ephoto/database", home);
 
  if (strcmp(entry_text, " ") != 0)
  {
   if (!ecore_file_exists(slideshow_path))
   {
-   sqlite3_open(slideshow_path, &db);
-   sqlite3_exec(db, "create table slideshows(images varchar(255), settings 
varchar(255));", NULL, 0, 0);
-   sqlite3_close(db);
-
    m->icon = ewl_icon_new();
    ewl_icon_label_set(EWL_ICON(m->icon), entry_text);
    ewl_object_alignment_set(EWL_OBJECT(m->icon), EWL_FLAG_ALIGN_CENTER);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to