summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/icons/application/default.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/application/gnu-zip-unix.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/document/postscript.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/document/unknown.dbbin49152 -> 49152 bytes
-rw-r--r--data/icons/ext2/default.dbbin49152 -> 49152 bytes
-rw-r--r--data/icons/image/default.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/image/gif.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/image/jpeg-jfif-standard.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/image/jpeg.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/image/png.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/image/xpm.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/text/default.dbbin0 -> 49152 bytes
-rw-r--r--data/icons/text/plain.dbbin0 -> 49152 bytes
-rw-r--r--src/fs.c4
-rw-r--r--src/icons.c2
-rw-r--r--src/view.c145
16 files changed, 87 insertions, 64 deletions
diff --git a/data/icons/application/default.db b/data/icons/application/default.db
new file mode 100644
index 000000000..255fc4dc6
--- /dev/null
+++ b/data/icons/application/default.db
Binary files differ
diff --git a/data/icons/application/gnu-zip-unix.db b/data/icons/application/gnu-zip-unix.db
new file mode 100644
index 000000000..636960488
--- /dev/null
+++ b/data/icons/application/gnu-zip-unix.db
Binary files differ
diff --git a/data/icons/document/postscript.db b/data/icons/document/postscript.db
new file mode 100644
index 000000000..b33890874
--- /dev/null
+++ b/data/icons/document/postscript.db
Binary files differ
diff --git a/data/icons/document/unknown.db b/data/icons/document/unknown.db
index 255fc4dc6..ea0310962 100644
--- a/data/icons/document/unknown.db
+++ b/data/icons/document/unknown.db
Binary files differ
diff --git a/data/icons/ext2/default.db b/data/icons/ext2/default.db
index 50ee2cef9..b99e09608 100644
--- a/data/icons/ext2/default.db
+++ b/data/icons/ext2/default.db
Binary files differ
diff --git a/data/icons/image/default.db b/data/icons/image/default.db
new file mode 100644
index 000000000..255fc4dc6
--- /dev/null
+++ b/data/icons/image/default.db
Binary files differ
diff --git a/data/icons/image/gif.db b/data/icons/image/gif.db
new file mode 100644
index 000000000..759e525ef
--- /dev/null
+++ b/data/icons/image/gif.db
Binary files differ
diff --git a/data/icons/image/jpeg-jfif-standard.db b/data/icons/image/jpeg-jfif-standard.db
new file mode 100644
index 000000000..399e8d99f
--- /dev/null
+++ b/data/icons/image/jpeg-jfif-standard.db
Binary files differ
diff --git a/data/icons/image/jpeg.db b/data/icons/image/jpeg.db
new file mode 100644
index 000000000..399e8d99f
--- /dev/null
+++ b/data/icons/image/jpeg.db
Binary files differ
diff --git a/data/icons/image/png.db b/data/icons/image/png.db
new file mode 100644
index 000000000..a855598d2
--- /dev/null
+++ b/data/icons/image/png.db
Binary files differ
diff --git a/data/icons/image/xpm.db b/data/icons/image/xpm.db
new file mode 100644
index 000000000..5e1496fee
--- /dev/null
+++ b/data/icons/image/xpm.db
Binary files differ
diff --git a/data/icons/text/default.db b/data/icons/text/default.db
new file mode 100644
index 000000000..255fc4dc6
--- /dev/null
+++ b/data/icons/text/default.db
Binary files differ
diff --git a/data/icons/text/plain.db b/data/icons/text/plain.db
new file mode 100644
index 000000000..e1f560cc8
--- /dev/null
+++ b/data/icons/text/plain.db
Binary files differ
diff --git a/src/fs.c b/src/fs.c
index 8bd79b575..70846b3c6 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -10,7 +10,7 @@ _e_fs_fd_handle(int fd)
10{ 10{
11 double start, current; 11 double start, current;
12 12
13 printf("############## fs event...\n"); 13/* printf("############## fs event...\n"); */
14 start = e_get_time(); 14 start = e_get_time();
15 while ((ec) && efsd_events_pending(ec)) 15 while ((ec) && efsd_events_pending(ec))
16 { 16 {
@@ -47,7 +47,7 @@ _e_fs_fd_handle(int fd)
47 break; 47 break;
48 } 48 }
49 } 49 }
50 printf("############## fs done\n"); 50/* printf("############## fs done\n"); */
51} 51}
52 52
53void 53void
diff --git a/src/icons.c b/src/icons.c
index c4ed447a8..59e8e16ce 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -75,7 +75,7 @@ e_icon_new(void)
75 icon = NEW(E_Icon, 1); 75 icon = NEW(E_Icon, 1);
76 ZERO(icon, E_Icon, 1); 76 ZERO(icon, E_Icon, 1);
77 OBJ_INIT(icon, e_icon_free); 77 OBJ_INIT(icon, e_icon_free);
78 icon->info.icon.normal = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/normal"); 78 icon->info.icon.normal = strdup(PACKAGE_DATA_DIR"/data/icons/unknown/default.db:/icon/normal");
79 icon->previous.state.clicked = -1; 79 icon->previous.state.clicked = -1;
80 return icon; 80 return icon;
81} 81}
diff --git a/src/view.c b/src/view.c
index 9bde051c9..73b08f4bf 100644
--- a/src/view.c
+++ b/src/view.c
@@ -422,30 +422,17 @@ e_view_file_added(int id, char *file)
422 /* char buf[4096]; */ 422 /* char buf[4096]; */
423 423
424 /* if we get a path - ignore it - its not a file in the a dir */ 424 /* if we get a path - ignore it - its not a file in the a dir */
425 printf("e_view_file_added(%i, \"%s\");\n", id, file);
426 if (!file) return; 425 if (!file) return;
427 if (file[0] == '/') return; 426 if (file[0] == '/') return;
428 v = e_view_find_by_monitor_id(id); 427 v = e_view_find_by_monitor_id(id);
429 if (!v) return; 428 if (!v) return;
430 /* filter files here */ 429 /* filter files here */
431 if (!e_view_filter_file(v, file)) return; 430 if (!e_view_filter_file(v, file)) return;
431 printf("e_view_file_added(%i, \"%s\");\n", id, file);
432 icon = e_icon_new(); 432 icon = e_icon_new();
433 e_icon_set_filename(icon, file); 433 e_icon_set_filename(icon, file);
434 e_view_add_icon(v, icon); 434 e_view_add_icon(v, icon);
435 435
436 /*
437 sprintf(buf, "%s/%s", v->dir, file);
438 if (efsd_ready(e_fs_get_connection()))
439 {
440 printf("Stating %s\n", buf);
441 efsd_stat(e_fs_get_connection(), buf);
442 }
443 else
444 {
445 printf("*********** EEEEEEEEEEEEEEEEEK Efsd not ready.\n");
446 }
447 */
448
449 v->changed = 1; 436 v->changed = 1;
450} 437}
451 438
@@ -456,11 +443,14 @@ e_view_file_deleted(int id, char *file)
456 E_View *v; 443 E_View *v;
457 /* char *realfile; */ 444 /* char *realfile; */
458 445
459 printf("e_view_file_deleted(%i, \"%s\");\n", id, file);
460 v = e_view_find_by_monitor_id(id); 446 v = e_view_find_by_monitor_id(id);
461 if (!v) return; 447 if (!v) return;
462 icon = e_view_find_icon_by_file(v, file); 448 icon = e_view_find_icon_by_file(v, file);
463 if (icon) e_view_del_icon(v, icon); 449 if (icon)
450 {
451 e_view_del_icon(v, icon);
452 printf("e_view_file_deleted(%i, \"%s\");\n", id, file);
453 }
464} 454}
465 455
466E_Icon * 456E_Icon *
@@ -536,15 +526,15 @@ e_view_handle_fs(EfsdEvent *ev)
536 ev->efsd_filechange_event.file); 526 ev->efsd_filechange_event.file);
537 break; 527 break;
538 case EFSD_CHANGE_CHANGED: 528 case EFSD_CHANGE_CHANGED:
539 printf("EFSD_CHANGE_CHANGED: %i %s\n", 529/* printf("EFSD_CHANGE_CHANGED: %i %s\n",
540 ev->efsd_filechange_event.id, 530 ev->efsd_filechange_event.id,
541 ev->efsd_filechange_event.file); 531 ev->efsd_filechange_event.file);
542 break; 532*/ break;
543 case EFSD_CHANGE_MOVED: 533 case EFSD_CHANGE_MOVED:
544 printf("EFSD_CHANGE_MOVED: %i %s\n", 534/* printf("EFSD_CHANGE_MOVED: %i %s\n",
545 ev->efsd_filechange_event.id, 535 ev->efsd_filechange_event.id,
546 ev->efsd_filechange_event.file); 536 ev->efsd_filechange_event.file);
547 break; 537*/ break;
548 case EFSD_CHANGE_END_EXISTS: 538 case EFSD_CHANGE_END_EXISTS:
549 printf("EFSD_CHANGE_END_EXISTS: %i %s\n", 539 printf("EFSD_CHANGE_END_EXISTS: %i %s\n",
550 ev->efsd_filechange_event.id, 540 ev->efsd_filechange_event.id,
@@ -569,16 +559,83 @@ e_view_handle_fs(EfsdEvent *ev)
569 break; 559 break;
570 case EFSD_CMD_CHMOD: 560 case EFSD_CMD_CHMOD:
571 break; 561 break;
562 case EFSD_CMD_GETMIME:
563/* printf("Getmime event %i\n",
564 ev->efsd_reply_event.command.efsd_file_cmd.id);
565*/ if (ev->efsd_reply_event.status == SUCCESS)
566 {
567 E_Icon *icon;
568
569 icon = e_view_find_icon_by_path(ev->efsd_reply_event.command.efsd_file_cmd.file);
570 if (icon)
571 {
572 char m1[4096], m2[4096], *p;
573
574 /* figure out icons to use */
575 strcpy(m1, (char*)ev->efsd_reply_event.data);
576 p = strchr(m1, '/');
577 if (p) *p = 0;
578 p = strchr((char*)ev->efsd_reply_event.data, '/');
579 if (p) strcpy(m2, &(p[1]));
580 else m2[0] = 0;
581 icon->info.mime.base = strdup(m1);
582 icon->info.mime.type = strdup(m2);
583
584 printf("%s: %s/%s\n", icon->file, icon->info.mime.base, icon->info.mime.type);
585 sprintf(m1, "%s/data/icons/%s/%s.db",PACKAGE_DATA_DIR,
586 icon->info.mime.base,
587 icon->info.mime.type);
588 if (!e_file_exists(m1))
589 {
590 printf("fallback 1\n");
591 sprintf(m1, "%s/data/icons/%s/default.db",PACKAGE_DATA_DIR,
592 icon->info.mime.base);
593 if (!e_file_exists(m1))
594 {
595 printf("fallback 2\n");
596 sprintf(m1, "%s/data/icons/unknown/unknown.db",PACKAGE_DATA_DIR);
597 if (!e_file_exists(m1))
598 {
599 printf("fallback 3\n");
600 sprintf(m1, "%s/data/icons/unknown/default.db",PACKAGE_DATA_DIR);
601 }
602 }
603 }
604 IF_FREE(icon->info.icon.normal);
605 IF_FREE(icon->info.icon.selected);
606 IF_FREE(icon->info.icon.clicked);
607 sprintf(m2, "%s:/icon/normal", m1);
608 icon->info.icon.normal = strdup(m2);
609 sprintf(m2, "%s:/icon/selected", m1);
610 icon->info.icon.selected = strdup(m2);
611 sprintf(m2, "%s:/icon/clicked", m1);
612 icon->info.icon.clicked = strdup(m2);
613 if (icon->info.link)
614 {
615/* icon->info.icon.normal = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/normal");
616 icon->info.icon.selected = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/selected");
617 icon->info.icon.clicked = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/clicked");
618*/ }
619 e_icon_pre_show(icon);
620 }
621 }
622 break;
572 case EFSD_CMD_STAT: 623 case EFSD_CMD_STAT:
573 printf("Stat event %i stating file %s\n", 624/* printf("Stat event %i stating file %s\n",
574 ev->efsd_reply_event.command.efsd_file_cmd.id, 625 ev->efsd_reply_event.command.efsd_file_cmd.id,
575 ev->efsd_reply_event.command.efsd_file_cmd.file); 626 ev->efsd_reply_event.command.efsd_file_cmd.file);
576 { 627*/ {
577 struct stat *st; 628 struct stat *st;
578 E_Icon *icon; 629 E_Icon *icon;
579 630
580 st = (struct stat*) ev->efsd_reply_event.data; 631 st = (struct stat*) ev->efsd_reply_event.data;
581 632
633 icon = e_view_find_icon_by_path(ev->efsd_reply_event.command.efsd_file_cmd.file);
634 if (icon)
635 {
636 char f[4096];
637
638/*
582 if (S_ISREG(st->st_mode)) 639 if (S_ISREG(st->st_mode))
583 printf("%s is a regular file.\n", 640 printf("%s is a regular file.\n",
584 ev->efsd_reply_event.command.efsd_file_cmd.file); 641 ev->efsd_reply_event.command.efsd_file_cmd.file);
@@ -588,12 +645,7 @@ e_view_handle_fs(EfsdEvent *ev)
588 if (S_ISDIR(st->st_mode)) 645 if (S_ISDIR(st->st_mode))
589 printf("%s is a directory.\n", 646 printf("%s is a directory.\n",
590 ev->efsd_reply_event.command.efsd_file_cmd.file); 647 ev->efsd_reply_event.command.efsd_file_cmd.file);
591 icon = e_view_find_icon_by_path(ev->efsd_reply_event.command.efsd_file_cmd.file); 648*/ sprintf(f, "%s/%s", icon->view->dir, icon->file);
592 if (icon)
593 {
594 char f[4096];
595
596 sprintf(f, "%s/%s", icon->view->dir, icon->file);
597 /* should get mime type here */ 649 /* should get mime type here */
598 /* perhaps this flag should be part of the mime? */ 650 /* perhaps this flag should be part of the mime? */
599 if (S_ISDIR(st->st_mode)) icon->info.is_dir = 1; 651 if (S_ISDIR(st->st_mode)) icon->info.is_dir = 1;
@@ -604,44 +656,14 @@ e_view_handle_fs(EfsdEvent *ev)
604 efsd_readlink(e_fs_get_connection(), f); 656 efsd_readlink(e_fs_get_connection(), f);
605 } 657 }
606 icon->info.is_exe = e_file_can_exec(st); 658 icon->info.is_exe = e_file_can_exec(st);
607 /* figure out icons to use */
608 IF_FREE(icon->info.icon.normal);
609 IF_FREE(icon->info.icon.selected);
610 IF_FREE(icon->info.icon.clicked);
611 if (icon->info.is_dir)
612 {
613 icon->info.icon.normal = strdup(PACKAGE_DATA_DIR"/data/icons/directory/default.db:/icon/normal");
614 icon->info.icon.selected = strdup(PACKAGE_DATA_DIR"/data/icons/directory/default.db:/icon/selected");
615 icon->info.icon.clicked = strdup(PACKAGE_DATA_DIR"/data/icons/directory/default.db:/icon/clicked");
616 }
617 else if (icon->info.link)
618 {
619 icon->info.icon.normal = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/normal");
620 icon->info.icon.selected = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/selected");
621 icon->info.icon.clicked = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/clicked");
622 }
623 else if (icon->info.is_exe)
624 {
625 icon->info.icon.normal = strdup(PACKAGE_DATA_DIR"/data/icons/executable/default.db:/icon/normal");
626 icon->info.icon.selected = strdup(PACKAGE_DATA_DIR"/data/icons/executable/default.db:/icon/selected");
627 icon->info.icon.clicked = strdup(PACKAGE_DATA_DIR"/data/icons/executable/default.db:/icon/clicked");
628 }
629 else
630 {
631 icon->info.icon.normal = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/normal");
632 icon->info.icon.selected = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/selected");
633 icon->info.icon.clicked = strdup(PACKAGE_DATA_DIR"/data/icons/file/default.db:/icon/clicked");
634 }
635 icon->changed = 1; 659 icon->changed = 1;
636 icon->view->changed = 1; 660 icon->view->changed = 1;
637 if (!icon->info.link_get_id) 661/* if (!icon->info.link_get_id)
638 e_icon_pre_show(icon); 662 e_icon_pre_show(icon);*/
639 } 663 }
640 } 664 }
641 break; 665 break;
642 case EFSD_CMD_READLINK: 666 case EFSD_CMD_READLINK:
643 printf("Readlink event %i\n",
644 ev->efsd_reply_event.command.efsd_file_cmd.id);
645 if (ev->efsd_reply_event.status == SUCCESS) 667 if (ev->efsd_reply_event.status == SUCCESS)
646 { 668 {
647 Evas_List l; 669 Evas_List l;
@@ -779,7 +801,8 @@ e_view_set_dir(E_View *v, char *dir)
779 801
780 /* v->monitor_id = efsd_start_monitor(e_fs_get_connection(), v->dir); */ 802 /* v->monitor_id = efsd_start_monitor(e_fs_get_connection(), v->dir); */
781 v->monitor_id = efsd_start_monitor(e_fs_get_connection(), v->dir, 803 v->monitor_id = efsd_start_monitor(e_fs_get_connection(), v->dir,
782 1, efsd_op_get_stat()); 804 2, efsd_op_get_stat(),
805 efsd_op_get_mimetype());
783 v->is_listing = 1; 806 v->is_listing = 1;
784 v->changed = 1; 807 v->changed = 1;
785} 808}