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
83274f98
Commit
83274f98
authored
Mar 30, 2015
by
ctrlaltca
Browse files
Merge pull request #893 from ctrlaltca/startup_fixes
Misc Startup fixes
parents
0e371172
399886c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddatabase.cpp
View file @
83274f98
...
@@ -926,7 +926,7 @@ LoadStatus CardDatabase::loadCardDatabase(const QString &path, bool tokens)
...
@@ -926,7 +926,7 @@ LoadStatus CardDatabase::loadCardDatabase(const QString &path, bool tokens)
if
(
!
tokens
)
{
if
(
!
tokens
)
{
loadStatus
=
tempLoadStatus
;
loadStatus
=
tempLoadStatus
;
qDebug
()
<<
"loadCardDatabase(): Status = "
<<
loadStatus
;
qDebug
()
<<
"loadCardDatabase():
Path = "
<<
path
<<
"
Status = "
<<
loadStatus
;
}
}
...
...
cockatrice/src/carddatabasemodel.cpp
View file @
83274f98
...
@@ -123,21 +123,23 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
...
@@ -123,21 +123,23 @@ bool CardDatabaseDisplayModel::lessThan(const QModelIndex &left, const QModelInd
QString
leftString
=
sourceModel
()
->
data
(
left
).
toString
();
QString
leftString
=
sourceModel
()
->
data
(
left
).
toString
();
QString
rightString
=
sourceModel
()
->
data
(
right
).
toString
();
QString
rightString
=
sourceModel
()
->
data
(
right
).
toString
();
if
(
leftString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
{
// exact match should be at top
if
(
!
cardName
.
isEmpty
())
return
true
;
{
}
if
(
leftString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
{
// exact match should be at top
return
true
;
if
(
rightString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
{
// exact match should be at top
}
return
false
;
}
bool
isLeftType2
=
leftString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
if
(
rightString
.
compare
(
cardName
,
Qt
::
CaseInsensitive
)
==
0
)
{
// exact match should be at top
bool
isRightType2
=
rightString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
return
false
;
if
(
isLeftType2
&&
!
isRightType2
)
}
return
true
;
if
(
isRightType2
&&
!
isLeftType2
)
return
false
;
bool
isLeftType2
=
leftString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
bool
isRightType2
=
rightString
.
startsWith
(
cardName
,
Qt
::
CaseInsensitive
);
if
(
isLeftType2
&&
!
isRightType2
)
return
true
;
if
(
isRightType2
&&
!
isLeftType2
)
return
false
;
}
return
QString
::
localeAwareCompare
(
leftString
,
rightString
)
<
0
;
return
QString
::
localeAwareCompare
(
leftString
,
rightString
)
<
0
;
}
}
...
...
cockatrice/src/main.cpp
View file @
83274f98
...
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
...
@@ -146,7 +146,7 @@ int main(int argc, char *argv[])
const
QString
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
const
QString
dataDir
=
QStandardPaths
::
standardLocations
(
QStandardPaths
::
DataLocation
).
first
();
#endif
#endif
if
(
!
db
->
getLoadSuccess
())
if
(
!
db
->
getLoadSuccess
())
if
(
db
->
loadCardDatabase
(
dataDir
+
"/cards.xml"
))
if
(
!
db
->
loadCardDatabase
(
dataDir
+
"/cards.xml"
))
settingsCache
->
setCardDatabasePath
(
dataDir
+
"/cards.xml"
);
settingsCache
->
setCardDatabasePath
(
dataDir
+
"/cards.xml"
);
if
(
settingsCache
->
getTokenDatabasePath
().
isEmpty
())
if
(
settingsCache
->
getTokenDatabasePath
().
isEmpty
())
settingsCache
->
setTokenDatabasePath
(
dataDir
+
"/tokens.xml"
);
settingsCache
->
setTokenDatabasePath
(
dataDir
+
"/tokens.xml"
);
...
...
cockatrice/src/soundengine.cpp
View file @
83274f98
...
@@ -22,6 +22,8 @@ void SoundEngine::cacheData()
...
@@ -22,6 +22,8 @@ void SoundEngine::cacheData()
<<
"notification"
<<
"draw"
<<
"playcard"
<<
"shuffle"
<<
"tap"
<<
"untap"
<<
"cuckoo"
;
<<
"notification"
<<
"draw"
<<
"playcard"
<<
"shuffle"
<<
"tap"
<<
"untap"
<<
"cuckoo"
;
for
(
int
i
=
0
;
i
<
fileNames
.
size
();
++
i
)
{
for
(
int
i
=
0
;
i
<
fileNames
.
size
();
++
i
)
{
QFile
file
(
settingsCache
->
getSoundPath
()
+
"/"
+
fileNames
[
i
]
+
".raw"
);
QFile
file
(
settingsCache
->
getSoundPath
()
+
"/"
+
fileNames
[
i
]
+
".raw"
);
if
(
!
file
.
exists
())
continue
;
file
.
open
(
QIODevice
::
ReadOnly
);
file
.
open
(
QIODevice
::
ReadOnly
);
audioData
.
insert
(
fileNames
[
i
],
file
.
readAll
());
audioData
.
insert
(
fileNames
[
i
],
file
.
readAll
());
file
.
close
();
file
.
close
();
...
...
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