| 131 | } |
| 132 | |
| 133 | void ProjectPathsModel::setPaths(const QVector< ConfigEntry >& paths ) |
| 134 | { |
| 135 | beginResetModel(); |
| 136 | projectPaths.clear(); |
| 137 | for (const ConfigEntry& existingPathConfig : paths) { |
| 138 | // Sanitize the path of loaded config |
| 139 | ConfigEntry config = existingPathConfig; |
| 140 | bool rootPath = config.path == QLatin1String(".") ? true : false; |
| 141 | config.path = sanitizePath(rootPath ? QString() : config.path ); |
| 142 | addPathInternal(config, rootPath); |
| 143 | } |
| 144 | addPathInternal( ConfigEntry(sanitizePath( QString() )), true ); // add an empty "root" config entry if one does not exist |
| 145 | endResetModel(); |
| 146 | } |
| 147 | |
| 148 | bool ProjectPathsModel::removeRows( int row, int count, const QModelIndex& parent ) |
| 149 | { |
no test coverage detected