Commit fe45ce92 authored by Sergio Martins's avatar Sergio Martins

blogilo: Save 1 QHash iteration, 1 memory allocation and 2 lookups

parent 5e99b313
......@@ -126,12 +126,10 @@ MainWindow::MainWindow()
connect(toolbox, &Toolbox::sigError, this, &MainWindow::slotError);
connect(toolbox, &Toolbox::sigBusy, this, &MainWindow::slotBusy);
QList<BilboBlog *> blogList = DBMan::self()->blogList().values();
const int count = blogList.count();
for (int i = 0; i < count; ++i) {
QAction *act = new QAction(>title(), blogs);
foreach (BilboBlog *blog, DBMan::self()->blogList()) {
QAction *act = new QAction(blog->title(), blogs);
connect(blogs, static_cast<void (KSelectAction::*)(QAction *)>(&KSelectAction::triggered), this, &MainWindow::currentBlogChanged);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment