forked from qt-creator/qt-creator
		
	FileUtils: Replace FileNameList with an alias
The functionality in that class is covered by initializers and Utils::unique, so there is no need to keep a custom class. This way FileNameList plays way nicer with utils/algorithm.h. Change-Id: I8eeae6aca0558ecd998920c4fdfc5ea56bf75501 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
		@@ -40,6 +40,7 @@
 | 
			
		||||
#include <coreplugin/progressmanager/progressmanager.h>
 | 
			
		||||
#include <texteditor/basefilefind.h>
 | 
			
		||||
 | 
			
		||||
#include <utils/algorithm.h>
 | 
			
		||||
#include <utils/qtcassert.h>
 | 
			
		||||
#include <utils/runextensions.h>
 | 
			
		||||
#include <utils/textfileformat.h>
 | 
			
		||||
@@ -280,7 +281,7 @@ static void find_helper(QFutureInterface<Usage> &future,
 | 
			
		||||
 | 
			
		||||
    const Utils::FileName sourceFile = Utils::FileName::fromUtf8(symbol->fileName(),
 | 
			
		||||
                                                                 symbol->fileNameLength());
 | 
			
		||||
    Utils::FileNameList files(sourceFile);
 | 
			
		||||
    Utils::FileNameList files {sourceFile};
 | 
			
		||||
 | 
			
		||||
    if (symbol->isClass()
 | 
			
		||||
        || symbol->isForwardClassDeclaration()
 | 
			
		||||
@@ -300,7 +301,7 @@ static void find_helper(QFutureInterface<Usage> &future,
 | 
			
		||||
    } else {
 | 
			
		||||
        files += snapshot.filesDependingOn(sourceFile);
 | 
			
		||||
    }
 | 
			
		||||
    files.removeDuplicates();
 | 
			
		||||
    files = Utils::filteredUnique(files);
 | 
			
		||||
 | 
			
		||||
    future.setProgressRange(0, files.size());
 | 
			
		||||
 | 
			
		||||
@@ -617,9 +618,8 @@ static void findMacroUses_helper(QFutureInterface<Usage> &future,
 | 
			
		||||
                                 const Macro macro)
 | 
			
		||||
{
 | 
			
		||||
    const Utils::FileName sourceFile = Utils::FileName::fromString(macro.fileName());
 | 
			
		||||
    Utils::FileNameList files(sourceFile);
 | 
			
		||||
    files += snapshot.filesDependingOn(sourceFile);
 | 
			
		||||
    files.removeDuplicates();
 | 
			
		||||
    Utils::FileNameList files {sourceFile};
 | 
			
		||||
    files = Utils::filteredUnique(files + snapshot.filesDependingOn(sourceFile));
 | 
			
		||||
 | 
			
		||||
    future.setProgressRange(0, files.size());
 | 
			
		||||
    FindMacroUsesInFile process(workingCopy, snapshot, macro, &future);
 | 
			
		||||
 
 | 
			
		||||
@@ -39,6 +39,7 @@
 | 
			
		||||
 | 
			
		||||
#include <cplusplus/Overview.h>
 | 
			
		||||
#include <cplusplus/LookupContext.h>
 | 
			
		||||
#include <utils/algorithm.h>
 | 
			
		||||
#include <utils/qtcassert.h>
 | 
			
		||||
 | 
			
		||||
#include <QDebug>
 | 
			
		||||
@@ -290,11 +291,9 @@ bool skipFileDueToSizeLimit(const QFileInfo &fileInfo, int limitInMB)
 | 
			
		||||
 | 
			
		||||
Utils::FileNameList modifiedFiles()
 | 
			
		||||
{
 | 
			
		||||
    Utils::FileNameList files;
 | 
			
		||||
    foreach (Core::IDocument *doc, Core::DocumentManager::modifiedDocuments())
 | 
			
		||||
        files.append(doc->filePath());
 | 
			
		||||
    files.removeDuplicates();
 | 
			
		||||
    return files;
 | 
			
		||||
    Utils::FileNameList files = Utils::transform(Core::DocumentManager::modifiedDocuments(),
 | 
			
		||||
                                                 &Core::IDocument::filePath);
 | 
			
		||||
    return Utils::filteredUnique(files);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
} // CppTools
 | 
			
		||||
 
 | 
			
		||||
@@ -37,6 +37,8 @@
 | 
			
		||||
 | 
			
		||||
#include <cplusplus/CppDocument.h>
 | 
			
		||||
 | 
			
		||||
#include <utils/fileutils.h>
 | 
			
		||||
 | 
			
		||||
QT_BEGIN_NAMESPACE
 | 
			
		||||
class QChar;
 | 
			
		||||
class QFileInfo;
 | 
			
		||||
@@ -44,10 +46,6 @@ class QStringRef;
 | 
			
		||||
class QTextCursor;
 | 
			
		||||
QT_END_NAMESPACE
 | 
			
		||||
 | 
			
		||||
namespace Utils {
 | 
			
		||||
class FileNameList;
 | 
			
		||||
} // namespace Utils
 | 
			
		||||
 | 
			
		||||
namespace CPlusPlus {
 | 
			
		||||
class Macro;
 | 
			
		||||
class Symbol;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user