Small improvements to speed up quit process with many open documents.
Avoid calling gtk_notebook_remove_page() on exit as it takes a lot of time. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4921 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
798fc82a2b
commit
48064120f8
@ -4,7 +4,10 @@
|
||||
win32.h can be included unconditionally.
|
||||
* src/sidebar.c:
|
||||
Fix project base_path detection if the path has a trailing slash.
|
||||
|
||||
* src/document.c, src/editor.c, src/project.c:
|
||||
Small improvements to speed up quit process with many open documents.
|
||||
Avoid calling gtk_notebook_remove_page() on exit as it takes
|
||||
a lot of time.
|
||||
|
||||
2010-05-15 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
||||
|
||||
|
@ -640,10 +640,13 @@ gboolean document_remove_page(guint page_num)
|
||||
|
||||
doc->is_valid = FALSE;
|
||||
|
||||
notebook_remove_page(page_num);
|
||||
sidebar_remove_document(doc);
|
||||
navqueue_remove_file(doc->file_name);
|
||||
msgwin_status_add(_("File %s closed."), DOC_FILENAME(doc));
|
||||
if (! main_status.quitting)
|
||||
{
|
||||
notebook_remove_page(page_num);
|
||||
sidebar_remove_document(doc);
|
||||
navqueue_remove_file(doc->file_name);
|
||||
msgwin_status_add(_("File %s closed."), DOC_FILENAME(doc));
|
||||
}
|
||||
g_free(doc->encoding);
|
||||
g_free(doc->priv->saved_encoding.encoding);
|
||||
g_free(doc->file_name);
|
||||
@ -2830,7 +2833,7 @@ gboolean document_account_for_unsaved(void)
|
||||
for (p = 0; p < page_count; p++)
|
||||
{
|
||||
doc = document_get_from_page(p);
|
||||
if (doc->changed)
|
||||
if (DOC_VALID(doc) && doc->changed)
|
||||
{
|
||||
if (! dialogs_show_unsaved_file(doc))
|
||||
return FALSE;
|
||||
@ -2863,9 +2866,9 @@ static void force_close_all(void)
|
||||
}
|
||||
main_status.closing_all = TRUE;
|
||||
|
||||
while (gtk_notebook_get_n_pages(GTK_NOTEBOOK(main_widgets.notebook)) > 0)
|
||||
foreach_document(i)
|
||||
{
|
||||
document_remove_page(0);
|
||||
document_close(documents[i]);
|
||||
}
|
||||
|
||||
main_status.closing_all = FALSE;
|
||||
|
@ -65,6 +65,7 @@
|
||||
#include "keybindings.h"
|
||||
#include "project.h"
|
||||
#include "projectprivate.h"
|
||||
#include "main.h"
|
||||
|
||||
|
||||
/* Note: use sciwrappers.h instead where possible.
|
||||
@ -4972,6 +4973,9 @@ void editor_apply_update_prefs(GeanyEditor *editor)
|
||||
|
||||
g_return_if_fail(editor != NULL);
|
||||
|
||||
if (main_status.quitting)
|
||||
return;
|
||||
|
||||
sci = editor->sci;
|
||||
|
||||
sci_set_mark_long_lines(sci, editor_get_long_line_type(),
|
||||
|
@ -309,6 +309,9 @@ void project_open(void)
|
||||
/* Called when creating, opening, closing and updating projects. */
|
||||
static void update_ui(void)
|
||||
{
|
||||
if (main_status.quitting)
|
||||
return;
|
||||
|
||||
ui_set_window_title(NULL);
|
||||
build_menu_update(NULL);
|
||||
sidebar_openfiles_update_all();
|
||||
|
Loading…
x
Reference in New Issue
Block a user