mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
maybe??
This commit is contained in:
parent
4d99d2dade
commit
277bd5b179
1 changed files with 7 additions and 7 deletions
|
@ -8,7 +8,7 @@
|
||||||
#include "util/Overloaded.hpp"
|
#include "util/Overloaded.hpp"
|
||||||
|
|
||||||
#include <QSaveFile>
|
#include <QSaveFile>
|
||||||
#include <variant>
|
#include <boost/variant.hpp>
|
||||||
|
|
||||||
#define FORMAT_NAME \
|
#define FORMAT_NAME \
|
||||||
([&] { \
|
([&] { \
|
||||||
|
@ -87,7 +87,7 @@ namespace {
|
||||||
QString name;
|
QString name;
|
||||||
};
|
};
|
||||||
|
|
||||||
using Job = std::variant<SetJob, EraseJob>;
|
using Job = boost::variant<SetJob, EraseJob>;
|
||||||
|
|
||||||
static std::queue<Job> &jobQueue()
|
static std::queue<Job> &jobQueue()
|
||||||
{
|
{
|
||||||
|
@ -104,9 +104,10 @@ namespace {
|
||||||
// we were gonna use std::visit here but macos is shit
|
// we were gonna use std::visit here but macos is shit
|
||||||
|
|
||||||
auto &&item = queue.front();
|
auto &&item = queue.front();
|
||||||
if (item.index() == 0) // set job
|
|
||||||
|
if (item.which() == 0) // set job
|
||||||
{
|
{
|
||||||
auto set = std::get<SetJob>(item);
|
auto set = boost::get<SetJob>(item);
|
||||||
auto job = new QKeychain::WritePasswordJob("chatterino");
|
auto job = new QKeychain::WritePasswordJob("chatterino");
|
||||||
job->setAutoDelete(true);
|
job->setAutoDelete(true);
|
||||||
job->setKey(set.name);
|
job->setKey(set.name);
|
||||||
|
@ -117,7 +118,7 @@ namespace {
|
||||||
}
|
}
|
||||||
else // erase job
|
else // erase job
|
||||||
{
|
{
|
||||||
auto erase = std::get<EraseJob>(item);
|
auto erase = boost::get<EraseJob>(item);
|
||||||
auto job = new QKeychain::DeletePasswordJob("chatterino");
|
auto job = new QKeychain::DeletePasswordJob("chatterino");
|
||||||
job->setAutoDelete(true);
|
job->setAutoDelete(true);
|
||||||
job->setKey(erase.name);
|
job->setKey(erase.name);
|
||||||
|
@ -125,6 +126,7 @@ namespace {
|
||||||
[](auto) { runNextJob(); });
|
[](auto) { runNextJob(); });
|
||||||
job->start();
|
job->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
queue.pop();
|
queue.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -191,7 +193,6 @@ void Credentials::set(const QString &provider, const QString &name_,
|
||||||
|
|
||||||
if (useKeyring())
|
if (useKeyring())
|
||||||
{
|
{
|
||||||
qDebug() << "queue set";
|
|
||||||
queueJob(SetJob{name, credential});
|
queueJob(SetJob{name, credential});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -212,7 +213,6 @@ void Credentials::erase(const QString &provider, const QString &name_)
|
||||||
|
|
||||||
if (useKeyring())
|
if (useKeyring())
|
||||||
{
|
{
|
||||||
qDebug() << "queue erase";
|
|
||||||
queueJob(EraseJob{name});
|
queueJob(EraseJob{name});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue