Commit 89bc1fc4 authored by Marco Bubke's avatar Marco Bubke
Browse files

Clang: Rename filePaths in ids



UnregisterProjectPartsForCodeCompletionCommand is using them as ids
and not as file paths.

Change-Id: I13a82c1995c60bdb60c72f4fd794aa354fcbb4ef
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 0f46ad4a
......@@ -42,44 +42,44 @@ namespace ClangBackEnd {
UnregisterProjectPartsForCodeCompletionCommand::UnregisterProjectPartsForCodeCompletionCommand(const Utf8StringVector &filePaths)
: filePaths_(filePaths)
: projectPartIds_(filePaths)
{
}
const Utf8StringVector &UnregisterProjectPartsForCodeCompletionCommand::filePaths() const
const Utf8StringVector &UnregisterProjectPartsForCodeCompletionCommand::projectPartIds() const
{
return filePaths_;
return projectPartIds_;
}
QDataStream &operator<<(QDataStream &out, const UnregisterProjectPartsForCodeCompletionCommand &command)
{
out << command.filePaths_;
out << command.projectPartIds_;
return out;
}
QDataStream &operator>>(QDataStream &in, UnregisterProjectPartsForCodeCompletionCommand &command)
{
in >> command.filePaths_;
in >> command.projectPartIds_;
return in;
}
bool operator==(const UnregisterProjectPartsForCodeCompletionCommand &first, const UnregisterProjectPartsForCodeCompletionCommand &second)
{
return first.filePaths_ == second.filePaths_;
return first.projectPartIds_ == second.projectPartIds_;
}
bool operator<(const UnregisterProjectPartsForCodeCompletionCommand &first, const UnregisterProjectPartsForCodeCompletionCommand &second)
{
return compareContainer(first.filePaths_, second.filePaths_);
return compareContainer(first.projectPartIds_, second.projectPartIds_);
}
QDebug operator<<(QDebug debug, const UnregisterProjectPartsForCodeCompletionCommand &command)
{
debug.nospace() << "UnregisterProjectPartsForCodeCompletionCommand(";
for (const Utf8String &fileNames_ : command.filePaths())
for (const Utf8String &fileNames_ : command.projectPartIds())
debug.nospace() << fileNames_ << ", ";
debug.nospace() << ")";
......@@ -91,7 +91,7 @@ void PrintTo(const UnregisterProjectPartsForCodeCompletionCommand &command, ::st
{
*os << "UnregisterProjectPartsForCodeCompletionCommand(";
for (const Utf8String &fileNames_ : command.filePaths())
for (const Utf8String &fileNames_ : command.projectPartIds())
*os << fileNames_.constData() << ", ";
*os << ")";
......
......@@ -49,12 +49,12 @@ class CMBIPC_EXPORT UnregisterProjectPartsForCodeCompletionCommand
public:
UnregisterProjectPartsForCodeCompletionCommand() = default;
UnregisterProjectPartsForCodeCompletionCommand(const Utf8StringVector &filePaths);
UnregisterProjectPartsForCodeCompletionCommand(const Utf8StringVector &projectPartIds);
const Utf8StringVector &filePaths() const;
const Utf8StringVector &projectPartIds() const;
private:
Utf8StringVector filePaths_;
Utf8StringVector projectPartIds_;
};
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const UnregisterProjectPartsForCodeCompletionCommand &command);
......
......@@ -330,7 +330,7 @@ QString toString(const UnregisterProjectPartsForCodeCompletionCommand &command)
QTextStream ts(&out);
ts << "UnregisterProjectPartsForCodeCompletionCommand\n"
<< command.filePaths().join(Utf8String::fromUtf8(",")).toByteArray() << "\n";
<< command.projectPartIds().join(Utf8String::fromUtf8(",")).toByteArray() << "\n";
return out;
}
......
......@@ -99,7 +99,7 @@ void ClangIpcServer::registerProjectPartsForCodeCompletion(const RegisterProject
void ClangIpcServer::unregisterProjectPartsForCodeCompletion(const UnregisterProjectPartsForCodeCompletionCommand &command)
{
try {
projects.remove(command.filePaths());
projects.remove(command.projectPartIds());
} catch (const ProjectPartDoNotExistException &exception) {
client()->projectPartsDoNotExist(ProjectPartsDoNotExistCommand(exception.projectPartIds()));
} catch (const std::exception &exception) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment