[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.2/kdepim/akregator/src
From: Frank Osterfeld <frank.osterfeld () kdemail ! net>
Date: 2009-03-25 10:25:11
Message-ID: 1237976711.931418.22927.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 944215 by osterfeld:
backport:
r944013 osterfeld
make Open in Tab/External Browser work with multiple articles selected
Patch by Haakon Nilsen
CCBUG:187856
M +2 -2 actionmanagerimpl.cpp
M +20 -15 mainwidget.cpp
M +2 -2 mainwidget.h
--- branches/KDE/4.2/kdepim/akregator/src/actionmanagerimpl.cpp #944214:944215
@@ -299,13 +299,13 @@
action = coll->addAction("article_open" );
action->setIcon(KIcon("tab-new"));
action->setText(i18n("Open in Tab"));
- connect(action, SIGNAL(triggered(bool)), d->mainWidget, \
SLOT(slotOpenCurrentArticle())); + connect(action, SIGNAL(triggered(bool)), \
d->mainWidget, SLOT(slotOpenSelectedArticles())); action->setShortcuts(KShortcut( \
"Shift+Return" ));
action = coll->addAction("article_open_external" );
action->setIcon(KIcon("window-new"));
action->setText(i18n("Open in External Browser"));
- connect(action, SIGNAL(triggered(bool)), d->mainWidget, \
SLOT(slotOpenCurrentArticleInBrowser())); + connect(action, \
SIGNAL(triggered(bool)), d->mainWidget, SLOT(slotOpenSelectedArticlesInBrowser())); \
action->setShortcuts(KShortcut( "Ctrl+Shift+Return" ));
action = coll->addAction("article_copy_link_address" );
--- branches/KDE/4.2/kdepim/akregator/src/mainwidget.cpp #944214:944215
@@ -920,9 +920,12 @@
}
}
-void Akregator::MainWidget::slotOpenCurrentArticleInBrowser()
+void Akregator::MainWidget::slotOpenSelectedArticlesInBrowser()
{
- slotOpenArticleInBrowser( m_selectionController->currentArticle() );
+ const QList<Article> articles = m_selectionController->selectedArticles();
+
+ Q_FOREACH( const Akregator::Article& article, articles )
+ slotOpenArticleInBrowser( article );
}
void Akregator::MainWidget::slotOpenArticleInBrowser(const Akregator::Article& \
article) @@ -936,22 +939,24 @@
}
-void Akregator::MainWidget::slotOpenCurrentArticle()
+void Akregator::MainWidget::slotOpenSelectedArticles()
{
- Article article = m_selectionController->currentArticle();
- if ( article.isNull() )
- return;
+ const QList<Article> articles = m_selectionController->selectedArticles();
- const KUrl url = article.link();
- if ( !url.isValid() )
- return;
+ Q_FOREACH( const Akregator::Article& article, articles )
+ {
+ const KUrl url = article.link();
+ if ( !url.isValid() )
+ continue;
- OpenUrlRequest req( url );
- req.setOptions( OpenUrlRequest::NewTab );
- // TODO: (re-)add a setting for foreground/background
- // and use it here
- //req.setOpenInBackground( true );
- Kernel::self()->frameManager()->slotOpenUrlRequest( req );
+ OpenUrlRequest req( url );
+ req.setOptions( OpenUrlRequest::NewTab );
+ // TODO: (re-)add a setting for foreground/background
+ // and use it here
+ //req.setOpenInBackground( true );
+ Kernel::self()->frameManager()->slotOpenUrlRequest( req );
+ }
+
}
void Akregator::MainWidget::slotCopyLinkAddress()
--- branches/KDE/4.2/kdepim/akregator/src/mainwidget.h #944214:944215
@@ -125,10 +125,10 @@
/** opens the current article (currentItem) in external browser
TODO: use selected instead of current? */
- void slotOpenCurrentArticleInBrowser();
+ void slotOpenSelectedArticlesInBrowser();
/** opens current article in new tab, background/foreground depends on \
settings TODO: use selected instead of current? */
- void slotOpenCurrentArticle();
+ void slotOpenSelectedArticles();
void slotOnShutdown();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic