Showing the changes to libraries/script-engine/src/ScriptsModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -25,7 +25,6 @@ · 24 unmodified lines | |||
| 25 | #define __STR1__(x) __STR2__(x) | 25 | #define __STR1__(x) __STR2__(x) |
| 26 | #define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : Warning Msg: " | 26 | #define __LOC__ __FILE__ "(" __STR1__(__LINE__) ") : Warning Msg: " |
| 27 | 27 | ||
| 28 | static const QString MODELS_LOCATION = "scripts/"; | ||
| 29 | static const QString PREFIX_PARAMETER_NAME = "prefix"; | 28 | static const QString PREFIX_PARAMETER_NAME = "prefix"; |
| 30 | static const QString MARKER_PARAMETER_NAME = "marker"; | 29 | static const QString MARKER_PARAMETER_NAME = "marker"; |
| 31 | static const QString IS_TRUNCATED_NAME = "IsTruncated"; | 30 | static const QString IS_TRUNCATED_NAME = "IsTruncated"; |
| @@ -159,8 +158,7 @@ void ScriptsModel::requestDefaultFiles(QString marker) { · 127 unmodified lines | |||
| 159 | 158 | ||
| 160 | if (url.isLocalFile()) { | 159 | if (url.isLocalFile()) { |
| 161 | // if the url indicates a local directory, use QDirIterator | 160 | // if the url indicates a local directory, use QDirIterator |
| 162 | // QString localDir = url.toLocalFile() + "/scripts"; | 161 | QString localDir = expandScriptUrl(url).toLocalFile(); |
| 163 | QString localDir = expandScriptUrl(url).toLocalFile() + "/scripts"; | ||
| 164 | int localDirPartCount = localDir.split("/").size(); | 162 | int localDirPartCount = localDir.split("/").size(); |
| 165 | #ifdef Q_OS_WIN | 163 | #ifdef Q_OS_WIN |
| 166 | localDirPartCount++; // one for the drive letter | 164 | localDirPartCount++; // one for the drive letter |
| @@ -176,7 +174,7 @@ void ScriptsModel::requestDefaultFiles(QString marker) { · 9 unmodified lines | |||
| 176 | } else { | 174 | } else { |
| 177 | // the url indicates http(s), use QNetworkRequest | 175 | // the url indicates http(s), use QNetworkRequest |
| 178 | QUrlQuery query; | 176 | QUrlQuery query; |
| 179 | query.addQueryItem(PREFIX_PARAMETER_NAME, MODELS_LOCATION); | 177 | query.addQueryItem(PREFIX_PARAMETER_NAME, "."); |
| 180 | if (!marker.isEmpty()) { | 178 | if (!marker.isEmpty()) { |
| 181 | query.addQueryItem(MARKER_PARAMETER_NAME, marker); | 179 | query.addQueryItem(MARKER_PARAMETER_NAME, marker); |
| 182 | } | 180 | } |