~ubuntu-branches/ubuntu/trusty/kdeplasma-addons/trusty

« back to all changes in this revision

Viewing changes to applets/news/news.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Thomas
  • Date: 2010-05-25 09:50:14 UTC
  • mfrom: (1.1.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100525095014-6mlrm9z9bkws0zkt
Tags: 4:4.4.80-0ubuntu1
* New upstream beta release:
  - Bump kde-sc-dev-latest build-dep version to 4.4.80
  - Refresh kubuntu_04_kimpanel_disable_scim.diff
  - Update various .install files
  - Drop liblancelot0a and liblancelot-dev packages; Upstream has broken ABI
    without an .so version bump, and after discussion with Debian it was
    decided it was not worth it to ship an unstable library.
  - Add liblancelot files to plasma-widget-lancelot, adding appropriate
    Replaces: entries
* Switch to source format 3.0 (quilt):
  - Bump debhelper build-depend version to 7.3.16 or greater

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#include <Plasma/Theme>
37
37
#include <Plasma/WebView>
38
38
 
39
 
static const char *BEGIN = 
 
39
static const char *BEGIN =
40
40
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"
41
41
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
42
42
"\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"
98
98
        return m_graphicsWidget;
99
99
    }
100
100
 
101
 
    KConfigGroup cg = config();
102
 
    m_interval = cg.readEntry("interval", 30);
103
 
    m_showTimestamps = cg.readEntry("showTimestamps", true);
104
 
    m_showTitles = cg.readEntry("showTitles", true);
105
 
    m_showDescriptions = cg.readEntry("showDescriptions", false);
106
 
 
107
 
    m_feeds = cg.readEntry("feeds", QStringList("http://www.kde.org/dotkdeorg.rdf"));
108
 
 
109
101
    m_layout = new QGraphicsLinearLayout();
110
102
    m_layout->setContentsMargins(0, 0, 0, 0);
111
103
    m_layout->setSpacing(0);
131
123
    //a tiny minimum size, a panel 48px high is enough to display the whole applet
132
124
    m_graphicsWidget->setMinimumSize(150, 48);
133
125
 
134
 
    connectToEngine();
 
126
    configChanged();
135
127
 
136
128
    return m_graphicsWidget;
137
129
}
138
130
 
 
131
void News::configChanged()
 
132
{
 
133
    kDebug();
 
134
    KConfigGroup cg = config();
 
135
    m_interval = cg.readEntry("interval", 30);
 
136
    m_showTimestamps = cg.readEntry("showTimestamps", true);
 
137
    m_showTitles = cg.readEntry("showTitles", true);
 
138
    m_showDescriptions = cg.readEntry("showDescriptions", false);
 
139
 
 
140
    m_feeds = cg.readEntry("feeds", QStringList("http://www.kde.org/dotkdeorg.rdf"));
 
141
 
 
142
    connectToEngine();
 
143
}
 
144
 
139
145
void News::connectToEngine()
140
146
{
141
147
    if (!m_feeds.isEmpty()) {
311
317
    cg.writeEntry("showTitles", m_showTitles);
312
318
    cg.writeEntry("showDescriptions", m_showDescriptions);
313
319
 
314
 
    connectToEngine();
315
320
    dataUpdated(m_feedstring, m_dataCache);
316
321
}
317
322