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,36 +101,37 @@ namespace {
|
|||
|
||||
if (!queue.empty())
|
||||
{
|
||||
std::visit(
|
||||
Overloaded{
|
||||
[](const SetJob &set) {
|
||||
qDebug() << "set";
|
||||
auto job =
|
||||
new QKeychain::WritePasswordJob("chatterino");
|
||||
// we were gonna use std::visit here but macos is shit
|
||||
|
||||
auto &&item = queue.front();
|
||||
if (item.index() == 0) // set job
|
||||
{
|
||||
auto set = std::get<SetJob>(item);
|
||||
auto job = new QKeychain::WritePasswordJob("chatterino");
|
||||
job->setAutoDelete(true);
|
||||
job->setKey(set.name);
|
||||
job->setTextData(set.credential);
|
||||
QObject::connect(job, &QKeychain::Job::finished, qApp,
|
||||
[](auto) { runNextJob(); });
|
||||
job->start();
|
||||
},
|
||||
[](const EraseJob &erase) {
|
||||
qDebug() << "erase";
|
||||
auto job =
|
||||
new QKeychain::DeletePasswordJob("chatterino");
|
||||
}
|
||||
else // erase job
|
||||
{
|
||||
auto erase = std::get<EraseJob>(item);
|
||||
auto job = new QKeychain::DeletePasswordJob("chatterino");
|
||||
job->setAutoDelete(true);
|
||||
job->setKey(erase.name);
|
||||
QObject::connect(job, &QKeychain::Job::finished, qApp,
|
||||
[](auto) { runNextJob(); });
|
||||
job->start();
|
||||
}},
|
||||
queue.front());
|
||||
}
|
||||
}
|
||||
queue.pop();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
static void queueJob(Job &&job)
|
||||
{
|
||||
static void queueJob(Job &&job)
|
||||
{
|
||||
auto &&queue = jobQueue();
|
||||
|
||||
queue.push(std::move(job));
|
||||
|
@ -138,8 +139,8 @@ namespace {
|
|||
{
|
||||
runNextJob();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
}
|
||||
} // namespace chatterino
|
||||
|
||||
Credentials &Credentials::getInstance()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue