Revision: 384
Author: ntrel
Date: 2006-05-31 14:17:30 -0700 (Wed, 31 May 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=384&view=rev
Log Message:
-----------
Discard old session files also for unsaved documents
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/keyfile.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-05-31 14:53:27 UTC (rev 383)
+++ trunk/ChangeLog 2006-05-31 21:17:30 UTC (rev 384)
@@ -2,6 +2,7 @@
* scintilla/PlatGTK.cxx:
Backport a Scintilla fix for crashes with recent GTK+ font issue.
+ * src/keyfile.c: Discard old session files also for unsaved documents.
2006-05-30 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c 2006-05-31 14:53:27 UTC (rev 383)
+++ trunk/src/keyfile.c 2006-05-31 21:17:30 UTC (rev 384)
@@ -162,14 +162,11 @@
j++;
}
}
- // if open tabs less than GEANY_SESSION_FILES, delete existing saved entries in the list
- if (max < GEANY_SESSION_FILES)
+ // if open filenames less than GEANY_SESSION_FILES, delete existing saved entries in the list
+ for(i = j; i < GEANY_SESSION_FILES; i++)
{
- for(i = max; i < GEANY_SESSION_FILES; i++)
- {
- g_snprintf(entry, 13, "FILE_NAME_%d", i);
- g_key_file_set_string(config, "files", entry, "");
- }
+ g_snprintf(entry, 13, "FILE_NAME_%d", i);
+ g_key_file_set_string(config, "files", entry, "");
}
// write the file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 378
Author: eht16
Date: 2006-05-30 08:30:36 -0700 (Tue, 30 May 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=378&view=rev
Log Message:
-----------
Fixed typo
Modified Paths:
--------------
trunk/data/filetypes.common
Modified: trunk/data/filetypes.common
===================================================================
--- trunk/data/filetypes.common 2006-05-30 15:29:21 UTC (rev 377)
+++ trunk/data/filetypes.common 2006-05-30 15:30:36 UTC (rev 378)
@@ -11,4 +11,4 @@
# style of folding icons, only first and second arguments are used, valid values are:
# first argument: 1 for boxes, 2 for circles
# second argument: 1 for straight lines, 2 for curved lines
-#folding_style=1;1;false;false
+folding_style=1;1;false;false
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 377
Author: eht16
Date: 2006-05-30 08:29:21 -0700 (Tue, 30 May 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=377&view=rev
Log Message:
-----------
Fixed a wrong(non ISO-C) array size allocation, improved utils_replace_tabs()
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-05-30 15:28:13 UTC (rev 376)
+++ trunk/ChangeLog 2006-05-30 15:29:21 UTC (rev 377)
@@ -1,14 +1,25 @@
+2006-05-30 Enrico Troeger <enrico.troeger(a)uvena.de>
+
+ * src/dialogs.c, src/main.c:
+ Removed unneeded function dialogs_show_fifo_error(), fixed small
+ memory leak in dialogs_show_question()
+ * src/utils.c: Fixed a wrong(non ISO-C) array size allocation,
+ improved utils_replace_tabs().
+ * src/keybindings.c: Added shortcut for Replace Tabs by Space,
+ extend usage of GEANY_ADD_ACCEL macro.
+
+
2006-05-29 Enrico Troeger <enrico.troeger(a)uvena.de>
- * src/about.c: added Jacek Wolszczak and Frank Lanitz to the credits
+ * src/about.c: Added Jacek Wolszczak and Frank Lanitz to the credits.
2006-05-28 Enrico Troeger <enrico.troeger(a)uvena.de>
- * configure.in, po/po.po: added Polish translation contributed by
- Jacek Wolszczak
- * src/dialogs.c, src/utils.c: made recent files menu item insensitive
- when the list is empty
+ * configure.in, po/pl.po: Added Polish translation contributed by
+ Jacek Wolszczak.
+ * src/dialogs.c, src/utils.c: Made recent files menu item insensitive
+ when the list is empty.
2006-05-26 Nick Treleaven <nick.treleaven(a)btinternet.com>
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2006-05-30 15:28:13 UTC (rev 376)
+++ trunk/src/utils.c 2006-05-30 15:29:21 UTC (rev 377)
@@ -92,6 +92,7 @@
/* updates the status bar */
void utils_update_statusbar(gint idx, gint pos)
{
+ // currently text need in German and C locale about 150 chars
gchar *text = (gchar*) g_malloc0(250);
gchar *cur_tag;
guint line, col;
@@ -1473,21 +1474,30 @@
{
gint i, len, j = 0, tabs_amount = 0;
gint tab_w = sci_get_tab_width(doc_list[idx].sci);
- /// TODO Warnung: ISO-C90 verbietet Feld »replacement« variabler Größe
- gchar *data, replacement[tab_w + 1];
+ gchar *data, *replacement;
gchar *text;
+ replacement = g_malloc(tab_w + 1);
+
// get the text
len = sci_get_length(doc_list[idx].sci) + 1;
data = g_malloc(len);
sci_get_text(doc_list[idx].sci, len, data);
// prepare the spaces with the width of a tab
- for (i = 0; i < tab_w; i++) replacement[i] = 32;
- replacement[tab_w] = 0;
+ for (i = 0; i < tab_w; i++) replacement[i] = ' ';
+ replacement[tab_w] = '\0';
for (i = 0; i < len; i++) if (data[i] == 9) tabs_amount++;
+ // if there are no tabs, just return and leave the content untouched
+ if (tabs_amount == 0)
+ {
+ g_free(data);
+ g_free(replacement);
+ return;
+ }
+
text = g_malloc(len + (tabs_amount * (tab_w - 1)));
for (i = 0; i < len; i++)
@@ -1509,6 +1519,7 @@
g_free(data);
g_free(text);
+ g_free(replacement);
}
/* GList of strings operations */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 375
Author: eht16
Date: 2006-05-30 08:27:38 -0700 (Tue, 30 May 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=375&view=rev
Log Message:
-----------
Removed unneeded function dialogs_show_fifo_error(), fixed small memory leak in dialogs_show_question()
Modified Paths:
--------------
trunk/src/dialogs.c
trunk/src/dialogs.h
trunk/src/main.c
Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c 2006-05-29 21:49:56 UTC (rev 374)
+++ trunk/src/dialogs.c 2006-05-30 15:27:38 UTC (rev 375)
@@ -225,7 +225,7 @@
}
-/// TODO is there a difference to dialogs_show_question? if not, remove this one
+/// TODO replace by dialogs_show_question
gboolean dialogs_show_not_found(const gchar *text)
{
GtkWidget *dialog;
@@ -276,28 +276,6 @@
}
-/// TODO is there a difference to dialogs_show_question? if not, remove this one
-gboolean dialogs_show_fifo_error(const gchar *text, ...)
-{
- GtkWidget *dialog;
- gchar string[300];
- gint ret;
- va_list args;
-
- va_start(args, text);
- g_vsnprintf(string, 299, text, args);
- va_end(args);
-
- dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR, GTK_BUTTONS_YES_NO, string);
- ret = gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(dialog);
-
- if (ret == GTK_RESPONSE_YES) return TRUE;
- else return FALSE;
-}
-
-
void dialogs_show_error(const gchar *text, ...)
{
#ifndef GEANY_WIN32
@@ -1271,6 +1249,7 @@
}
+/// TODO remove this function and use dialogs_show_question instead
gboolean dialogs_show_mkcfgdir_error(gint error_nr)
{
GtkWidget *dialog;
@@ -1837,12 +1816,13 @@
va_end(args);
#ifdef GEANY_WIN32
- if (MessageBox(NULL, string, _("Question"), MB_YESNO | MB_ICONWARNING) == IDYES) return TRUE;
- else return FALSE;
+ if (MessageBox(NULL, string, _("Question"), MB_YESNO | MB_ICONWARNING) == IDYES)
+ ret = TRUE;
#else
dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, string);
- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES) ret = TRUE;
+ if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_YES)
+ ret = TRUE;
gtk_widget_destroy(dialog);
#endif
g_free(string);
Modified: trunk/src/dialogs.h
===================================================================
--- trunk/src/dialogs.h 2006-05-29 21:49:56 UTC (rev 374)
+++ trunk/src/dialogs.h 2006-05-30 15:27:38 UTC (rev 375)
@@ -42,8 +42,6 @@
void dialogs_show_error(const gchar *text, ...);
-gboolean dialogs_show_fifo_error(const gchar *text, ...);
-
gboolean dialogs_show_unsaved_file(gint idx);
/* This shows the font selection dialog to choose a font. */
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2006-05-29 21:49:56 UTC (rev 374)
+++ trunk/src/main.c 2006-05-30 15:27:38 UTC (rev 375)
@@ -386,7 +386,7 @@
}
else
{
- if (dialogs_show_fifo_error(_("Geany is exiting because a named pipe was found. Mostly this means, Geany is already running. If you know Geany is not running, you can delete the file and start Geany anyway.\nDelete the named pipe and start Geany?")))
+ if (dialogs_show_question(_("Geany is exiting because a named pipe was found. Mostly this means, Geany is already running. If you know Geany is not running, you can delete the file and start Geany anyway.\nDelete the named pipe and start Geany?")))
{
unlink(fifo_name);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.