Example #1
0
void TTRssFetcher::startFetching()
{
    auto s = Settings::instance();
    auto db = DatabaseManager::instance();

    if (!db->makeBackup ()) {
        qWarning() << "Unable to make DB backup";
        emit error(506);
        setBusy(false);
        return;
    }

    db->cleanDashboards();

    DatabaseManager::Dashboard d;
    d.id = "ttrss";
    d.name = "Default";
    d.title = "Default";
    d.description = "Tiny Tiny Rss default dashboard";
    db->writeDashboard(d);
    s->setDashboardInUse(d.id);

    db->cleanTabs();
    db->cleanStreams();
    db->cleanModules();

    if(busyType == Fetcher::Initiating) {
        db->cleanCache();
        db->cleanEntries();
    }

    commandList.clear();
    commandList.append(&TTRssFetcher::fetchCategories);
    commandList.append(&TTRssFetcher::fetchFeeds);
    commandList.append(&TTRssFetcher::fetchStream);
    commandList.append(&TTRssFetcher::fetchStarredStream);
    commandList.append(&TTRssFetcher::fetchPublishedStream);
    commandList.append(&TTRssFetcher::pruneOld);

    proggressTotal = commandList.size() + s->getRetentionDays();
    proggress = 0;
    lastDate = 0;
    offset = 0;

    callNextCmd();
}
Example #2
0
void Settings::reset()
{
    if (!getSignedIn()) {
        setLastUpdateDate(0);
        setDashboardInUse("");
        setPassword("");
        setHelpDone(false);
        setCookie("");
        setTwitterCookie("");
        setAuthUrl("");
        setHint1Done(false);
        setCachingMode(0);
        setRetentionDays(14);
        setSyncRead(false);
        setProvider("");
        setUserId("");
        setShowBroadcast(true);
    }
}