Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
c9143952
Commit
c9143952
authored
Feb 06, 2016
by
Ira Aspen
Browse files
Finished add set functionality.
parent
2960cba1
Changes
1
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/tab_deck_editor.cpp
View file @
c9143952
...
...
@@ -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
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment