Skip to content

Commit 1999e46

Browse files
committed
Combination of --language and switching language in doxywizard
In case the `--language` is specified when starting the doxywizard and switching in the doxywizard to a new language does not take effect as on restart the `--language` kicks in again. We need a new list with the possible arguments and use this at restart.
1 parent 95a0ddc commit 1999e46

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

addon/doxywizard/doxywizard.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#include <QScrollBar>
4242
#include <QLocale>
4343
#include <QTranslator>
44+
#include <QList>
4445

4546
#ifdef _WIN32
4647
#include <windows.h>
@@ -51,6 +52,7 @@
5152
// globally accessible variables
5253
bool DoxygenWizard::debugFlag = false;
5354
QString DoxygenWizard::langCode;
55+
static QList<QString> newArgs;
5456

5557
const int messageTimeout = 5000; //!< status bar message timeout in milliseconds.
5658

@@ -469,7 +471,7 @@ void MainWindow::switchLanguage()
469471
setLanguage(langCode);
470472
saveSettings();
471473
qApp->quit();
472-
QProcess::startDetached(qApp->arguments()[0], qApp->arguments().mid(1));
474+
QProcess::startDetached(qApp->arguments()[0], newArgs);
473475
}
474476
}
475477
}
@@ -962,6 +964,7 @@ int main(int argc,char **argv)
962964

963965
QApplication a(argc,argv);
964966

967+
965968
int optInd=1;
966969
bool langSet = false;
967970
bool dumpFlag = false;
@@ -1000,6 +1003,7 @@ int main(int argc,char **argv)
10001003
else if (!qstrcmp(argv[optInd],"--debug"))
10011004
{
10021005
DoxygenWizard::debugFlag = true;
1006+
newArgs.push_back(QString::fromLatin1(argv[optInd]));
10031007
}
10041008
else if (!qstrcmp(argv[optInd],"--language"))
10051009
{
@@ -1064,6 +1068,7 @@ int main(int argc,char **argv)
10641068
}
10651069
if (optInd+1==argc && argv[argc-1][0]!='-') // name of config file as an argument
10661070
{
1071+
newArgs.push_back(QString::fromLatin1(argv[argc-1]));
10671072
main.loadConfigFromFile(QString::fromLocal8Bit(argv[argc-1]));
10681073
}
10691074
if (dumpFlag)

0 commit comments

Comments
 (0)