diff -Nru latexila-2.6.3/NEWS latexila-2.6.4/NEWS --- latexila-2.6.3/NEWS 2013-05-07 11:14:08.000000000 +0000 +++ latexila-2.6.4/NEWS 2013-06-07 11:27:14.000000000 +0000 @@ -1,5 +1,12 @@ LaTeXila NEWS +============================== +* Release 2.6.4 (June 7, 2013) +============================== + +- Misc bug fixes + + ============================= * Release 2.6.3 (May 7, 2013) ============================= diff -Nru latexila-2.6.3/README latexila-2.6.4/README --- latexila-2.6.3/README 2013-05-07 11:15:34.000000000 +0000 +++ latexila-2.6.4/README 2013-06-07 11:28:11.000000000 +0000 @@ -1,7 +1,7 @@ General Information =================== -This is the version 2.6.3 of LaTeXila. +This is the version 2.6.4 of LaTeXila. LaTeXila is an Integrated LaTeX Environment for the GNOME desktop. LaTeXila is released under the GNU General Public License (GPL) version 3 or diff -Nru latexila-2.6.3/configure latexila-2.6.4/configure --- latexila-2.6.3/configure 2013-05-07 11:15:25.000000000 +0000 +++ latexila-2.6.4/configure 2013-06-07 11:28:04.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for LaTeXila 2.6.3. +# Generated by GNU Autoconf 2.69 for LaTeXila 2.6.4. # # Report bugs to . # @@ -651,8 +651,8 @@ # Identity of this package. PACKAGE_NAME='LaTeXila' PACKAGE_TARNAME='latexila' -PACKAGE_VERSION='2.6.3' -PACKAGE_STRING='LaTeXila 2.6.3' +PACKAGE_VERSION='2.6.4' +PACKAGE_STRING='LaTeXila 2.6.4' PACKAGE_BUGREPORT='https://bugzilla.gnome.org/enter_bug.cgi?product=latexila' PACKAGE_URL='http://projects.gnome.org/latexila' @@ -1457,7 +1457,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures LaTeXila 2.6.3 to adapt to many kinds of systems. +\`configure' configures LaTeXila 2.6.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1527,7 +1527,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of LaTeXila 2.6.3:";; + short | recursive ) echo "Configuration of LaTeXila 2.6.4:";; esac cat <<\_ACEOF @@ -1654,7 +1654,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -LaTeXila configure 2.6.3 +LaTeXila configure 2.6.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1932,7 +1932,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by LaTeXila $as_me 2.6.3, which was +It was created by LaTeXila $as_me 2.6.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2755,7 +2755,7 @@ # Define the identity of the package. PACKAGE='latexila' - VERSION='2.6.3' + VERSION='2.6.4' cat >>confdefs.h <<_ACEOF @@ -4806,7 +4806,8 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -6343,7 +6344,14 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -16311,7 +16319,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by LaTeXila $as_me 2.6.3, which was +This file was extended by LaTeXila $as_me 2.6.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16378,7 +16386,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -LaTeXila config.status 2.6.3 +LaTeXila config.status 2.6.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru latexila-2.6.3/configure.ac latexila-2.6.4/configure.ac --- latexila-2.6.3/configure.ac 2013-05-07 11:09:56.000000000 +0000 +++ latexila-2.6.4/configure.ac 2013-06-07 11:23:20.000000000 +0000 @@ -5,7 +5,7 @@ AC_PREREQ([2.64]) AC_INIT([LaTeXila], - [2.6.3], + [2.6.4], [https://bugzilla.gnome.org/enter_bug.cgi?product=latexila], [latexila], [http://projects.gnome.org/latexila]) diff -Nru latexila-2.6.3/data/latexila.desktop.in latexila-2.6.4/data/latexila.desktop.in --- latexila-2.6.3/data/latexila.desktop.in 2013-05-07 11:15:34.000000000 +0000 +++ latexila-2.6.4/data/latexila.desktop.in 2013-06-07 11:28:11.000000000 +0000 @@ -13,7 +13,7 @@ X-GNOME-Bugzilla-Bugzilla=GNOME X-GNOME-Bugzilla-Product=latexila X-GNOME-Bugzilla-Component=other -X-GNOME-Bugzilla-Version=2.6.3 +X-GNOME-Bugzilla-Version=2.6.4 [Desktop Action Window] _Name=Open a New Window diff -Nru latexila-2.6.3/debian/changelog latexila-2.6.4/debian/changelog --- latexila-2.6.3/debian/changelog 2013-05-08 09:46:49.000000000 +0000 +++ latexila-2.6.4/debian/changelog 2013-06-07 18:47:57.000000000 +0000 @@ -1,3 +1,11 @@ +latexila (2.6.4-1~raring~ppa0) raring; urgency=low + + * New upstream release + * Upstream ChangeLog (2.6.3 -> 2.6.4) + - Misc bug fixes + + -- Matthieu Baerts (matttbe) Fri, 07 Jun 2013 20:47:28 +0200 + latexila (2.6.3-1~raring~ppa1) raring; urgency=low * New upstream release diff -Nru latexila-2.6.3/ltmain.sh latexila-2.6.4/ltmain.sh --- latexila-2.6.3/ltmain.sh 2013-05-07 11:15:23.000000000 +0000 +++ latexila-2.6.4/ltmain.sh 2013-06-07 11:28:01.000000000 +0000 @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.2 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.1" +VERSION="2.4.2 Debian-2.4.2-1.2" TIMESTAMP="" package_revision=1.3337 diff -Nru latexila-2.6.3/m4/libtool.m4 latexila-2.6.4/m4/libtool.m4 --- latexila-2.6.3/m4/libtool.m4 2013-05-07 11:15:23.000000000 +0000 +++ latexila-2.6.4/m4/libtool.m4 2013-06-07 11:28:01.000000000 +0000 @@ -1324,7 +1324,14 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" @@ -1688,7 +1695,8 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else diff -Nru latexila-2.6.3/src/latexila.c latexila-2.6.4/src/latexila.c --- latexila-2.6.3/src/latexila.c 2013-05-07 11:15:41.000000000 +0000 +++ latexila-2.6.4/src/latexila.c 2013-06-07 11:28:17.000000000 +0000 @@ -190,7 +190,7 @@ static void latexila_init_primary_instance (Latexila* self); static void _latexila_init_primary_instance_g_application_startup (GApplication* _sender, gpointer self); static void __lambda142_ (Latexila* self); -MainWindow* latexila_create_window (Latexila* self); +MainWindow* latexila_get_active_window (Latexila* self); static void ___lambda142__g_application_activate (GApplication* _sender, gpointer self); static void __lambda143_ (Latexila* self); gpointer projects_ref (gpointer instance); @@ -214,11 +214,11 @@ static void latexila_set_active_window (Latexila* self, MainWindow* value); static void ___lambda144__gtk_application_window_removed (GtkApplication* _sender, GtkWindow* window, gpointer self); static void __lambda145_ (Latexila* self); -MainWindow* latexila_get_active_window (Latexila* self); GType document_tab_get_type (void) G_GNUC_CONST; DocumentTab* main_window_create_tab (MainWindow* self, gboolean jump_to); static void ___lambda145__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self); static void __lambda146_ (Latexila* self); +MainWindow* latexila_create_window (Latexila* self); static void ___lambda146__g_simple_action_activate (GSimpleAction* _sender, GVariant* parameter, gpointer self); static void __lambda147_ (Latexila* self, GVariant* param); static void _vala_array_add15 (GFile*** array, int* length, int* size, GFile* value); @@ -237,9 +237,9 @@ GType stock_icons_get_type (void) G_GNUC_CONST; GType app_settings_get_type (void) G_GNUC_CONST; AppSettings* app_settings_get_default (void); +static void latexila_reopen_files (Latexila* self); static void _g_object_unref0_ (gpointer var); static void _g_list_free__g_object_unref0_ (GList* self); -static void latexila_reopen_files (Latexila* self); static void _vala_array_add16 (GFile*** array, int* length, int* size, GFile* value); GType document_get_type (void) G_GNUC_CONST; GeeList* latexila_get_documents (Latexila* self); @@ -284,12 +284,10 @@ static void __lambda142_ (Latexila* self) { - MainWindow* _tmp0_ = NULL; - MainWindow* _tmp1_; + MainWindow* _tmp0_; g_application_hold ((GApplication*) self); - _tmp0_ = latexila_create_window (self); - _tmp1_ = _tmp0_; - _g_object_unref0 (_tmp1_); + _tmp0_ = self->priv->_active_window; + gtk_window_present ((GtkWindow*) _tmp0_); g_application_release ((GApplication*) self); } @@ -534,6 +532,8 @@ StockIcons* _tmp1_; AppSettings* _tmp2_ = NULL; AppSettings* _tmp3_; + MainWindow* _tmp4_ = NULL; + MainWindow* _tmp5_; g_return_if_fail (self != NULL); g_application_hold ((GApplication*) self); latexila_set_application_icons (self); @@ -543,6 +543,10 @@ _tmp2_ = app_settings_get_default (); _tmp3_ = _tmp2_; _g_object_unref0 (_tmp3_); + _tmp4_ = latexila_create_window (self); + _tmp5_ = _tmp4_; + _g_object_unref0 (_tmp5_); + latexila_reopen_files (self); g_application_release ((GApplication*) self); } @@ -632,7 +636,7 @@ _inner_error_ = NULL; _tmp13_ = e; _tmp14_ = _tmp13_->message; - g_warning ("latexila.vala:142: Application icon: %s", _tmp14_); + g_warning ("latexila.vala:144: Application icon: %s", _tmp14_); _g_error_free0 (e); } __finally31: @@ -864,10 +868,8 @@ static gboolean __lambda71_ (Block22Data* _data22_) { Latexila * self; gboolean result = FALSE; - MainWindow* _tmp0_; self = _data22_->self; - _tmp0_ = _data22_->window; - latexila_set_active_window (self, _tmp0_); + latexila_set_active_window (self, _data22_->window); result = FALSE; return result; } @@ -884,46 +886,27 @@ MainWindow* result = NULL; Block22Data* _data22_; MainWindow* _tmp0_; - gboolean first_window; - gboolean _tmp1_; + MainWindow* _tmp2_; MainWindow* _tmp3_; - MainWindow* _tmp4_; - MainWindow* _tmp5_; - MainWindow* _tmp6_; - MainWindow* _tmp7_; - gboolean _tmp8_; - MainWindow* _tmp9_; - MainWindow* _tmp10_; g_return_val_if_fail (self != NULL, NULL); _data22_ = g_slice_new0 (Block22Data); _data22_->_ref_count_ = 1; _data22_->self = g_object_ref (self); _tmp0_ = self->priv->_active_window; - first_window = _tmp0_ == NULL; - _tmp1_ = first_window; - if (!_tmp1_) { - MainWindow* _tmp2_; - _tmp2_ = self->priv->_active_window; - main_window_save_state (_tmp2_); - } - _tmp3_ = main_window_new (); - g_object_ref_sink (_tmp3_); - _data22_->window = _tmp3_; - _tmp4_ = _data22_->window; - gtk_application_add_window ((GtkApplication*) self, (GtkWindow*) _tmp4_); - _tmp5_ = _data22_->window; - latexila_set_active_window (self, _tmp5_); - _tmp6_ = _data22_->window; - g_signal_connect_data ((GtkWidget*) _tmp6_, "focus-in-event", (GCallback) ___lambda71__gtk_widget_focus_in_event, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0); - _tmp7_ = _data22_->window; - gtk_widget_show ((GtkWidget*) _tmp7_); - _tmp8_ = first_window; - if (_tmp8_) { - latexila_reopen_files (self); - } - _tmp9_ = _data22_->window; - _tmp10_ = _g_object_ref0 (_tmp9_); - result = _tmp10_; + if (_tmp0_ != NULL) { + MainWindow* _tmp1_; + _tmp1_ = self->priv->_active_window; + main_window_save_state (_tmp1_); + } + _tmp2_ = main_window_new (); + g_object_ref_sink (_tmp2_); + _data22_->window = _tmp2_; + gtk_application_add_window ((GtkApplication*) self, (GtkWindow*) _data22_->window); + latexila_set_active_window (self, _data22_->window); + g_signal_connect_data ((GtkWidget*) _data22_->window, "focus-in-event", (GCallback) ___lambda71__gtk_widget_focus_in_event, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0); + gtk_widget_show ((GtkWidget*) _data22_->window); + _tmp3_ = _g_object_ref0 (_data22_->window); + result = _tmp3_; block22_data_unref (_data22_); _data22_ = NULL; return result; diff -Nru latexila-2.6.3/src/latexila.vala latexila-2.6.4/src/latexila.vala --- latexila-2.6.3/src/latexila.vala 2013-05-07 11:09:56.000000000 +0000 +++ latexila-2.6.4/src/latexila.vala 2013-06-07 11:23:20.000000000 +0000 @@ -39,7 +39,7 @@ activate.connect (() => { hold (); - create_window (); + active_window.present (); release (); }); @@ -119,6 +119,8 @@ new StockIcons (); AppSettings.get_default (); + create_window (); + reopen_files (); release (); } @@ -196,9 +198,7 @@ public MainWindow create_window () { - bool first_window = active_window == null; - - if (! first_window) + if (active_window != null) active_window.save_state (); MainWindow window = new MainWindow (); @@ -212,10 +212,6 @@ }); window.show (); - - if (first_window) - reopen_files (); - return window; } diff -Nru latexila-2.6.3/src/utils.c latexila-2.6.4/src/utils.c --- latexila-2.6.3/src/utils.c 2013-05-07 11:15:42.000000000 +0000 +++ latexila-2.6.4/src/utils.c 2013-06-07 11:28:18.000000000 +0000 @@ -66,6 +66,7 @@ static void _g_object_unref0_ (gpointer var); static void _g_list_free__g_object_unref0_ (GList* self); void utils_show_uri (GdkScreen* screen, const gchar* uri, GError** error); +gboolean utils_default_document_viewer_is_evince (const gchar* uri); GType synctex_get_type (void) G_GNUC_CONST; Synctex* synctex_get_default (void); gboolean synctex_create_evince_window (Synctex* self, const gchar* pdf_uri); @@ -1292,10 +1293,12 @@ const gchar* _tmp1_; gboolean _tmp2_ = FALSE; gboolean _tmp3_; - const gchar* _tmp4_; - gchar* _tmp5_ = NULL; - gchar* _tmp6_; - gboolean _tmp7_; + gboolean _tmp4_ = FALSE; + const gchar* _tmp5_; + gchar* _tmp6_ = NULL; + gchar* _tmp7_; + gboolean _tmp8_; + gboolean _tmp11_; GError * _inner_error_ = NULL; g_return_if_fail (uri != NULL); _tmp0_ = screen; @@ -1309,26 +1312,112 @@ if (!_tmp3_) { return; } - _tmp4_ = uri; - _tmp5_ = utils_get_extension (_tmp4_); - _tmp6_ = _tmp5_; - _tmp7_ = g_strcmp0 (_tmp6_, ".pdf") == 0; - _g_free0 (_tmp6_); - if (_tmp7_) { - Synctex* _tmp8_ = NULL; + _tmp5_ = uri; + _tmp6_ = utils_get_extension (_tmp5_); + _tmp7_ = _tmp6_; + _tmp8_ = g_strcmp0 (_tmp7_, ".pdf") == 0; + _g_free0 (_tmp7_); + if (_tmp8_) { + const gchar* _tmp9_; + gboolean _tmp10_ = FALSE; + _tmp9_ = uri; + _tmp10_ = utils_default_document_viewer_is_evince (_tmp9_); + _tmp4_ = _tmp10_; + } else { + _tmp4_ = FALSE; + } + _tmp11_ = _tmp4_; + if (_tmp11_) { + Synctex* _tmp12_ = NULL; Synctex* synctex; - Synctex* _tmp9_; - const gchar* _tmp10_; - _tmp8_ = synctex_get_default (); - synctex = _tmp8_; - _tmp9_ = synctex; - _tmp10_ = uri; - synctex_create_evince_window (_tmp9_, _tmp10_); + Synctex* _tmp13_; + const gchar* _tmp14_; + _tmp12_ = synctex_get_default (); + synctex = _tmp12_; + _tmp13_ = synctex; + _tmp14_ = uri; + synctex_create_evince_window (_tmp13_, _tmp14_); _g_object_unref0 (synctex); } } +static gboolean string_contains (const gchar* self, const gchar* needle) { + gboolean result = FALSE; + const gchar* _tmp0_; + gchar* _tmp1_ = NULL; + g_return_val_if_fail (self != NULL, FALSE); + g_return_val_if_fail (needle != NULL, FALSE); + _tmp0_ = needle; + _tmp1_ = strstr ((gchar*) self, (gchar*) _tmp0_); + result = _tmp1_ != NULL; + return result; +} + + +gboolean utils_default_document_viewer_is_evince (const gchar* uri) { + gboolean result = FALSE; + const gchar* _tmp0_; + GFile* _tmp1_ = NULL; + GFile* file; + GAppInfo* app = NULL; + GAppInfo* _tmp7_; + const gchar* _tmp8_ = NULL; + gboolean _tmp9_ = FALSE; + GError * _inner_error_ = NULL; + g_return_val_if_fail (uri != NULL, FALSE); + _tmp0_ = uri; + _tmp1_ = g_file_new_for_uri (_tmp0_); + file = _tmp1_; + { + GFile* _tmp2_; + GAppInfo* _tmp3_ = NULL; + GAppInfo* _tmp4_; + _tmp2_ = file; + _tmp3_ = g_file_query_default_handler (_tmp2_, NULL, &_inner_error_); + _tmp4_ = _tmp3_; + if (_inner_error_ != NULL) { + goto __catch75_g_error; + } + _g_object_unref0 (app); + app = _tmp4_; + } + goto __finally75; + __catch75_g_error: + { + GError* e = NULL; + GError* _tmp5_; + const gchar* _tmp6_; + e = _inner_error_; + _inner_error_ = NULL; + _tmp5_ = e; + _tmp6_ = _tmp5_->message; + g_warning ("utils.vala:313: Impossible to know if evince is the default document v" \ +"iewer: %s", _tmp6_); + result = FALSE; + _g_error_free0 (e); + _g_object_unref0 (app); + _g_object_unref0 (file); + return result; + } + __finally75: + if (_inner_error_ != NULL) { + _g_object_unref0 (app); + _g_object_unref0 (file); + g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code); + g_clear_error (&_inner_error_); + return FALSE; + } + _tmp7_ = app; + _tmp8_ = g_app_info_get_executable (_tmp7_); + _tmp9_ = string_contains (_tmp8_, "evince"); + result = _tmp9_; + _g_object_unref0 (app); + _g_object_unref0 (file); + return result; +} + + /*************************************************************************/ GtkScrolledWindow* utils_add_scrollbar (GtkWidget* child) { GtkScrolledWindow* result = NULL; diff -Nru latexila-2.6.3/src/utils.vala latexila-2.6.4/src/utils.vala --- latexila-2.6.3/src/utils.vala 2013-05-07 11:09:56.000000000 +0000 +++ latexila-2.6.4/src/utils.vala 2013-06-07 11:23:20.000000000 +0000 @@ -291,13 +291,33 @@ return; // Backward search for PDF documents. - if (get_extension (uri) == ".pdf") + if (get_extension (uri) == ".pdf" && + default_document_viewer_is_evince (uri)) { Synctex synctex = Synctex.get_default (); synctex.create_evince_window (uri); } } + private bool default_document_viewer_is_evince (string uri) + { + File file = File.new_for_uri (uri); + AppInfo app; + + try + { + app = file.query_default_handler (); + } + catch (Error e) + { + warning ("Impossible to know if evince is the default document viewer: %s", + e.message); + return false; + } + + return app.get_executable ().contains ("evince"); + } + /*************************************************************************/ // UI stuff