Commit a32b6eb2 authored by Jamie McCracken's avatar Jamie McCracken

patch updates

svn path=/trunk/; revision=602
parent 7dd1c0e5
2007-06-30 Patch from Eric Lesh <eclesh@ucla.edu>
* Fixed date display when date is missing in the metadata tile
2007-06-30 Patch from Laurent Aguerreche <laurent.aguerreche@free.fr>
* Evolution mail fixes
* fix bad parsing of summary file
* used g_slice
* fixed mime type of attachments
2007-06-30 Patch from B Berteh <berteh@hotmail.com>
* Downgraded gtk and glade requirements
* Added missing functions for those with gtk 2.10
2007-06-30 Patch from Marcus Fritzsch <fritschy@googlemail.com>
* Fixed invalid double free in tracker-extract
* made sure time elapsed returns floating point value
2007-06-30 Patch from Jerry Tan <Jerry.Tan@Sun.COM>
* Fixed crasher in image extractor
* fixed coredump in ps extractor on solaris
2007-06-30 Patch from asubedi <asubedi@gmail.com>
* Added djvu filter
2007-06-30 Patch from Deji Akingunola <dakingun@gmail.com>
* Added OnlyShowIn to desktop file
* Added missing config var in configure.ac
2007-06-30 Patch from Anders Rune Jensen <anders@iola.dk>
* Fixed crasher when getting metadata
2007-06-30 Patch from Luca Bellonda <lbellonda@gmail.com>
* added use of ~ and realpath for all config filename based variables
2007-06-30 Patch from Tshepang Lekhonkhobe <tshepang@gmail.com>
* updated README and ToDo
2007-06-06 Jamie McCracken <jamiemcc at gnome org>
......@@ -24,6 +79,7 @@
2007-05-05 Jamie McCracken <jamiemcc at gnome org>
*Added application and gaim log indexing
* application indexing based on patch by Marcus Rosell
2007-04-30 Jamie McCracken <jamiemcc at gnome org>
......
......@@ -136,6 +136,7 @@ Additional recommended packages:
* libgsf
* GTK and Gnome stack for GUI tools
* libglade (for tracker-preferences UI)
* unac (accent stripper)
Optional run-time dependency:
......@@ -190,7 +191,7 @@ parameters to autogen.sh EG ./autogen.sh --disable-fam)
--enable-file-monitoring=(inotify, fam, polling, auto)
--enable-preferences : enables the tracker-preferences capplet
--disable-preferences : disables the tracker-preferences capplet
--enable-deskbar-applet : enables support for deskbar applet
......@@ -200,10 +201,15 @@ parameters to autogen.sh EG ./autogen.sh --disable-fam)
--disable-exif : disables the exif data extractor
--disable-libtrackergtk : disables the building of libtracker-gtk
--disable-gsf : disables the gsf data extractor
--disable-warnings : disables GCC warnings
--disable-unac : disables accent stripping
--disable-libtracker-gtk : disables the building of libtracker-gtk
RUNNING TRACKER
......
......@@ -8,3 +8,4 @@
* Brasero integration
* manpage indexing
* DocBook indexing
* search filtering (EG search within specific folders)
......@@ -30,7 +30,7 @@ AC_CHECK_FUNCS([getline])
dnl Library Checks
DBUS_REQUIRED=0.60
GLIB_REQUIRED=2.9.1
GLIB_REQUIRED=2.10.0
PANGO_REQUIRED=1.0.0
GMIME_REQUIRED=2.1.0
......@@ -150,9 +150,27 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
AM_GLIB_GNU_GETTEXT
IT_PROG_INTLTOOL([0.35.0])
# The following lines replace AM_GLIB_DEFINE_LOCALEDIR(TRACKER_LOCALEDIR)
# due to the bug with autoconf 2.60
dnl Set TRACKER_LOCALEDIR in config.h.
if test "x${prefix}" = "xNONE";
then
TRACKER_LOCALEDIR="${ac_default_prefix}/${DATADIRNAME}/locale"
else
TRACKER_LOCALEDIR="${prefix}/${DATADIRNAME}/locale"
fi
AC_DEFINE_UNQUOTED(TRACKER_LOCALEDIR, "$TRACKER_LOCALEDIR",
[The directory in which locale data will be stored])
# end of AM_GLIB_DEFINE_LOCALEDIR(TRACKER_LOCALEDIR) replacement
####################################################################
# check for newer glib (>= 2.12.0) for g_option_context_set_summary ()
# availability
# used as well in tracker-configuration.c and tracker-metadata-tile.c
# for other methods availability
####################################################################
RECENT_GLIB=2.12.0
......@@ -490,7 +508,8 @@ fi
# Checks for tracker-preferences
##################################################################
PREFERENCES_GLADE_REQUIRED=2.6
PREFERENCES_GLADE_REQUIRED=2.5
PREFERENCES_GTK_REQUIRED=2.8.0
AC_ARG_ENABLE([preferences],
AC_HELP_STRING([--disable-preferences], [Disable the preferences dialog]),,
......
......@@ -2,6 +2,7 @@ filterbindir = $(libdir)/tracker/filters/text
filterbin_SCRIPTS = html_filter \
xml_filter \
x-tex_filter
x-tex_filter \
djvu_filter
EXTRA_DIST = $(filterbin_SCRIPTS)
#!/bin/sh
nice -n19 djvused "$1" -e 'print-pure-txt' > "$2"
......@@ -33,9 +33,148 @@
#include "tracker-metadata-tile.h"
#include "tracker-tag-bar.h"
#define TRACKER_METADATA_TILE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_METADATA_TILE, TrackerMetadataTilePrivate))
#ifndef HAVE_RECENT_GLIB
/**********************************************************************
*
* The following functions are copied from the GLIB 2.12
* source code, to lower requirement on glib to 2.10 that ships with
* Dapper
*
**********************************************************************/
/* converts a broken down date representation, relative to UTC, to
* a timestamp; it uses timegm() if it's available. */
static time_t
mktime_utc (struct tm *tm)
{
time_t retval;
#ifndef HAVE_TIMEGM
static const gint days_before[] =
{
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
};
#endif
#ifndef HAVE_TIMEGM
if (tm->tm_mon < 0 || tm->tm_mon > 11)
return (time_t) -1;
retval = (tm->tm_year - 70) * 365;
retval += (tm->tm_year - 68) / 4;
retval += days_before[tm->tm_mon] + tm->tm_mday - 1;
if (tm->tm_year % 4 == 0 && tm->tm_mon < 2)
retval -= 1;
retval = ((((retval * 24) + tm->tm_hour) * 60) + tm->tm_min) * 60 + tm->tm_sec;
#else
retval = timegm (tm);
#endif /* !HAVE_TIMEGM */
return retval;
}
/**
* g_time_val_from_iso8601:
* @iso_date: a ISO 8601 encoded date string
* @time_: a #GTimeVal
*
* Converts a string containing an ISO 8601 encoded date and time
* to a #GTimeVal and puts it into @time_.
*
* Return value: %TRUE if the conversion was successful.
*
*/
gboolean
g_time_val_from_iso8601 (const gchar *iso_date,
GTimeVal *time_)
{
struct tm tm;
long val;
g_return_val_if_fail (iso_date != NULL, FALSE);
g_return_val_if_fail (time_ != NULL, FALSE);
val = strtoul (iso_date, (char **)&iso_date, 10);
if (*iso_date == '-')
{
/* YYYY-MM-DD */
tm.tm_year = val - 1900;
iso_date++;
tm.tm_mon = strtoul (iso_date, (char **)&iso_date, 10) - 1;
if (*iso_date++ != '-')
return FALSE;
tm.tm_mday = strtoul (iso_date, (char **)&iso_date, 10);
}
else
{
/* YYYYMMDD */
tm.tm_mday = val % 100;
tm.tm_mon = (val % 10000) / 100 - 1;
tm.tm_year = val / 10000 - 1900;
}
if (*iso_date++ != 'T')
return FALSE;
val = strtoul (iso_date, (char **)&iso_date, 10);
if (*iso_date == ':')
{
/* hh:mm:ss */
tm.tm_hour = val;
iso_date++;
tm.tm_min = strtoul (iso_date, (char **)&iso_date, 10);
if (*iso_date++ != ':')
return FALSE;
tm.tm_sec = strtoul (iso_date, (char **)&iso_date, 10);
}
else
{
/* hhmmss */
tm.tm_sec = val % 100;
tm.tm_min = (val % 10000) / 100;
tm.tm_hour = val / 10000;
}
time_->tv_sec = mktime_utc (&tm);
time_->tv_usec = 1;
if (*iso_date == '.')
time_->tv_usec = strtoul (iso_date + 1, (char **)&iso_date, 10);
if (*iso_date == '+' || *iso_date == '-')
{
gint sign = (*iso_date == '+') ? -1 : 1;
val = 60 * strtoul (iso_date + 1, (char **)&iso_date, 10);
if (*iso_date == ':')
val = 60 * val + strtoul (iso_date + 1, NULL, 10);
else
val = 60 * (val / 100) + (val % 100);
time_->tv_sec += (time_t) (val * sign);
}
return TRUE;
}
/**********************************************************************
*
* End of copied functions.
*
**********************************************************************/
#endif /* HAVE_RECENT_GLIB */
G_DEFINE_TYPE (TrackerMetadataTile, tracker_metadata_tile, GTK_TYPE_EVENT_BOX)
struct TrackerMetadataTilePrivate {
......@@ -606,9 +745,13 @@ _date_to_label (GtkWidget *label, const char *iso, const char *string)
g_date_set_time_val (date, &val);
g_date_strftime(buf,256,"%a %d %b %Y", date);
temp = g_strdup_printf (string, buf);
gtk_label_set_markup (GTK_LABEL (label), temp);
g_free (temp);
} else {
temp = g_strdup_printf (string, _("Unknown"));
}
gtk_label_set_markup (GTK_LABEL (label), temp);
g_free (temp);
}
......
SUBDIRS = html_converter ooo_converter
SUBDIRS = ooo_converter
.deps
.libs
Makefile
Makefile.in
htmless
bin_PROGRAMS = htmless
htmless_SOURCES = \
htmless.c \
htmless.h \
chckfile.c \
gettag.c
/* HTMLess, a program to read an HTML document and output two files: a formatted text file
* and a semi-formatted file containing the HTML tags.
*
* HTMLess Version 1.0 (Created 12/95)
* Copyright (C) 1995-1999. Stephen M. Orth
* Email: sorth@oz.net
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include "htmless.h"
#include <unistd.h>
/* Function to verify if a file already exists. Returns true if it doesn't exist */
/* or if it's ok to overwrite the existing file */
int filexist (char *string) /* Function takes filename */
{
#if 0
FILE *fileptr; /* Pointer to filename */
char overwrite; /* Yes or no for overwrite */
return TRUE; /* File doesn't exist */
#endif
/* assume that supplied string is localised */
return (access (string, F_OK) || !access (string, W_OK));
}
/* Function to get file name (or any string) from user using getchar()
* Remember to use malloc in function main to allocate memory when passing
* this function a string pointer (i.e. char *myString); not needed if passing char myString[45].
* This function created 5/3/96. It reads strings unsing getchar. Sort of like scanf, but better.
* Call the function like so: getfname(myString);
* The function return the number of characters read. Neat-o!
*/
#if 0
int getfname (char *string)
{
int c;
int i=0;
c=getchar(); /* get rid of first whitespace char */
if (isspace(c))
;
else /* If it's not whitespace, add it to string */
string[i++]= c;
while ((c=getchar())!='\n') /* Go until maxlength */
if (i<FILENAMELENGTH)
string[i++]= c;
/* Make the array of chars a string */
string[i++]='\0';
return strlen(string);
}
#endif //0
int checkfile (char *string) /* Function checks validity of filename */
{
int length=0;
/* Determine length of input string */
length=strlen(string); /* DOS Test. No filenames > 8 chars */
if (length<=0) /* If the file is of length 0 */
{
printf("\nYou must enter a filename.\n");
return FALSE;
}
if (length > FILENAMELENGTH)
{
printf("\nYou have exceeded the maximum pathlength of %d characters\n",FILENAMELENGTH);
return FALSE;
}
return TRUE;
}
/* HTMLess, a program to read an HTML document and output two files: a formatted text file
* and a semi-formatted file containing the HTML tags.
*
* HTMLess Version 1.0 (Created 12/95)
* Copyright (C) 1995-1999. Stephen M. Orth
* Email: sorth@oz.net
*
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published
* by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#include "htmless.h"
/* Function that pulls HTML tags from text document */
void gettag (char *string,FILE *fptr) /* Takes empty tag string and filepointer */
{
int c; /* Next character read */
*string++='<'; /* Replace lost HTML tag marker */
while ((c=getc(fptr))!='>') /* Read until you reach the HTML tag end char */
{
*string++= c; /* Increment the string ptr*/
}
*string++='>'; /* Write the end tag char */
*string='\0'; /* Make it a string */
return;
}
void getspecial (char *string,FILE *fptr) /* Takes empty tag string and filepointer */
{
int c; /* Next character read */
while ((c=getc(fptr))!=';') /* Read until you reach the end of the special char */
{
if (c==' ')
{
*string++='&';
*string++=' ';
break;
}
else
*string++= c; /* Increment the string ptr*/
}
*string='\0'; /* Make it a string */
return;
}
int tagtype (char *string, FILE *txtfptr) /* Based on the tag type; write various format chars*/
{
int space=0; /* Count number of spaces */
int x; /* column width loop counter */
int line=0;
if (line==1) /* If we start a new line */
{
putc('\n',txtfptr);
line=0;
}
/* The remaining section is fairly self explanitory--just determine which tag
* has just been read and then write the appropriate formatting chars to the text file
* Assumptions:
* The HTML is either all lower case or all upper.
* The program should ignore all whitespace within the HTML file;
* With the exception: the default is one whitespace char in between words.
* Program does not try to evaluate every possible HTML tag; just enough to produce a readable textfile
* Program covers through the HTML 2.0 spec.
*
* Added '{' and '}' for Italics and '[' and ']' for bold
*/
if ((strcmp(string,"<HTML>"))==0 || (strcmp(string,"<html>"))==0)
space++;
if ((strcmp(string,"<BODY>"))==0 || (strcmp(string,"<body>"))==0)
space++;
if ((strcmp(string,"</HEAD>"))==0 || (strcmp(string,"</head>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<CENTER>"))==0 || (strcmp(string,"<center>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"</CENTER>"))==0 || (strcmp(string,"</center>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<P>"))==0 ||(strcmp(string,"<p>"))==0) /* End of paragraph tag include a trailing blank line */
{
fprintf(txtfptr,"\n\n");
space--;
}
if ((strcmp(string,"<BR>"))==0 ||(strcmp(string,"<br>"))==0) /* End of line */
{
putc('\n',txtfptr);
space--;
}
if ((strncmp(string,"<H",2))==0 || (strncmp(string,"<h",2))==0) /* A test for the header tag i.e <H3> */
{
if (strlen(string)==4)
putc('\n',txtfptr);
space++;
}
if ((strncmp(string,"</H",3))==0 || (strncmp(string,"</h",3))==0) /*Test for end-header */
{
if (strlen(string)==5)
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<DL>"))==0 || (strcmp(string,"<dl>"))==0) /* A description list */
space++;
if ((strcmp(string,"</DL>"))==0 || (strcmp(string,"</dl>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<DD>"))==0 || (strcmp(string,"<dd>"))==0) /* data definition; indent */
{
putc('\n',txtfptr);
fprintf(txtfptr,"\t\t");
}
if ((strcmp(string,"<DT>"))==0 || (strcmp(string,"<dt>"))==0) /* data term; indent a little */
{
fprintf(txtfptr,"\t");
line=1;
}
if ((strcmp(string,"<LI>"))==0 || (strcmp(string,"<li>"))==0) /* A List item; indent */
{
putc('\n',txtfptr);
fprintf(txtfptr,"\t\t");
}
if ((strcmp(string,"<UL>"))==0 || (strcmp(string,"<ul>"))==0) /* A unordered list */
space++;
if ((strcmp(string,"</UL>"))==0 || (strcmp(string,"</ul>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<OL>"))==0 || (strcmp(string,"<ol>"))==0) /* A numbered list */
space++;
if ((strcmp(string,"</OL>"))==0 || (strcmp(string,"</ol>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<TABLE>"))==0 || (strcmp(string,"<table>"))==0) /* A table */
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"</TABLE>"))==0 || (strcmp(string,"</table>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strncmp(string,"<TH",3))==0 || (strncmp(string,"<th",3))==0) /* A table header */
{
putc('\n',txtfptr);
fprintf(txtfptr,"\t");
space++;
}
if ((strcmp(string,"</TH>"))==0 || (strcmp(string,"</th>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strncmp(string,"<TR",3))==0 || (strncmp(string,"<tr",3))==0) /* A table row */
{
fprintf(txtfptr,"\t");
space++;
}
if ((strcmp(string,"</TR>"))==0 || (strcmp(string,"</tr>"))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<BLINK>"))==0 || (strcmp(string,"<blink>"))==0)
space++;
if ((strcmp(string,"</BLINK>"))==0 || (strcmp(string,"</blink>"))==0)
space++;
if ((strncmp(string,"<HR",3))==0 || (strncmp(string,"<hr",3))==0) /* A line; print to max. output width */
{
for (x=0;x<OUTWIDTH;x++)
{
fprintf(txtfptr,"_");
}
fprintf(txtfptr,"\n\n");
space++;
}
if ((strncmp(string,"<IMG",4))==0 || (strncmp(string,"<img",4))==0)
space++;
if ((strncmp(string,"<A HREF",7))==0 || (strncmp(string,"<A HREF",7))==0)
space++;
if ((strncmp(string,"<FORM",5))==0 || (strncmp(string,"<form",5))==0)
space++;
if ((strncmp(string,"</FORM",6))==0 || (strncmp(string,"</form",6))==0)
{
putc('\n',txtfptr);
space++;
}
if ((strcmp(string,"<B>"))==0 || (strcmp(string,"<b>"))==0)
{
fprintf(txtfptr,"[");
space++;
}
if ((strcmp(string,"</B>"))==0 || (strcmp(string,"</b>"))==0)
{
fprintf(txtfptr,"]");
space++;
}
if ((strcmp(string,"<I>"))==0 || (strcmp(string,"<i>"))==0)
{
putc('{',txtfptr);
space++;
}
if ((strcmp(string,"</I>"))==0 || (strcmp(string,"</i>"))==0)
{
putc('}',txtfptr);
space++;
}
return space; /* return the number of spaces encountered */
}
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors
commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.)
You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or
can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these
things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you
have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to
copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the
original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that
any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work
based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the
Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is
included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this
License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for
a fee.