void ThreadListPatternEditor::patternChanged() {
    parser->thread_list_pattern = pattern();
    engine.setParser(parser);
    engine.setGroup(currentGroup);
    if (!pageSpanningTest) {
        QString glhtml = ui.sourceTextEdit->toPlainText();
        engine.performListThreads(glhtml);
    }
    parserUpdated();
}
Ejemplo n.º 2
0
void ParserManager::storeOrUpdateParser(ForumParser* parser) {
    // Clear parser queue one at a time
    if(!parsersToUpdate.isEmpty() && protocol->isLoggedIn()) {
        updateParser(parsersToUpdate.takeFirst());
    }
    if(!parser) return;
    ForumParser *newParser = parserDatabase->value(parser->id);
    if(!newParser) newParser = new ForumParser(parserDatabase);
    (*newParser) = (*parser);
    Q_ASSERT(newParser != parser);
    Q_ASSERT(newParser->id == parser->id);
    parserDatabase->insert(newParser->id, newParser);
    emit parserUpdated(newParser);
}
void ThreadListPatternEditor::setGroup(ForumGroup *grp) {
    Q_ASSERT(!grp || grp->isSubscribed());
    if(currentGroup == grp) return;
    currentGroup = grp;
    setEnabled(currentGroup);
    ui.downloadButton->setEnabled(currentGroup);
    ui.testPageSpanning->setEnabled(currentGroup);
    if(currentGroup) { // group is a temp object without subscription set
        currentGroup->setSubscription(subscription);
    } else {
        reset();
    }
    parserUpdated();
}