ClipIt-1.4.0-20110520002

+ Fixed: Remove duplicate truncate_history functionality.
+ Added: Added basic history item structure.

Changes to be committed:

modified:   ChangeLog
modified:   TODO
modified:   src/history.c
modified:   src/history.h
modified:   src/main.h
This commit is contained in:
Cristian Henzel 2011-05-21 00:46:33 +03:00
parent 6edfc6eafa
commit 12496f8e93
5 changed files with 19 additions and 22 deletions

View File

@ -1,5 +1,9 @@
ClipIt-1.4.0-20110520002 - 20 May. 2011
+ Fixed: Remove duplicate truncate_history functionality.
+ Added: Added basic history item structure.
ClipIt-1.4.0-20110520001 - 20 May. 2011
+ Fixed: Delted items are now properly removed from the history.
+ Fixed: Deleted items are now properly removed from the history.
+ Fixed: Double clicking an item in the "Manage history" dialog now
properly selects it again.
+ Added: [Enter] (for selecting the item) and [Delete] (for removing

1
TODO
View File

@ -6,3 +6,4 @@
+ Clean up the code and indent it properly.
+ Move all pop-up and menu functions from main.c to menus.c.
+ Use the shipped icon in the display.
+ history structure has to be changed in: main.c, manage.c, history.c

View File

@ -33,7 +33,7 @@
GSList *history;
/* Reads history from DATADIR/clipit/history */
void read_history ()
void read_history()
{
/* Build file path */
gchar *history_path = g_build_filename(g_get_user_data_dir(),
@ -140,18 +140,7 @@ void check_and_append(gchar *item)
void append_item(gchar *item)
{
history = g_slist_prepend(history, g_strdup(item));
/* Shorten history if necessary */
GSList *last_possible_element = g_slist_nth(history,
prefs.history_limit - 1);
if (last_possible_element)
{
/* Free last posible element and subsequent elements */
g_slist_free(last_possible_element->next);
last_possible_element->next = NULL;
}
/* Save changes */
if (prefs.save_history)
save_history();
truncate_history();
}
/* Truncates history to history_limit items */

View File

@ -32,21 +32,26 @@ G_BEGIN_DECLS
* 1 GB of RAM. If you don't want that, set this lower. */
#define ENTRY_MAX_SIZE 1048576
extern GSList* history;
typedef struct {
gboolean is_static;
char *content;
} history_item;
extern GSList *history;
void read_history();
void save_history();
void check_and_append(gchar* item);
void check_and_append(gchar *item);
void append_item(gchar* item);
void append_item(gchar *item);
void truncate_history();
gpointer get_last_item();
void delete_duplicate(gchar* item);
void delete_duplicate(gchar *item);
G_END_DECLS

View File

@ -30,8 +30,7 @@ G_BEGIN_DECLS
#define POPUP_DELAY 30
#define CHECK_INTERVAL 500
typedef struct
{
typedef struct {
gboolean use_copy; /* Use copy */
gboolean use_primary; /* Use primary */
gboolean synchronize; /* Synchronize copy and primary */
@ -59,8 +58,7 @@ typedef struct
gchar* search_key; /* ClipIt search hotkey */
gboolean no_icon; /* No icon */
}
prefs_t;
} prefs_t;
extern prefs_t prefs;