diff options
Diffstat (limited to 'src/upload.c')
-rw-r--r-- | src/upload.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/upload.c b/src/upload.c index 0e3a3edc..d8bf831c 100644 --- a/src/upload.c +++ b/src/upload.c | |||
@@ -376,6 +376,7 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy, | |||
376 | EXTRACTOR_KeywordType type; | 376 | EXTRACTOR_KeywordType type; |
377 | char * config; | 377 | char * config; |
378 | struct ECRS_URI * keywordURI; | 378 | struct ECRS_URI * keywordURI; |
379 | struct ECRS_URI * gkeywordURI; | ||
379 | const char * stype; | 380 | const char * stype; |
380 | GdkPixbuf * pixbuf; | 381 | GdkPixbuf * pixbuf; |
381 | GdkPixbufLoader * loader; | 382 | GdkPixbufLoader * loader; |
@@ -385,6 +386,7 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy, | |||
385 | char ** keywords; | 386 | char ** keywords; |
386 | unsigned int kpos; | 387 | unsigned int kpos; |
387 | unsigned int ksize; | 388 | unsigned int ksize; |
389 | const char * filenamerest; | ||
388 | 390 | ||
389 | extractors = EXTRACTOR_loadDefaultLibraries(); | 391 | extractors = EXTRACTOR_loadDefaultLibraries(); |
390 | config = getConfigurationString("FS", | 392 | config = getConfigurationString("FS", |
@@ -450,6 +452,13 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy, | |||
450 | ECRS_extractMetaData(meta, | 452 | ECRS_extractMetaData(meta, |
451 | filename, | 453 | filename, |
452 | extractors); | 454 | extractors); |
455 | filenamerest = &filename[strlen(filename)-1]; | ||
456 | while ( (filenamerest > filename) && | ||
457 | (filenamerest[-1] != DIR_SEPARATOR) ) | ||
458 | filenamerest--; | ||
459 | ECRS_addToMetaData(meta, | ||
460 | EXTRACTOR_FILENAME, | ||
461 | filenamerest); | ||
453 | ECRS_getMetaData(meta, | 462 | ECRS_getMetaData(meta, |
454 | (ECRS_MetaDataIterator) &publishMetaData, | 463 | (ECRS_MetaDataIterator) &publishMetaData, |
455 | metamodel); | 464 | metamodel); |
@@ -580,13 +589,12 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy, | |||
580 | marker++; | 589 | marker++; |
581 | GNUNET_ASSERT(marker != 0); | 590 | GNUNET_ASSERT(marker != 0); |
582 | } | 591 | } |
592 | /* recode */ | ||
593 | binary[wpos++] = marker; | ||
594 | for (i=pos;i<end;i++) | ||
595 | binary[wpos++] = thumb[i] == 0 ? marker : thumb[i]; | ||
596 | pos = end; | ||
583 | } | 597 | } |
584 | /* recode */ | ||
585 | binary[wpos++] = marker; | ||
586 | for (i=pos;i<end;i++) | ||
587 | binary[wpos++] = thumb[i] == 0 ? marker : thumb[i]; | ||
588 | pos = end; | ||
589 | |||
590 | binary[wpos++] = 0; /* 0-termination! */ | 598 | binary[wpos++] = 0; /* 0-termination! */ |
591 | free(thumb); | 599 | free(thumb); |
592 | ECRS_addToMetaData(meta, | 600 | ECRS_addToMetaData(meta, |
@@ -594,7 +602,6 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy, | |||
594 | binary); | 602 | binary); |
595 | FREE(binary); | 603 | FREE(binary); |
596 | } | 604 | } |
597 | g_object_unref(pixbuf); | ||
598 | } | 605 | } |
599 | } | 606 | } |
600 | keywords = NULL; | 607 | keywords = NULL; |
@@ -628,13 +635,15 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy, | |||
628 | 0); | 635 | 0); |
629 | 636 | ||
630 | if (doRec) { | 637 | if (doRec) { |
638 | gkeywordURI = ECRS_stringToUri(ECRS_URI_PREFIX | ||
639 | ECRS_SEARCH_INFIX); | ||
631 | FSUI_uploadAll(ctx, | 640 | FSUI_uploadAll(ctx, |
632 | filename, | 641 | filename, |
633 | getConfigurationInt("FS", | 642 | getConfigurationInt("FS", |
634 | "ANONYMITY"), /* FIXME */ | 643 | "ANONYMITY"), /* FIXME */ |
635 | doIndex, | 644 | doIndex, |
636 | meta, | 645 | meta, |
637 | keywordURI, | 646 | gkeywordURI, |
638 | keywordURI); | 647 | keywordURI); |
639 | } else { | 648 | } else { |
640 | FSUI_upload(ctx, | 649 | FSUI_upload(ctx, |