add Instance setting

This commit is contained in:
Syping 2021-04-29 16:26:22 +02:00
parent 2bc3e27906
commit 8880762ff3

View file

@ -33,7 +33,7 @@ int main(int argc, char *argv[])
{ {
QCoreApplication app(argc, argv); QCoreApplication app(argc, argv);
app.setApplicationName("xmppbot"); app.setApplicationName("xmppbot");
app.setApplicationVersion("0.1"); app.setApplicationVersion("0.2");
QCommandLineParser commandLineParser; QCommandLineParser commandLineParser;
commandLineParser.addPositionalArgument("config", QCoreApplication::translate("xmppbot", "Configuration file.")); commandLineParser.addPositionalArgument("config", QCoreApplication::translate("xmppbot", "Configuration file."));
@ -68,6 +68,10 @@ int main(int argc, char *argv[])
if (key == "Password") { if (key == "Password") {
if (!loginSet) { if (!loginSet) {
jid = group; jid = group;
const QString instance = settings.value("Instance", QString()).toString();
if (!instance.isEmpty()) {
jid += QLatin1String("/") + instance;
}
jpw = settings.value(key, QString()).toString(); jpw = settings.value(key, QString()).toString();
loginSet = true; loginSet = true;
} }