Instantiate QApplication sooner so applicationDirPath() is valid

applicationDirPath() was used before a QApplication was instantiated
so it returned an empty path. This caused the application language
files path to be computed incorrectly.
This commit is contained in:
in3otd 2016-04-17 22:27:51 +02:00
parent e4dc3ca3c7
commit 9951c6045b
8 changed files with 16 additions and 8 deletions

View File

@ -63,6 +63,8 @@ bool saveApplSettings(QucsActiveFilter *qucs)
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QString LangDir;
// apply default settings
QucsSettings.x = 200;
@ -91,7 +93,6 @@ int main(int argc, char *argv[])
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );

View File

@ -64,6 +64,8 @@ bool saveApplSettings(QucsAttenuator *qucs)
int main( int argc, char ** argv )
{
QApplication a( argc, argv );
// apply default settings
QucsSettings.x = 200;
QucsSettings.y = 100;
@ -90,7 +92,6 @@ int main( int argc, char ** argv )
loadSettings();
QApplication a( argc, argv );
a.setFont(QucsSettings.font);
QTranslator tor( 0 );
QString lang = QucsSettings.Language;

View File

@ -90,6 +90,8 @@ void showOptions()
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// apply default settings
QucsSettings.x = 200;
QucsSettings.y = 100;
@ -118,7 +120,6 @@ int main(int argc, char *argv[])
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );

View File

@ -34,6 +34,8 @@ void compute_lumped (qf_spec* spec_p, Q3TextStream& out) {
int main (int argc, char * argv []) {
QApplication app (argc, argv);
// apply default settings
QucsSettings.x = 200;
QucsSettings.y = 100;
@ -60,7 +62,6 @@ int main (int argc, char * argv []) {
loadSettings();
QApplication app (argc, argv);
qf_spec* spec_p;
int result = 0;

View File

@ -77,6 +77,8 @@ bool saveApplSettings(QucsFilter *qucs)
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// apply default settings
QucsSettings.x = 200;
QucsSettings.y = 100;
@ -103,7 +105,6 @@ int main(int argc, char *argv[])
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );

View File

@ -84,6 +84,8 @@ bool saveApplSettings(QucsLib *qucs)
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// apply default settings
QucsSettings.x = 100;
QucsSettings.y = 50;
@ -115,7 +117,6 @@ int main(int argc, char *argv[])
UserLibDir.setPath(QucsSettings.QucsHomeDir.canonicalPath() + "/user_lib/");
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );

View File

@ -223,6 +223,8 @@ bool saveApplSettings(MyWidget *w)
int main( int argc, char **argv )
{
QApplication a(argc, argv);
// apply default settings
QucsSettings.x = 100;
QucsSettings.y = 50;
@ -247,7 +249,6 @@ int main( int argc, char **argv )
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor(0);

View File

@ -97,6 +97,8 @@ bool saveApplSettings(QucsTranscalc *qucs)
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// apply default settings
QucsSettings.x = 100;
QucsSettings.y = 50;
@ -129,7 +131,6 @@ int main(int argc, char *argv[])
}
loadSettings();
QApplication a(argc, argv);
a.setFont(QucsSettings.font);
QTranslator tor( 0 );