Commit graph

67 commits

Author SHA1 Message Date
Zach H
3536fa8a75
Fix #4072 by changing outdated HTTP to HTTPS calls within the codebase (#4073) 2020-08-23 17:24:26 -04:00
ebbit1q
0337f58088
add extra exceptions to plaintext imports (#4018)
this specifically to support imports from mtg arena that have a set code
and then a collectors number like (ABC) 123 at the end, this pr strips
that from the card name (we don't use it anyway)

fixes #4011
2020-06-02 10:56:01 -04:00
Olxinos
db85ec48c7
Minor fixes to some std::sort calls (#3967) 2020-04-23 11:23:59 -04:00
ebbit1q
18a07274d4
clangify everything with the new header sorting (#3908) 2020-03-18 17:36:02 -04:00
ebbit1q
a80c756dcb
update deprecated methods in qt5.14 and protobuf 3.4 (#3906) 2020-03-16 20:41:41 -04:00
ctrlaltca
b6df5a4ac3 Deal with recent Qt methods deprecation (#3801)
* Deal with recent Qt methods deprecation

 * Use std::sort, std::less instead of qSort/qLess
 * Use QFontMetrics::horizontalAdvance instead of ::width
 * Use qApp->primaryScreen() instead of QDesktopWidget
 * use lambas instead of QSignalMapper
 * Use QTreeWidgetItem::setForeground instead of ::setTextColor
 * Use QDir::setPath instead of operator=(QString)
 * Use QList::swapItemsAt instead of ::swap

* fix error
2019-08-27 20:06:54 -04:00
ebbit1q
e1e9caf0ef Load plain improvements (#3422)
* improve loading from plain text

Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.

* clang format comments

apparently clang-format even complains about the spacing in your
comments

* refactor loading_from_clipboard tests

Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.

* fix compatibility with more formats

skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.

* remove bugged test

The current load from plain is simply broken, removed checking the
comments for correct contents.

* rework load_from_clipboard tests again

rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase

* improve loading from plain text

Fixes the loadFromStream_Plain function that is used to load plain text
decklists.
The rewritten function uses more regexes and is a bit cleaner.
This fixes multiple bugs with loading the various sources of decklists.
Note that the new function still has a few issues that are shared with
the original version like creating duplicate cards.

* clang format comments

apparently clang-format even complains about the spacing in your
comments

* refactor loading_from_clipboard tests

Remove all heap allocation and use references.
Use std::pair and std::string so gtest will show the cardnames in error messages.
(note that using QPair or QString does not work with gtest)
Improve the last two testcases to include weird names; and name and
comments testing.
Remove empty header file.

* fix compatibility with more formats

skip "sideboard" line
include everything in mainboard when there are multiple empty lines
add removal of the mwdeck cardversion selector in round braces
add replacal of lowercase ae combination that should never occur
Set cardname to lowercase as apparently our checks are hardcoded to only
accept lowercase.

* remove bugged test

The current load from plain is simply broken, removed checking the
comments for correct contents.

* rework load_from_clipboard tests again

rework the test to have less code duplication
add more tests and more special cases
note that text is still all lowercase

* remove forcing of lowercase cardnames

Cardnames in DeckList::loadFromStream_Plain will no longer be forced
lowercase if they aren't found in the database.
Empty lines in the comments of plaintext decklists will not be skipped.
The loading_from_clipboard_test gets its functions declared in a
separate header "clipboard_testing.h".
Add more edgecase tests.
Refactor code.

* add old QHash version support

QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using inserts
instead of a const with initializer list.

* add old QHash version support

QT 5.5 does not support using initializer lists for QHash.
Implement a preprocessor version check for conditionally using [] access
instead of a const with initializer list.

* add qHash on QRegularExpression below QT 5.6

Apparently QRegularExpression can't be hashed in lower QT versions,
so we add our own hash function, and everyone lived happily ever after,
and none the wiser.

* add header guards to clipboard_testing.h
2018-11-07 06:05:25 -05:00
Dane Johnson
bc2cb59c50 Fix blank line between comments issue (#3407)
* Added failing test to demonstrate issue with dec loading

* Prevents empty lines between comments from being interpreted as the start of the sideboard
2018-10-08 11:26:08 -04:00
dino572
c1bd50f186 Fix mwDeck edition tag parsing on deck load (#3057)
* Update decklist.cpp

Changed parsing code, line 565 and 567
2018-01-31 23:29:18 +01:00
ctrlaltca
b29bd9e070
Clang-format (#3028)
* 1/3 Add .clang-format file and travis compilation check

* 2/3 Run clang-format

* 3/3 Fix compilation problems due to include reordering

* 3bis/3 AfterControlStatement: false
2018-01-27 10:41:32 +01:00
Zach H
34bec90193
Fix deck loader with spaces (#3007) 2018-01-18 19:23:13 -05:00
Kyle Grammer
5e00faed5d Fix for Aftermath and Split Cards when sending to Tappedout; fix #2942 (#2944) 2017-12-10 17:56:49 -05:00
Zach H
b53cd33eed Smarter Clipboard Pasting/Parsing (#2706) 2017-05-14 14:35:40 -04:00
Zach H
16bc8b764b remove all of pricing 2017-05-04 23:29:43 -04:00
Fabio Bas
36f6907fa3 Improved token loading 2017-05-04 23:28:51 -04:00
Mark McDonald
9cbae8c707 Decklist testing (#2537) 2017-04-01 01:24:16 -04:00
tritoch
85063859e0 Pending mtgjson/gatherer Æ-->Ae conversion
This is to prepare for when mtgjson converts all Æ cards to 'Ae'.  Formerly it was 'AE'.
2016-09-23 09:23:47 -05:00
tritoch
b23a53eb1e No "Ae" --> "AE" translate (#2182) 2016-09-23 00:03:38 -04:00
ctrlaltca
7f28a7e844 Fix #601; Fix #725 (#2126)
Analyze deck on tappedout
Fix small bug in deckstats interface
2016-09-02 01:34:56 -04:00
Zach H
339db24b56 efficency loop 2015-07-06 17:52:20 -04:00
Zach H
9e2da24629 use QSet for zones 2015-07-06 11:02:43 -04:00
Zach H
8e4f0c50af remove breaks 2015-07-06 01:31:24 -04:00
Zach H
ef268d79c3 prevent cheating with hashes 2015-07-06 00:30:17 -04:00
Matt Lowe
319b5d88b2 Removed redundant constructor
Removed constructor that was not needed. Also removes annoying "error"
output when compiling.
2015-03-06 21:09:18 +01:00
Fabio Bas
6c7ba0950a Fix warning for DeskList copy constructors
Using pointers for classes derived from QObject would be the best idea.
2014-07-24 18:00:20 +02:00
Gavin Bisesi
395658988a Merge pull request #220 from arxanas/deck-parser-ampersand
Fix #183: Deck parser doesn't too eagerly replace ampersands.
2014-07-23 08:53:04 -04:00
Waleed Khan
359882917a Merge remote-tracking branch 'upstream/master'
Some tabs to spaces, and maybe fixed to work with Qt 5.

Conflicts:
	cockatrice/src/deckstats_interface.cpp
	common/decklist.cpp
	common/decklist.h
	oracle/src/oracleimporter.cpp
2014-07-20 14:40:18 -04:00
arxanas
b1bfda9f4e Merge remote-tracking branch 'upstream/master' into deck-parser-ampersand
Conflicts:
	common/decklist.cpp
2014-07-19 18:12:49 -04:00
arxanas
0eb97c91b3 Fix #183: Deck parser doesn't too eagerly replace ampersands. 2014-07-19 14:47:19 -04:00
arxanas
88e6d0d3eb Tabs to spaces. 2014-07-19 14:28:46 -04:00
arxanas
04e80304ef Fix #184: Deck loader reads 4x cardname correctly. 2014-07-08 22:56:18 -04:00
arxanas
4e8ba699d2 Tabs to spaces. 2014-07-08 22:53:02 -04:00
arxanas
7cbe410172 Fix #45: don't send tokens to deckstats. 2014-06-30 03:08:55 -04:00
Daenyth
4c2a553f03 Have servatrice inform players of sideboard size
Ref #142
2014-06-28 00:36:43 -04:00
Daenyth
6d3fe428e7 Fix some warnings
Ref #127
2014-06-27 22:19:23 -04:00
Daenyth
e5d9692d78 Fall back to plain text load when xml load fails 2014-06-24 00:14:59 -04:00
Daenyth
68c0932a2f Don't have decklist sort behavior rely on column order 2014-06-22 08:36:35 -04:00
Buce
a62ba91a5d Add different compare methods for sorting
Give DeckList nodes the ability to sort based on name, price, or
number.
2014-02-28 15:38:23 -06:00
jfreake
504a56cf95 Right aligned the regex check
decklist - Right aligned the regex check
2014-01-08 12:55:44 -04:00
jfreake
67c4d089be Deck Load Mods and Movable Tabs
Changes:
Deck Load - Default to all types *.*
Decklist - Strip "|edition" from .dec formats that include a pipe and
the edition after the card name
Tab_Supervisor - Make tabs movable (able to rearrange tabs)
2014-01-08 11:54:02 -04:00
Tomasz Wegrzanowski
b57d628278 Made Ctrl-V importer work more robust. 2013-11-12 11:46:38 +00:00
Max-Wilhelm Bruker
44d688b1d5 added deckstats.net interface in deck editor, fixing issue #39 2012-05-17 20:11:46 +02:00
Max-Wilhelm Bruker
0eee6d7ab9 fixed issue #49: when editing a remote deck, be able to directly save it there 2012-05-09 21:52:09 +02:00
Max-Wilhelm Bruker
f553fd7456 some token code 2012-04-05 11:48:13 +02:00
a b
7faa033855 Mac fixes 2012-01-29 21:17:32 +01:00
Max-Wilhelm Bruker
16541141bd Cleaned up decklist code 2012-01-21 16:41:46 +01:00
Max-Wilhelm Bruker
38e4781624 fixed packet length calculation bug, re-enabled deck selection 2011-12-18 19:10:47 +01:00
Max-Wilhelm Bruker
632e9bbff3 improved banning and deck hashing 2011-11-01 22:44:51 +01:00
unknown
3ea81dfe2b server deck hash fix 2011-10-04 17:17:49 +02:00
unknown
0bb4ef8bb8 added deck hashing 2011-10-04 16:55:18 +02:00