mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fix compilation on macos maybe
This commit is contained in:
parent
3c5d8a1761
commit
4bb0b79348
1 changed files with 36 additions and 35 deletions
|
@ -101,33 +101,34 @@ namespace {
|
||||||
|
|
||||||
if (!queue.empty())
|
if (!queue.empty())
|
||||||
{
|
{
|
||||||
std::visit(
|
// we were gonna use std::visit here but macos is shit
|
||||||
Overloaded{
|
|
||||||
[](const SetJob &set) {
|
auto &&item = queue.front();
|
||||||
qDebug() << "set";
|
if (item.index() == 0) // set job
|
||||||
auto job =
|
{
|
||||||
new QKeychain::WritePasswordJob("chatterino");
|
auto set = std::get<SetJob>(item);
|
||||||
|
auto job = new QKeychain::WritePasswordJob("chatterino");
|
||||||
job->setAutoDelete(true);
|
job->setAutoDelete(true);
|
||||||
job->setKey(set.name);
|
job->setKey(set.name);
|
||||||
job->setTextData(set.credential);
|
job->setTextData(set.credential);
|
||||||
QObject::connect(job, &QKeychain::Job::finished, qApp,
|
QObject::connect(job, &QKeychain::Job::finished, qApp,
|
||||||
[](auto) { runNextJob(); });
|
[](auto) { runNextJob(); });
|
||||||
job->start();
|
job->start();
|
||||||
},
|
}
|
||||||
[](const EraseJob &erase) {
|
else // erase job
|
||||||
qDebug() << "erase";
|
{
|
||||||
auto job =
|
auto erase = std::get<EraseJob>(item);
|
||||||
new QKeychain::DeletePasswordJob("chatterino");
|
auto job = new QKeychain::DeletePasswordJob("chatterino");
|
||||||
job->setAutoDelete(true);
|
job->setAutoDelete(true);
|
||||||
job->setKey(erase.name);
|
job->setKey(erase.name);
|
||||||
QObject::connect(job, &QKeychain::Job::finished, qApp,
|
QObject::connect(job, &QKeychain::Job::finished, qApp,
|
||||||
[](auto) { runNextJob(); });
|
[](auto) { runNextJob(); });
|
||||||
job->start();
|
job->start();
|
||||||
}},
|
}
|
||||||
queue.front());
|
}
|
||||||
queue.pop();
|
queue.pop();
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
static void queueJob(Job &&job)
|
static void queueJob(Job &&job)
|
||||||
{
|
{
|
||||||
|
@ -139,7 +140,7 @@ namespace {
|
||||||
runNextJob();
|
runNextJob();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace chatterino
|
||||||
|
|
||||||
Credentials &Credentials::getInstance()
|
Credentials &Credentials::getInstance()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue