src/hbcore/effects/hbeffect.cpp
changeset 30 80e4d18b72f5
parent 21 4633027730f5
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
  1081 }
  1081 }
  1082 
  1082 
  1083 /*!
  1083 /*!
  1084   \internal
  1084   \internal
  1085 */
  1085 */
       
  1086 bool HbEffectInternal::add(const char *itemType[], const char *filePath[], const char *effectEvent[], int count)
       
  1087 {
       
  1088 #ifdef HB_EFFECT_API_OFF
       
  1089     Q_UNUSED(itemType);
       
  1090     Q_UNUSED(filePath);
       
  1091     Q_UNUSED(effectEvent);
       
  1092     return false;
       
  1093 #else
       
  1094     bool ret = false;
       
  1095     // Try to add all the files, stop when one fails.
       
  1096     for (int i = 0; i < count; ++i) {
       
  1097         ret = add(QLatin1String(itemType[i]), QLatin1String(filePath[i]), !effectEvent ? QString() : QLatin1String(effectEvent[i]));
       
  1098         if (!ret) {
       
  1099             break;
       
  1100         }
       
  1101     }
       
  1102     // If any of the files were not added then remove all the others too.
       
  1103     if (!ret) {
       
  1104         for (int i = 0; i < count; ++i) {
       
  1105             remove(QLatin1String(itemType[i]), QLatin1String(filePath[i]), !effectEvent ? QString() : QLatin1String(effectEvent[i]));
       
  1106         }
       
  1107     }
       
  1108     return ret;
       
  1109 #endif // HB_EFFECT_API_OFF
       
  1110 }
       
  1111 
       
  1112 /*!
       
  1113   \internal
       
  1114 */
  1086 bool HbEffectInternal::add(QGraphicsItem *item, const QString &filePath, const QString &effectEvent)
  1115 bool HbEffectInternal::add(QGraphicsItem *item, const QString &filePath, const QString &effectEvent)
  1087 {
  1116 {
  1088 #ifdef HB_EFFECT_API_OFF
  1117 #ifdef HB_EFFECT_API_OFF
  1089     Q_UNUSED(item);
  1118     Q_UNUSED(item);
  1090     Q_UNUSED(filePath);
  1119     Q_UNUSED(filePath);