mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
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
This commit is contained in:
parent
f54165025e
commit
b6df5a4ac3
17 changed files with 71 additions and 40 deletions
|
|
@ -35,7 +35,7 @@ QStringMap &ThemeManager::getAvailableThemes()
|
|||
availableThemes.clear();
|
||||
|
||||
// load themes from user profile dir
|
||||
dir = settingsCache->getDataPath() + "/themes";
|
||||
dir.setPath(settingsCache->getDataPath() + "/themes");
|
||||
|
||||
foreach (QString themeName, dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name)) {
|
||||
if (!availableThemes.contains(themeName))
|
||||
|
|
@ -43,14 +43,15 @@ QStringMap &ThemeManager::getAvailableThemes()
|
|||
}
|
||||
|
||||
// load themes from cockatrice system dir
|
||||
dir = qApp->applicationDirPath() +
|
||||
dir.setPath(qApp->applicationDirPath() +
|
||||
#ifdef Q_OS_MAC
|
||||
"/../Resources/themes";
|
||||
"/../Resources/themes"
|
||||
#elif defined(Q_OS_WIN)
|
||||
"/themes";
|
||||
"/themes"
|
||||
#else // linux
|
||||
"/../share/cockatrice/themes";
|
||||
"/../share/cockatrice/themes"
|
||||
#endif
|
||||
);
|
||||
|
||||
foreach (QString themeName, dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name)) {
|
||||
if (!availableThemes.contains(themeName))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue