浏览代码

Autogen: Inline settings string generation methods

Sebastian Holtermann 8 年之前
父节点
当前提交
2f3ecd4ea9
共有 2 个文件被更改,包括 20 次插入41 次删除
  1. 20 38
      Source/cmQtAutoGenerators.cxx
  2. 0 3
      Source/cmQtAutoGenerators.h

+ 20 - 38
Source/cmQtAutoGenerators.cxx

@@ -427,51 +427,33 @@ bool cmQtAutoGenerators::ReadAutogenInfoFile(
   return true;
 }
 
-std::string cmQtAutoGenerators::SettingsStringGenMoc() const
+void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile,
+                                          const std::string& targetDirectory)
 {
-  std::string res;
+  // Compose current settings strings
   if (this->MocEnabled()) {
-    res += this->MocCompileDefinitionsStr;
-    res += " ~~~ ";
-    res += this->MocIncludesStr;
-    res += " ~~~ ";
-    res += this->MocOptionsStr;
-    res += " ~~~ ";
-    res += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE";
-    res += " ~~~ ";
+    std::string& str = this->SettingsStringMoc;
+    str += this->MocCompileDefinitionsStr;
+    str += " ~~~ ";
+    str += this->MocIncludesStr;
+    str += " ~~~ ";
+    str += this->MocOptionsStr;
+    str += " ~~~ ";
+    str += this->IncludeProjectDirsBefore ? "TRUE" : "FALSE";
+    str += " ~~~ ";
   }
-  return res;
-}
-
-std::string cmQtAutoGenerators::SettingsStringGenUic() const
-{
-  std::string res;
   if (this->UicEnabled()) {
-    res += cmJoin(this->UicTargetOptions, "@osep@");
-    res += " ~~~ ";
-    res += JoinOptions(this->UicOptions);
-    res += " ~~~ ";
+    std::string& str = this->SettingsStringUic;
+    str += cmJoin(this->UicTargetOptions, "@osep@");
+    str += " ~~~ ";
+    str += JoinOptions(this->UicOptions);
+    str += " ~~~ ";
   }
-  return res;
-}
-
-std::string cmQtAutoGenerators::SettingsStringGenRcc() const
-{
-  std::string res;
   if (this->RccEnabled()) {
-    res += JoinOptions(this->RccOptions);
-    res += " ~~~ ";
+    std::string& str = this->SettingsStringRcc;
+    str += JoinOptions(this->RccOptions);
+    str += " ~~~ ";
   }
-  return res;
-}
-
-void cmQtAutoGenerators::SettingsFileRead(cmMakefile* makefile,
-                                          const std::string& targetDirectory)
-{
-  // Compose current settings strings
-  this->SettingsStringMoc = this->SettingsStringGenMoc();
-  this->SettingsStringUic = this->SettingsStringGenUic();
-  this->SettingsStringRcc = this->SettingsStringGenRcc();
 
   // Read old settings
   const std::string filename = SettingsFile(targetDirectory);

+ 0 - 3
Source/cmQtAutoGenerators.h

@@ -28,9 +28,6 @@ private:
                            const std::string& config);
 
   // - Settings file
-  std::string SettingsStringGenMoc() const;
-  std::string SettingsStringGenUic() const;
-  std::string SettingsStringGenRcc() const;
   void SettingsFileRead(cmMakefile* makefile,
                         const std::string& targetDirectory);
   bool SettingsFileWrite(const std::string& targetDirectory);