Commit c9143952 authored by Ira Aspen's avatar Ira Aspen
Browse files

Finished add set functionality.

parent 2960cba1
......@@ -891,6 +891,19 @@ void TabDeckEditor::actAddCustomSet()
return;
QString fileName = dialog.selectedFiles().at(0);
QDir dir(dataDir.append("/customsets"));
QStringList files = dir.entryList();
int maxIndex = 0;
for (int i = 0; i < files.size(); ++i) {
int fileIndex = files.at(i).split(".").at(0).toInt();
if (fileIndex > maxIndex)
maxIndex = fileIndex;
}
maxIndex++;
bool res = QFile::copy(
fileName, dir.absolutePath() + "/" + (maxIndex > 9 ? "" : "0") +
QString::number(maxIndex) + "." + QFileInfo(fileName).fileName()
);
}
void TabDeckEditor::actEditSets()
......
Supports Markdown
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