---
libs/libmyth/storagegroup.cpp | 17 11 + 6 - 0 !
1 file changed, 11 insertions(+), 6 deletions(-)
old
|
new
|
|
1128 | 1128 | QString StorageGroup::GetGroupToUse( |
1129 | 1129 | const QString &host, const QString &sgroup) |
1130 | 1130 | { |
1131 | | QString tmpGroup = sgroup; |
1132 | | QString groupKey = QString("%1:%2").arg(sgroup).arg(host); |
| 1131 | QString hostname = host; |
| 1132 | QString storage_group = sgroup; |
| 1133 | hostname.detach(); |
| 1134 | storage_group.detach(); |
| 1135 | |
| 1136 | QString tmpGroup = storage_group; |
| 1137 | QString groupKey = QString("%1:%2").arg(storage_group).arg(hostname); |
1133 | 1138 | |
1134 | 1139 | QMutexLocker locker(&s_groupToUseLock); |
1135 | 1140 | |
… |
… |
|
1139 | 1144 | } |
1140 | 1145 | else |
1141 | 1146 | { |
1142 | | if (StorageGroup::FindDirs(sgroup, host)) |
| 1147 | if (StorageGroup::FindDirs(storage_group, hostname)) |
1143 | 1148 | { |
1144 | | s_groupToUseCache[groupKey] = sgroup; |
| 1149 | s_groupToUseCache[groupKey] = storage_group; |
1145 | 1150 | } |
1146 | 1151 | else |
1147 | 1152 | { |
1148 | 1153 | VERBOSE(VB_FILE+VB_EXTRA, |
1149 | | QString("GetHostSGToUse(): " |
| 1154 | QString("GetGroupToUse(): " |
1150 | 1155 | "falling back to Videos Storage Group for host %1 " |
1151 | 1156 | "since it does not have a %2 Storage Group.") |
1152 | | .arg(host).arg(sgroup)); |
| 1157 | .arg(hostname).arg(storage_group)); |
1153 | 1158 | |
1154 | 1159 | tmpGroup = "Videos"; |
1155 | 1160 | s_groupToUseCache[groupKey] = tmpGroup; |