170 |
|
|
171 |
|
QString pathNormalized; |
172 |
|
QStringList nameWildCard; // entryList requires a QStringList |
173 |
+ |
QStringList resultFiles; // result files with absolute path |
174 |
|
int endOfPathIdx; |
175 |
|
QDir directory; |
176 |
|
|
181 |
|
|
182 |
|
pathNormalized=Util::normalizePath(wildcard); // Convert slashes to work in both mac and windows |
183 |
|
|
184 |
< |
if(pathNormalized.contains("/")){ |
184 |
> |
if(pathNormalized.contains("/")){ // If contains full path |
185 |
|
endOfPathIdx=Util::indexOfBackward(pathNormalized,"/"); // get last slash |
186 |
|
|
187 |
|
nameWildCard.append(pathNormalized.right(pathNormalized.size()-1-endOfPathIdx)); // get the names wildcard // -1 because starts with zeo |
189 |
|
pathNormalized=pathNormalized.left(endOfPathIdx); // get the complete path |
190 |
|
|
191 |
|
directory=QDir(pathNormalized); |
192 |
< |
|
193 |
< |
return directory.entryList(nameWildCard); |
192 |
> |
} |
193 |
> |
else{ // if relative |
194 |
> |
nameWildCard << wildcard; |
195 |
|
} |
196 |
|
|
197 |
< |
nameWildCard << wildcard; |
197 |
> |
foreach (QFileInfo fileInfo, directory.entryInfoList(nameWildCard)){ |
198 |
> |
resultFiles << fileInfo.absoluteFilePath(); |
199 |
> |
} |
200 |
|
|
201 |
< |
return directory.entryList(nameWildCard); |
201 |
> |
return resultFiles; |
202 |
|
} |
203 |
|
|
204 |
|
} |