Commit 2bf6daa3 authored by alexander white's avatar alexander white

Fix compilation error >.<

parent 6e572abf
......@@ -380,8 +380,8 @@ static Account::AllowedContentType parse_pleroma_info(QJsonDocument doc){
using ContentType = Account::AllowedContentType;
int result = ContentType::PlainText;
auto obj = doc.object();
if(obj.contains("postFormats")){
for(auto c : obj["postFormats"].toArray()){
if(obj.contains("metadata")){
for(auto c : obj["metadata"].toObject()["postFormats"].toArray()){
if ("text/bbcode"==c.toString()) {
result|=ContentType::BBCode;
} else if ("text/html"==c.toString()) {
......
......@@ -48,8 +48,8 @@ ComposeForm::ComposeForm(Michabo::AccountManager *manager, QWidget *parent)
// My apologies to those who prefer bitsets or a number of booleans to represent
// this logic.
using ContentType = Michabo::Account::AllowedContentType;
auto allowed_content_types = m_account->getAllowedContentTypes();
if (allowed_content_types & ContentType::Plain_text)
auto allowed_content_types = m_account->allowedContentTypes();
if (allowed_content_types & ContentType::PlainText)
m_content_type->addItem (tr("Plain text"), "text/plain");
if (allowed_content_types & ContentType::BBCode)
m_content_type->addItem (tr("BBCode"), "text/bbcode");
......@@ -62,7 +62,7 @@ ComposeForm::ComposeForm(Michabo::AccountManager *manager, QWidget *parent)
m_post_length_counter->setText(QString::number(m_account->max_post_length()));
QObject::connect(m_subject, &QLineEdit::textChanged, this, &ComposeForm::updateScratch);
QObject::connect(m_content, &QTextEdit::textChanged, this, &ComposeForm::updateScratch);
QObject::connect(m_content_type, &QComboBox::currentIndexChanged, this, &ComposeForm::updateScratch);
QObject::connect(m_content_type, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ComposeForm::updateContentType);
m_bottom_box->addWidget(m_post_length_counter, 1, Qt::AlignRight);
m_bottom_box->addWidget(m_button_box);
......@@ -85,6 +85,9 @@ void ComposeForm::updateScratch()
m_scratch->m_subject = m_subject->text();
m_scratch->m_content_type = m_content_type->currentData().toString();
}
void ComposeForm::updateContentType(){
m_scratch->m_content_type = m_content_type->currentData().toString();
}
void ComposeForm::setReplyTo(std::shared_ptr<Michabo::Post> p)
{
......
......@@ -27,7 +27,7 @@ signals:
public slots:
void updateScratch();
void updateContentType();
private:
Michabo::Account *m_account;
QLineEdit *m_subject;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment