Kaydet (Commit) d5e39530 authored tarafından Nick Treleaven's avatar Nick Treleaven

Store filetype::name instead of unique ID when saving sessions.

Remove all filetype UID code.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/custom-filetypes@2543 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst fb6a87a0
2008-05-01 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/plugindata.h, src/keyfile.c, src/filetypes.c, src/filetypes.h:
Store filetype::name instead of unique ID when saving sessions.
Remove all filetype UID code.
2008-04-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/keyfile.c, src/keyfile.h, src/main.c:
......
This diff is collapsed.
......@@ -106,7 +106,6 @@ struct build_programs
struct filetype
{
filetype_id id;
guint uid; /* unique id as reference for saved filetype in config file */
GtkWidget *item; /* holds a pointer to the menu item for this filetypes */
langType lang; /* represents the langType of tagmanager(see the table */
/* in tagmanager/parsers.h), -1 represents all, -2 none */
......@@ -133,9 +132,6 @@ void filetypes_remove(filetype *ft);
filetype *filetypes_lookup_by_name(const gchar *name);
/* If uid is valid, return corresponding filetype, otherwise NULL. */
filetype *filetypes_get_from_uid(gint uid);
/* Calls filetypes_init_types() and creates the filetype menu. */
void filetypes_init(void);
......
......@@ -123,9 +123,9 @@ static gchar *get_session_file_string(gint idx)
if (ft == NULL) /* can happen when saving a new file when quitting */
ft = filetypes[GEANY_FILETYPES_ALL];
fname = g_strdup_printf("%d;%d;%d;%d;%d;%d;%d;%s;",
fname = g_strdup_printf("%d;%s;%d;%d;%d;%d;%d;%s;",
sci_get_current_position(doc_list[idx].sci),
ft->uid,
ft->name,
doc_list[idx].readonly,
encodings_get_idx_from_charset(doc_list[idx].encoding),
doc_list[idx].use_tabs,
......@@ -814,13 +814,14 @@ gboolean configuration_load(void)
static gboolean open_session_file(gchar **tmp)
{
guint pos;
const gchar *ft_name;
gchar *locale_filename;
gint ft_uid, enc_idx;
gint enc_idx;
gboolean ro, use_tabs, auto_indent, line_wrapping;
gboolean ret = FALSE;
pos = atoi(tmp[0]);
ft_uid = atoi(tmp[1]);
ft_name = tmp[1];
ro = atoi(tmp[2]);
enc_idx = atoi(tmp[3]);
use_tabs = atoi(tmp[4]);
......@@ -831,7 +832,7 @@ static gboolean open_session_file(gchar **tmp)
if (g_file_test(locale_filename, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK))
{
filetype *ft = filetypes_get_from_uid(ft_uid);
filetype *ft = filetypes_lookup_by_name(ft_name);
gint new_idx = document_open_file_full(
-1, locale_filename, pos, ro, ft,
(enc_idx >= 0 && enc_idx < GEANY_ENCODINGS_MAX) ?
......
......@@ -35,12 +35,12 @@
/* The API version should be incremented whenever any plugin data types below are
* modified or appended to. */
static const gint api_version = 54;
static const gint api_version = 55;
/* The ABI version should be incremented whenever existing fields in the plugin
* data types below have to be changed or reordered. It should stay the same if fields
* are only appended, as this doesn't affect existing fields. */
static const gint abi_version = 25;
static const gint abi_version = 26;
/** Check the plugin can be loaded by Geany.
* This performs runtime checks that try to ensure:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment