forked from qt-creator/qt-creator
Clang: Rename filePaths in ids
UnregisterProjectPartsForCodeCompletionCommand is using them as ids and not as file paths. Change-Id: I13a82c1995c60bdb60c72f4fd794aa354fcbb4ef Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
This commit is contained in:
@@ -42,44 +42,44 @@ namespace ClangBackEnd {
|
|||||||
|
|
||||||
|
|
||||||
UnregisterProjectPartsForCodeCompletionCommand::UnregisterProjectPartsForCodeCompletionCommand(const Utf8StringVector &filePaths)
|
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)
|
QDataStream &operator<<(QDataStream &out, const UnregisterProjectPartsForCodeCompletionCommand &command)
|
||||||
{
|
{
|
||||||
out << command.filePaths_;
|
out << command.projectPartIds_;
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream &operator>>(QDataStream &in, UnregisterProjectPartsForCodeCompletionCommand &command)
|
QDataStream &operator>>(QDataStream &in, UnregisterProjectPartsForCodeCompletionCommand &command)
|
||||||
{
|
{
|
||||||
in >> command.filePaths_;
|
in >> command.projectPartIds_;
|
||||||
|
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const UnregisterProjectPartsForCodeCompletionCommand &first, const UnregisterProjectPartsForCodeCompletionCommand &second)
|
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)
|
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)
|
QDebug operator<<(QDebug debug, const UnregisterProjectPartsForCodeCompletionCommand &command)
|
||||||
{
|
{
|
||||||
debug.nospace() << "UnregisterProjectPartsForCodeCompletionCommand(";
|
debug.nospace() << "UnregisterProjectPartsForCodeCompletionCommand(";
|
||||||
|
|
||||||
for (const Utf8String &fileNames_ : command.filePaths())
|
for (const Utf8String &fileNames_ : command.projectPartIds())
|
||||||
debug.nospace() << fileNames_ << ", ";
|
debug.nospace() << fileNames_ << ", ";
|
||||||
|
|
||||||
debug.nospace() << ")";
|
debug.nospace() << ")";
|
||||||
@@ -91,7 +91,7 @@ void PrintTo(const UnregisterProjectPartsForCodeCompletionCommand &command, ::st
|
|||||||
{
|
{
|
||||||
*os << "UnregisterProjectPartsForCodeCompletionCommand(";
|
*os << "UnregisterProjectPartsForCodeCompletionCommand(";
|
||||||
|
|
||||||
for (const Utf8String &fileNames_ : command.filePaths())
|
for (const Utf8String &fileNames_ : command.projectPartIds())
|
||||||
*os << fileNames_.constData() << ", ";
|
*os << fileNames_.constData() << ", ";
|
||||||
|
|
||||||
*os << ")";
|
*os << ")";
|
||||||
|
|||||||
@@ -49,12 +49,12 @@ class CMBIPC_EXPORT UnregisterProjectPartsForCodeCompletionCommand
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
UnregisterProjectPartsForCodeCompletionCommand() = default;
|
UnregisterProjectPartsForCodeCompletionCommand() = default;
|
||||||
UnregisterProjectPartsForCodeCompletionCommand(const Utf8StringVector &filePaths);
|
UnregisterProjectPartsForCodeCompletionCommand(const Utf8StringVector &projectPartIds);
|
||||||
|
|
||||||
const Utf8StringVector &filePaths() const;
|
const Utf8StringVector &projectPartIds() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Utf8StringVector filePaths_;
|
Utf8StringVector projectPartIds_;
|
||||||
};
|
};
|
||||||
|
|
||||||
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const UnregisterProjectPartsForCodeCompletionCommand &command);
|
CMBIPC_EXPORT QDataStream &operator<<(QDataStream &out, const UnregisterProjectPartsForCodeCompletionCommand &command);
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ QString toString(const UnregisterProjectPartsForCodeCompletionCommand &command)
|
|||||||
QTextStream ts(&out);
|
QTextStream ts(&out);
|
||||||
|
|
||||||
ts << "UnregisterProjectPartsForCodeCompletionCommand\n"
|
ts << "UnregisterProjectPartsForCodeCompletionCommand\n"
|
||||||
<< command.filePaths().join(Utf8String::fromUtf8(",")).toByteArray() << "\n";
|
<< command.projectPartIds().join(Utf8String::fromUtf8(",")).toByteArray() << "\n";
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ void ClangIpcServer::registerProjectPartsForCodeCompletion(const RegisterProject
|
|||||||
void ClangIpcServer::unregisterProjectPartsForCodeCompletion(const UnregisterProjectPartsForCodeCompletionCommand &command)
|
void ClangIpcServer::unregisterProjectPartsForCodeCompletion(const UnregisterProjectPartsForCodeCompletionCommand &command)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
projects.remove(command.filePaths());
|
projects.remove(command.projectPartIds());
|
||||||
} catch (const ProjectPartDoNotExistException &exception) {
|
} catch (const ProjectPartDoNotExistException &exception) {
|
||||||
client()->projectPartsDoNotExist(ProjectPartsDoNotExistCommand(exception.projectPartIds()));
|
client()->projectPartsDoNotExist(ProjectPartsDoNotExistCommand(exception.projectPartIds()));
|
||||||
} catch (const std::exception &exception) {
|
} catch (const std::exception &exception) {
|
||||||
|
|||||||
Reference in New Issue
Block a user