Skip to content

Commit

Permalink
Prevent duplicate inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Furkanzmc committed Mar 26, 2016
1 parent 74a8c70 commit 25d1c9e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ void MainWindow::insertAddonsCMake()
return;
}

QString content;
QString content = "";
bool isCopyEnabled = ui->checkBox->isChecked();
QString addonRootPath = m_OFAddonsPath;
if (isCopyEnabled) {
Expand All @@ -384,9 +384,9 @@ void MainWindow::insertAddonsCMake()
}
}

QStringList sources, headers, libs;
QStringList includePaths;
for (int i = 0; i < m_SelectedAddons.size(); i++) {
QStringList sources, headers, libs;
QStringList includePaths;
const QString addonName = m_SelectedAddons.at(i);
content += "#" + addonName + "\n";
const QString addonPath = addonRootPath + addonName;
Expand Down Expand Up @@ -442,25 +442,25 @@ void MainWindow::insertAddonsCMake()
for (const QString &src : sources) {
content += src + "\n";
}
content += ")\n";
content += ")\n\n";

content += "list(APPEND ADDONS_HEADERS\n";
for (const QString &header : headers) {
content += header + "\n";
}
content += ")\n";
content += ")\n\n";

content += "list(APPEND ADDONS_INCLUDE_PATH\n";
for (const QString &inc : includePaths) {
content += inc + "\n";
}
content += ")\n";
content += ")\n\n";

content += "list(APPEND ADDONS_LIBS\n";
for (const QString &lib : libs) {
content += lib + "\n";
}
content += ")\n";
content += ")\n\n";

QFile file(m_AppPath + "/ofAddons.cmake");
if (file.open(QIODevice::WriteOnly)) {
Expand Down

0 comments on commit 25d1c9e

Please sign in to comment.