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
54805fb1
Commit
54805fb1
authored
Jun 27, 2014
by
Fabio Bas
Browse files
Merge remote-tracking branch 'upstream/master' into cmake_qt5
parents
634dd91b
fb7de2ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabase.cpp
View file @
54805fb1
...
...
@@ -16,12 +16,6 @@
const
int
CardDatabase
::
versionNeeded
=
3
;
CardSet
::
CardSet
(
const
QString
&
_shortName
,
const
QString
&
_longName
)
:
shortName
(
_shortName
),
longName
(
_longName
)
{
updateSortKey
();
}
QXmlStreamWriter
&
operator
<<
(
QXmlStreamWriter
&
xml
,
const
CardSet
*
set
)
{
xml
.
writeStartElement
(
"set"
);
...
...
@@ -32,6 +26,24 @@ QXmlStreamWriter &operator<<(QXmlStreamWriter &xml, const CardSet *set)
return
xml
;
}
CardSet
::
CardSet
(
const
QString
&
_shortName
,
const
QString
&
_longName
)
:
shortName
(
_shortName
),
longName
(
_longName
)
{
updateSortKey
();
}
QString
CardSet
::
getCorrectedShortName
()
const
{
// Because windows is horrible.
QSet
<
QString
>
invalidFileNames
;
invalidFileNames
<<
"CON"
<<
"PRN"
<<
"AUX"
<<
"NUL"
<<
"COM1"
<<
"COM2"
<<
"COM3"
<<
"COM4"
<<
"COM5"
<<
"COM6"
<<
"COM7"
<<
"COM8"
<<
"COM9"
<<
"LPT1"
<<
"LPT2"
<<
"LPT3"
<<
"LPT4"
<<
"LPT5"
<<
"LPT6"
<<
"LPT7"
<<
"LPT8"
<<
"LPT9"
;
return
invalidFileNames
.
contains
(
shortName
)
?
shortName
+
"_"
:
shortName
;
}
void
CardSet
::
setSortKey
(
unsigned
int
_sortKey
)
{
sortKey
=
_sortKey
;
...
...
cockatrice/src/carddatabase.h
View file @
54805fb1
...
...
@@ -26,6 +26,7 @@ private:
unsigned
int
sortKey
;
public:
CardSet
(
const
QString
&
_shortName
=
QString
(),
const
QString
&
_longName
=
QString
());
QString
getCorrectedShortName
()
const
;
QString
getShortName
()
const
{
return
shortName
;
}
QString
getLongName
()
const
{
return
longName
;
}
int
getSortKey
()
const
{
return
sortKey
;
}
...
...
@@ -51,7 +52,7 @@ public:
PictureToLoad
(
CardInfo
*
_card
=
0
,
bool
_stripped
=
false
,
bool
_hq
=
true
);
CardInfo
*
getCard
()
const
{
return
card
;
}
bool
getStripped
()
const
{
return
stripped
;
}
QString
getSetName
()
const
{
return
sortedSets
[
setIndex
]
->
getShortName
();
}
QString
getSetName
()
const
{
return
sortedSets
[
setIndex
]
->
get
Corrected
ShortName
();
}
bool
nextSet
();
bool
getHq
()
const
{
return
hq
;
}
void
setHq
(
bool
_hq
)
{
hq
=
_hq
;
}
...
...
cockatrice/src/main.cpp
View file @
54805fb1
...
...
@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
if
(
translationPath
.
isEmpty
())
{
#ifdef Q_OS_MAC
translationPath
=
QLibraryInfo
::
location
(
QLibraryInfo
::
TranslationsPath
);
#elif Q_OS_WIN
#elif
defined(
Q_OS_WIN
)
translationPath
=
app
.
applicationDirPath
()
+
"/translations"
;
#endif
}
...
...
nsis/cockatrice.nsi
View file @
54805fb1
!include "MUI2.nsh"
!include "FileFunc.nsh"
!define /date TIMESTAMP "%Y%m%d"
!define /date TIMESTAMP "%Y%m%d"
!searchparse /file ../build/cockatrice/version_string.cpp '= "' VERSION '";'
Name "Cockatrice"
...
...
@@ -52,7 +52,7 @@ Section "Application" SecApplication
SetOutPath "$INSTDIR\zonebg"
File /r ..\zonebg\*.*
SetOutPath "$INSTDIR\plugins"
SetOutPath "$INSTDIR\plugins\codecs"
File "${QTDIR}\plugins\codecs\qcncodecs4.dll"
...
...
@@ -67,7 +67,7 @@ Section "Application" SecApplication
SetOutPath "$INSTDIR\sounds"
File /r ..\sounds\*.*
SetOutPath "$INSTDIR\translations"
File /r ..\build\cockatrice\*.qm
...
...
@@ -83,10 +83,10 @@ Section "Application" SecApplication
SectionEnd
Section "Update configuration" SecUpdateConfig
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "carddatabase" "$
INSTDIR
\cards.xml"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "decks" "$
INSTDIR
\decks"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "pics" "$
INSTDIR
\pics"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\sound" "path" "$
INSTDIR
\sounds"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "carddatabase" "$
APPDATA\Cockatrice
\cards.xml"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "decks" "$
APPDATA\Cockatrice
\decks"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\paths" "pics" "$
APPDATA\Cockatrice
\pics"
WriteRegStr HKCU "Software\Cockatrice\Cockatrice\sound" "path" "$
APPDATA\Cockatrice
\sounds"
SectionEnd
Section "Start menu item" SecStartMenu
...
...
@@ -115,7 +115,7 @@ SetShellVarContext all
Delete "$INSTDIR\QtMultimedia4.dll"
RMDir "$INSTDIR"
RMDir
/r
"$SMPROGRAMS\Cockatrice"
RMDir "$SMPROGRAMS\Cockatrice"
DeleteRegKey HKCU "Software\Cockatrice"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cockatrice"
...
...
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