[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/office/tellico/src/fetch
From:       Robby Stephenson <robby () periapsis ! org>
Date:       2010-10-01 4:04:53
Message-ID: 20101001040453.CA36CAC892 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1181453 by rstephenson:

icon fix and tweak iterator

 M  +18 -8     fetchmanager.cpp  


--- trunk/extragear/office/tellico/src/fetch/fetchmanager.cpp #1181452:1181453
@@ -145,7 +145,7 @@
   }
 
   KeyMap map;
-  for(KeyMap::ConstIterator it = m_keyMap.begin(); it != m_keyMap.end(); ++it) {
+  for(KeyMap::ConstIterator it = m_keyMap.constBegin(); it != m_keyMap.constEnd(); \
++it) {  if(foundFetcher->canSearch(it.key())) {
       map.insert(it.key(), it.value());
     }
@@ -442,15 +442,15 @@
     const Fetch::ExecExternalFetcher* f = static_cast<const \
Fetch::ExecExternalFetcher*>(fetcher_.data());  const QString p = f->execPath();
     KUrl u;
-    if(p.indexOf(QLatin1String("allocine")) > -1) {
+    if(p.contains(QLatin1String("allocine"))) {
       u = QLatin1String("http://www.allocine.fr");
-    } else if(p.indexOf(QLatin1String("ministerio_de_cultura")) > -1) {
+    } else if(p.contains(QLatin1String("ministerio_de_cultura"))) {
       u = QLatin1String("http://www.mcu.es");
-    } else if(p.indexOf(QLatin1String("dark_horse_comics")) > -1) {
+    } else if(p.contains(QLatin1String("dark_horse_comics"))) {
       u = QLatin1String("http://www.darkhorse.com");
-    } else if(p.indexOf(QLatin1String("boardgamegeek")) > -1) {
+    } else if(p.contains(QLatin1String("boardgamegeek"))) {
       u = QLatin1String("http://www.boardgamegeek.com");
-    } else if(f->source().indexOf(QLatin1String("amarok"), 0, Qt::CaseInsensitive) > \
-1) { +    } else if(f->source().contains(QLatin1String("amarok"), \
Qt::CaseInsensitive)) {  return LOAD_ICON(QLatin1String("amarok"), group_, size_);
     }
     if(!u.isEmpty() && u.isValid()) {
@@ -460,7 +460,7 @@
       }
     }
   }
-  return fetcherIcon(fetcher_->type(), group_);
+  return fetcherIcon(fetcher_->type(), group_, size_);
 }
 
 QPixmap Manager::fetcherIcon(Tellico::Fetch::Type type_, int group_, int size_) {
@@ -471,9 +471,19 @@
     myWarning() << "no pixmap defined for type =" << type_;
   }
 
-  return name.isEmpty() ? QPixmap() : LOAD_ICON(name, group_, size_);
+  if(name.isEmpty()) {
+    return QPixmap();
 }
 
+  QPixmap pix = KIconLoader::global()->loadIcon(name, \
static_cast<KIconLoader::Group>(group_), +                                            \
size_, KIconLoader::DefaultState, +                                                \
QStringList(), 0L, true); +  if(pix.isNull()) {
+    pix = BarIcon(name);
+  }
+  return pix;
+}
+
 Tellico::StringHash Manager::optionalFields(Type type_) {
   if(self()->functionRegistry.contains(type_)) {
     return self()->functionRegistry.value(type_).optionalFields();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic