Переглянути джерело

Remove 'using namespace QtProtobuf;' record from the generated code

Alexey Edelev 2 роки тому
батько
коміт
0958bc33d1

+ 0 - 5
tools/generator/generatorbase.cpp

@@ -163,11 +163,6 @@ void GeneratorBase::printInclude(const std::shared_ptr<::google::protobuf::io::P
     }
 }
 
-void GeneratorBase::printQtProtobufUsingNamespace(const std::shared_ptr<::google::protobuf::io::Printer> printer)
-{
-    printer->Print({{"namespace", "QtProtobuf"}}, Templates::UsingNamespaceTemplate);
-}
-
 void GeneratorBase::printNamespaces(const std::shared_ptr<::google::protobuf::io::Printer> printer, const std::vector<std::string> namespaces) {
     printer->Print("\n");
     for (auto ns : namespaces) {

+ 0 - 1
tools/generator/generatorbase.h

@@ -144,7 +144,6 @@ public:
     static void printDisclaimer(const std::shared_ptr<::google::protobuf::io::Printer> printer);
     static void printPreamble(const std::shared_ptr<::google::protobuf::io::Printer> printer);
     static void printInclude(const std::shared_ptr<::google::protobuf::io::Printer> printer, const google::protobuf::Descriptor *message, const google::protobuf::FieldDescriptor *field, std::set<std::string> &existingIncludes);
-    static void printQtProtobufUsingNamespace(const std::shared_ptr<::google::protobuf::io::Printer> printer);
     static void printNamespaces(const std::shared_ptr<::google::protobuf::io::Printer> printer, const std::vector<std::string> namespaces);
 protected:
     static std::string generateBaseName(const ::google::protobuf::FileDescriptor *file, std::string name);

+ 0 - 1
tools/generator/multifilegenerator.cpp

@@ -176,7 +176,6 @@ bool MultiFileGenerator::Generate(const FileDescriptor *file,
             sourcePrinter->Print({{"include", "QJSValue"}}, Templates::ExternalIncludeTemplate);
         }
 
-        printQtProtobufUsingNamespace(sourcePrinter);
         ClientDefinitionPrinter clientSrcGen(service, sourcePrinter);
         clientSrcGen.run();
     }

+ 0 - 5
tools/generator/singlefilegenerator.cpp

@@ -137,8 +137,6 @@ bool SingleFileGenerator::GenerateMessages(const ::google::protobuf::FileDescrip
         sourcePrinter->Print({{"include", "QQmlEngine"}}, Templates::ExternalIncludeTemplate);
     }
 
-    printQtProtobufUsingNamespace(sourcePrinter);
-
     PackagesList packageList;
     packageList[file->package()].push_back(file);
 
@@ -230,9 +228,6 @@ bool SingleFileGenerator::GenerateServices(const ::google::protobuf::FileDescrip
         sourcePrinter->Print({{"include", "QJSValue"}}, Templates::ExternalIncludeTemplate);
     }
 
-
-    printQtProtobufUsingNamespace(sourcePrinter);
-
     for (int i = 0; i < file->service_count(); i++) {
         const ServiceDescriptor *service = file->service(i);
         // Serverside descriptor is not in use