| 963 | } |
| 964 | |
| 965 | void PlaylistTreeWidget::checkAndUpdateItems() |
| 966 | { |
| 967 | // Append all the playlist items to the output |
| 968 | std::vector<playlistItem *> changedItems; |
| 969 | for (int i = 0; i < topLevelItemCount(); ++i) |
| 970 | { |
| 971 | auto plItem = dynamic_cast<playlistItem *>(this->topLevelItem(i)); |
| 972 | |
| 973 | // Check (and reset) the flag if the source was changed. |
| 974 | if (plItem->isSourceChanged()) |
| 975 | changedItems.push_back(plItem); |
| 976 | } |
| 977 | |
| 978 | if (!changedItems.empty()) |
| 979 | { |
| 980 | auto ret = |
| 981 | QMessageBox::question(parentWidget(), |
| 982 | "Item changed", |
| 983 | "The source of one or more currently loaded items has changed. " |
| 984 | "Do you want to reload the item(s)?"); |
| 985 | if (ret != QMessageBox::Yes) |
| 986 | { |
| 987 | ret = QMessageBox::question( |
| 988 | parentWidget(), |
| 989 | "Item changed", |
| 990 | "It is really recommended to reload the changed items. YUView does not always buffer all " |
| 991 | "data from the items. We can not guarantee that the data you are shown is correct " |
| 992 | "anymore. For the shown values, there is no indication if they are old or new. Parsing " |
| 993 | "of statistics files may fail. So again: Do you want to reload the item(s)?"); |
| 994 | if (ret != QMessageBox::Yes) |
| 995 | return; // Really no |
| 996 | } |
| 997 | |
| 998 | for (auto plItem : changedItems) |
| 999 | plItem->reloadItemSource(); |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | void PlaylistTreeWidget::updateSettings() |
| 1004 | { |
no test coverage detected