I believe one cause of the problems we have with settings that get lost after 
reconfigure is the following: 

The settings are saved by Qt in a config file that is named from the LyX 
version. Thus we get a new, empty config file after every version change, and 
thus the toolbar changes etc. are lost.

Currently I have

juer...@whisper:~/lyx> ls ~/.config/LyX
LyX-1.6.0svn.conf  LyX-1.6.2.conf     LyX-1.6.3.conf  LyX-1.6.4svn.conf
LyX-1.6.1svn.conf  LyX-1.6.2svn.conf  LyX-1.6.3svn.conf     LyX-2.0.0svn.conf

I think it would make more sense to use the PACKAGE variable, i.e. 
lyx[-version-suffix], as a config file name. Then session parameters would 
persist over minor and even major version changes, and one still would have 
separated configuration files for trunk and branch, if --with-version-suffix 
is used (this is in line with the /.lyx vs. /.lyx-<version-suffix> directory 
policy.

The attached patch does this change.

Abdel, is there any reason not to do this?

Jürgen
Index: src/version.cpp
===================================================================
--- src/version.cpp	(Revision 30291)
+++ src/version.cpp	(Arbeitskopie)
@@ -16,5 +16,8 @@
 ///
 char const * lyx_release_date = LYX_DATE;
 
+/// Package identifier (lyx[-<version-suffix>])
+char const * lyx_package = PACKAGE;
+
 /// This is the version information shown by 'lyx --version'
 char const * lyx_version_info = VERSION_INFO;
Index: src/frontends/qt4/GuiApplication.cpp
===================================================================
--- src/frontends/qt4/GuiApplication.cpp	(Revision 30291)
+++ src/frontends/qt4/GuiApplication.cpp	(Arbeitskopie)
@@ -702,12 +702,13 @@
 
 
 GuiApplication::GuiApplication(int & argc, char ** argv)
-	: QApplication(argc, argv),	current_view_(0), d(new GuiApplication::Private)
+	: QApplication(argc, argv), current_view_(0),
+	  d(new GuiApplication::Private)
 {
 	QString app_name = "LyX";
 	QCoreApplication::setOrganizationName(app_name);
 	QCoreApplication::setOrganizationDomain("lyx.org");
-	QCoreApplication::setApplicationName(app_name + "-" + lyx_version);
+	QCoreApplication::setApplicationName(lyx_package);
 
 	// Install translator for GUI elements.
 	installTranslator(&d->qt_trans_);
Index: src/version.h
===================================================================
--- src/version.h	(Revision 30291)
+++ src/version.h	(Arbeitskopie)
@@ -19,6 +19,9 @@
 ///
 extern char const * lyx_release_date;
 
+/// Package identifier (lyx[-<version-suffix>])
+extern char const * lyx_package;
+
 /// This is the version information shown by 'lyx -version'
 extern char const * lyx_version_info;
 

Reply via email to