]> git.lyx.org Git - features.git/commitdiff
Make actOnUpdatedPrefs() actually act on updated preferences.
authorEnrico Forestieri <forenr@lyx.org>
Fri, 13 May 2011 09:29:48 +0000 (09:29 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Fri, 13 May 2011 09:29:48 +0000 (09:29 +0000)
Always wondered why I had to restart LyX after changing the PATH prefix.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38736 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXRC.cpp

index c15b9ad3e28cda61d2603593eeca394e8d981758..9f360fedcc076d874ab95b2d7953994a262793f0 100644 (file)
@@ -2939,11 +2939,6 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
        case LyXRC::RC_DISPLAY_GRAPHICS:
        case LyXRC::RC_DOCUMENTPATH:
-               if (lyxrc_orig.document_path != lyxrc_new.document_path) {
-                       FileName path(lyxrc_new.document_path);
-                       if (path.exists() && path.isDirectory())
-                               package().document_dir() = FileName(lyxrc.document_path);
-               }
        case LyXRC::RC_EDITOR_ALTERNATIVES:
        case LyXRC::RC_ESC_CHARS:
        case LyXRC::RC_EXAMPLEPATH:
@@ -2980,9 +2975,6 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_NUMLASTFILES:
        case LyXRC::RC_PARAGRAPH_MARKERS:
        case LyXRC::RC_PATH_PREFIX:
-               if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
-                       prependEnvPath("PATH", lyxrc.path_prefix);
-               }
        case LyXRC::RC_PREVIEW:
        case LyXRC::RC_PREVIEW_HASHED_LABELS:
        case LyXRC::RC_PREVIEW_SCALE_FACTOR:
@@ -3029,9 +3021,6 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_TEMPLATEPATH:
        case LyXRC::RC_TEX_ALLOWS_SPACES:
        case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
-               if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
-                       os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
-               }
        case LyXRC::RC_TEXINPUTS_PREFIX:
        case LyXRC::RC_THESAURUSDIRPATH:
        case LyXRC::RC_UIFILE:
@@ -3063,6 +3052,19 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_LAST:
                break;
        }
+
+       // Do what is needed (if any) for changes to actually take effect.
+       if (lyxrc_orig.document_path != lyxrc_new.document_path) {
+               FileName path(lyxrc_new.document_path);
+               if (path.exists() && path.isDirectory())
+                       package().document_dir() = FileName(lyxrc.document_path);
+       }
+       if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
+               prependEnvPath("PATH", lyxrc.path_prefix);
+       }
+       if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
+               os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
+       }
 }