summaryrefslogtreecommitdiff
path: root/src/urlbar/listitem.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-04-20 12:34:12 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-04-20 12:34:12 +0200
commitf68a57ae64887cc1d9c18efed629df3b1cc49bb8 (patch)
treeef42866bbed79b033760596cfd3799c8962a9f73 /src/urlbar/listitem.cpp
parentPartially fixing deleteLater related crashes. But... why these crashes (diff)
downloadrekonq-f68a57ae64887cc1d9c18efed629df3b1cc49bb8.tar.xz
Reverting the switch case to an if-else one.
I forgot t consider the particular condition in it. Sorry for the mistake.
Diffstat (limited to 'src/urlbar/listitem.cpp')
-rw-r--r--src/urlbar/listitem.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 7dc22dda..a182c1a2 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -417,21 +417,20 @@ ListItem *ListItemFactory::create(const UrlSearchItem &item, const QString &text
{
ListItem *newItem;
- switch(item.type)
+ if(item.type & UrlSearchItem::Browse)
{
- case UrlSearchItem::Browse:
newItem = new BrowseListItem(item, text, parent);
- break;
-
- case UrlSearchItem::Search:
- newItem = new SearchListItem(item, text, parent);
- break;
-
- case UrlSearchItem::History:
- case UrlSearchItem::Bookmark:
- default:
- newItem = new PreviewListItem(item, text, parent);
- break;
+ }
+ else
+ {
+ if(item.type & UrlSearchItem::Search)
+ {
+ newItem = new SearchListItem(item, text, parent);
+ }
+ else
+ {
+ newItem = new PreviewListItem(item, text, parent);
+ }
}
return newItem;