~ubuntu-branches/ubuntu/karmic/kdeplasma-addons/karmic-updates

« back to all changes in this revision

Viewing changes to applets/rssnow/news.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Harald Sitter, Christian Mangold, Alessandro Ghersi, Harald Sitter
  • Date: 2009-08-30 20:11:55 UTC
  • mfrom: (1.1.16 upstream)
  • Revision ID: james.westby@ubuntu.com-20090830201155-ftsg6ehgrdsrcn8f
Tags: 4:4.3.1-0ubuntu1
[ Christian Mangold ]
* New upstream release
* Bump version of KDE build-deps to 4.3.1

[Alessandro Ghersi]
* Add libxcomposite-dev, libxrender-dev and libxdamage-dev to build-deps
  to build compositing support for Lancelot. (LP: #408235)
  (Thanks to Khashayar Naderehvandi)

[ Harald Sitter ]
* Fix armel build using kubuntu_01_fix_armel_build.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
263
263
    if (m_logo) {
264
264
        m_layout->addItem(m_header);
265
265
        m_header->show();
 
266
    } else {
 
267
        m_header->hide();
266
268
    }
267
269
 
268
270
    qDeleteAll(m_scrollerList);
336
338
 
337
339
            KConfigGroup cg = config();
338
340
            cg.writeEntry("feeds", m_feedlist);
 
341
            emit configNeedsSaving();
339
342
 
340
343
            updateScrollers();
341
344
            connectToEngine();
345
348
 
346
349
void News::constraintsEvent(Plasma::Constraints constraints)
347
350
{
348
 
    kDebug() << "constrainsUpdated : " << constraints;
 
351
    //kDebug() << "constrainsUpdated : " << constraints;
349
352
    if (constraints & Plasma::FormFactorConstraint || constraints & Plasma::SizeConstraint ) {
350
353
        if (formFactor() == Plasma::Horizontal) {
351
354
            int minSize = (m_feedlist.size() * m_scrollerList.first()->minimumSize().height()) + m_header->size().height();
352
 
            kDebug() << "minimum size to contain all scrollers: " << minSize;
353
 
            if (geometry().height() < minSize && !m_collapsed) {
 
355
            //kDebug() << "minimum size to contain all scrollers: " << minSize << m_feedlist;
 
356
            if (contentsRect().height() < minSize) {
354
357
                //group all feeds together so it can fit (only a single time):
355
358
                QString allfeeds;
356
359
                foreach (const QString &feed, m_feedlist) {
367
370
                m_collapsed = true;
368
371
                updateScrollers();
369
372
            } else {
370
 
                //TODO: restore default settings.
 
373
                m_collapsed = false;
 
374
                m_logo = config().readEntry("logo", true);
 
375
                m_feedlist = config().readEntry("feeds", QStringList("http://dot.kde.org/rss.xml"));
 
376
                updateScrollers();
371
377
            }
372
378
        }
373
379
    }