forked from quickshell/quickshell
		
	core: only call QmlScanner::scanDir() on directories
Removes a bogus warning message.
This commit is contained in:
		
							parent
							
								
									4b35d7b51b
								
							
						
					
					
						commit
						1af08c0c52
					
				
					 1 changed files with 9 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -65,8 +65,8 @@ void QmlScanner::scanDir(const QString& path) {
 | 
			
		|||
				         || c == '_')
 | 
			
		||||
				{
 | 
			
		||||
				} else {
 | 
			
		||||
					qCWarning(logQmlScanner)
 | 
			
		||||
					    << "Module path contains invalid characters for a module name: " << end;
 | 
			
		||||
					qCWarning(logQmlScanner) << "Module path contains invalid characters for a module name: "
 | 
			
		||||
					                         << path.sliced(this->rootPath.path().length());
 | 
			
		||||
					goto skipadd;
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
| 
						 | 
				
			
			@ -170,13 +170,19 @@ bool QmlScanner::scanQmlFile(const QString& path) {
 | 
			
		|||
			ipath = currentdir.filePath(import);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		auto cpath = QFileInfo(ipath).canonicalFilePath();
 | 
			
		||||
		auto pathInfo = QFileInfo(ipath);
 | 
			
		||||
		auto cpath = pathInfo.canonicalFilePath();
 | 
			
		||||
 | 
			
		||||
		if (cpath.isEmpty()) {
 | 
			
		||||
			qCWarning(logQmlScanner) << "Ignoring unresolvable import" << ipath << "from" << path;
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (!pathInfo.isDir()) {
 | 
			
		||||
			qCDebug(logQmlScanner) << "Ignoring non-directory import" << ipath << "from" << path;
 | 
			
		||||
			continue;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (import.endsWith(".js")) this->scannedFiles.push_back(cpath);
 | 
			
		||||
		else this->scanDir(cpath);
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue