Exemple #1
0
	void RSSManager::addFeed(std::string url)
	{
		// TODO error check

		RSSFeed feed;
		feed.url = url;
		
		bool success = false;
		RSSDocument doc;
		std::vector<char> & file = manager.downloadSingle(feed.url, success);

		if (success)
		{
			doc.Parse(file.data(), file.size());

			feed.name = doc.getTitle();

			addFeed(feed);

			// might as well update the thing

			// get new id
			feed = getFeedFromUrl(feed.url);

			updateFeedFromDoc(&doc, feed.id);
		}
		else
		{
			// TODO do something else
		}
	}
Exemple #2
0
void AddFeedWizard::finishButtonClicked()
{
  if (currentId() == 0) {
    finishOn = true;
    addFeed();
  } else if (currentId() == 1) {
    finish();
  }
}
 void SyndicationPlugin::load()
 {
     activity = new SyndicationActivity(this, 0);
     connect(add_feed, SIGNAL(triggered()), activity, SLOT(addFeed()));
     connect(remove_feed, SIGNAL(triggered()), activity, SLOT(removeFeed()));
     connect(manage_filters, SIGNAL(triggered()), activity, SLOT(manageFilters()));
     connect(add_filter, SIGNAL(triggered()), activity, SLOT(addFilter()));
     connect(remove_filter, SIGNAL(triggered()), activity, SLOT(removeFilter()));
     connect(edit_filter, SIGNAL(triggered()), activity, SLOT(editFilter()));
     connect(edit_feed_name, SIGNAL(triggered()), activity, SLOT(editFeedName()));
     getGUI()->addActivity(activity);
     activity->loadState(KGlobal::config());
 }
Exemple #4
0
RSSManager::RSSManager(BrowserWindow* window, QWidget* parent)
    : QWidget(parent)
    , ui(new Ui::RSSManager)
    , m_window(window)
{
    ui->setupUi(this);
#ifdef Q_OS_MAC
    ui->tabWidget->setDocumentMode(false);
#endif
    ui->tabWidget->setElideMode(Qt::ElideRight);
    m_networkManager = mApp->networkManager();

    m_reloadButton = new QToolButton(this);
    m_reloadButton->setAutoRaise(true);
    m_reloadButton->setToolTip(tr("Reload"));
    m_reloadButton->setIcon(QIcon::fromTheme(QSL("view-refresh")));

    ui->tabWidget->setCornerWidget(m_reloadButton);

    connect(m_reloadButton, SIGNAL(clicked()), this, SLOT(reloadFeeds()));
    connect(ui->add, SIGNAL(clicked()), this, SLOT(addFeed()));
    connect(ui->deletebutton, SIGNAL(clicked()), this, SLOT(deleteFeed()));
    connect(ui->edit, SIGNAL(clicked()), this, SLOT(editFeed()));
}
RSSManager::RSSManager(QupZilla* mainClass, QWidget* parent)
    : QWidget(parent)
    , ui(new Ui::RSSManager)
    , p_QupZilla(mainClass)
{
    ui->setupUi(this);

    ui->tabWidget->setElideMode(Qt::ElideRight);
    m_networkManager = mApp->networkManager();

    m_reloadButton = new QToolButton(this);
    m_reloadButton->setAutoRaise(true);
    m_reloadButton->setToolTip(tr("Reload"));
    m_reloadButton->setIcon(IconProvider::standardIcon(QStyle::SP_BrowserReload));

    ui->tabWidget->setCornerWidget(m_reloadButton);

    connect(m_reloadButton, SIGNAL(clicked()), this, SLOT(reloadFeeds()));
    connect(ui->add, SIGNAL(clicked()), this, SLOT(addFeed()));
    connect(ui->deletebutton, SIGNAL(clicked()), this, SLOT(deleteFeed()));
    connect(ui->edit, SIGNAL(clicked()), this, SLOT(editFeed()));

    connect(ui->optimizeDb, SIGNAL(clicked(QPoint)), this, SLOT(optimizeDb()));
}
Exemple #6
0
void AddFeedWizard::nextButtonClicked()
{
  if (currentId() == 0)
    addFeed();
}
Exemple #7
0
void NewusGui::debug_testInsert() {
	addFeed("http://www.rockpapershotgun.com/feed/");
	addFeed("http://www.pcinpact.com/include/news.xml");
	fetchingNews();
}