Commit 4bb6d2c7 authored by Andrius Štikonas's avatar Andrius Štikonas

Do not link to kdelibs4support.

parent 89ef2119
......@@ -46,7 +46,7 @@ target_link_libraries(lskat
Qt5::Svg
KF5::Crash
KF5::GuiAddons
KF5::KDELibs4Support
KF5::XmlGui
KF5KDEGames
)
......
......@@ -20,15 +20,16 @@
#include "carddeckinfo.h"
#include "carddeckinfo_p.h"
#include <QFileInfo>
#include <QDir>
#include <QGlobalStatic>
#include <QFileInfo>
#include <QStandardPaths>
#include <klocale.h>
#include <kstandarddirs.h>
#include <krandom.h>
#include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KRandom>
#include "lskat_debug.h"
#include <kconfiggroup.h>
#include <kglobal.h>
// KConfig entries
#define CONF_CARD QString::fromLatin1("Cardname")
......@@ -41,7 +42,6 @@ class KCardThemeInfoStatic
public:
KCardThemeInfoStatic()
{
KGlobal::dirs()->addResourceType("cards", "data", "carddecks/");
readDecks();
}
~KCardThemeInfoStatic()
......@@ -53,10 +53,15 @@ public:
// Empty data
themeNameMap.clear();
QStringList svg;
// Add SVG card sets
svg = KGlobal::dirs()->findAllResources("cards", QLatin1String("svg*/index.desktop"), KStandardDirs::NoDuplicates);
const QStringList list = svg + KGlobal::dirs()->findAllResources("cards", QLatin1String("card*/index.desktop"), KStandardDirs::NoDuplicates);
QStringList list;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, "carddecks", QStandardPaths::LocateDirectory);
for (const QString& dir : dirs) {
const QStringList deckFolderNames = QDir(dir).entryList(QStringList() << QStringLiteral("svg*"));
for (const QString& deck : deckFolderNames) {
list.append(dir + '/' + deck + QStringLiteral("/index.desktop"));
}
}
if (list.isEmpty()) return;
......@@ -99,7 +104,7 @@ public:
QString defaultDeck;
};
K_GLOBAL_STATIC(KCardThemeInfoStatic, deckinfoStatic)
Q_GLOBAL_STATIC(KCardThemeInfoStatic, deckinfoStatic)
QDebug operator<<(QDebug debug, const KCardThemeInfo &cn)
{
......
......@@ -20,17 +20,16 @@
#include "kcarddialog.h"
#include "ui_kgamecardselector.h"
#include <QDialogButtonBox>
#include <QListWidgetItem>
#include <QPainter>
#include <QPixmap>
#include <QListWidgetItem>
#include <klocale.h>
#include <kstandarddirs.h>
#include <krandom.h>
#include <KConfigGroup>
#include <QDialogButtonBox>
#include <QPushButton>
#include <QVBoxLayout>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include "lskat_debug.h"
#include "carddeckinfo.h"
......
......@@ -22,26 +22,26 @@
// Include files for Qt
#include <QAction>
#include <QDir>
#include <QKeySequence>
#include <QMenuBar>
#include <QPointer>
#include <QStatusBar>
#include <QStandardPaths>
// Include files for KDE
#include <kstandardgameaction.h>
#include <kmessagebox.h>
#include <kfiledialog.h>
#include <khelpmenu.h>
#include "lskat_debug.h"
#include <kstandardaction.h>
#include <kactioncollection.h>
#include <kstatusbar.h>
#include <kstandarddirs.h>
#include <qmenubar.h>
#include <KActionCollection>
#include <KConfigGroup>
#include <KHelpMenu>
#include <KMessageBox>
#include <KSharedConfig>
#include <KStandardGameAction>
#include <KLocalizedString>
#include <krandom.h>
#include <kglobal.h>
#include <ktoolbar.h>
#include <kselectaction.h>
// Application specific includes
#include "lskat_debug.h"
#include "lskatglobal.h"
#include "gameview.h"
#include "abstractengine.h"
......@@ -81,18 +81,15 @@ Mainwindow::Mainwindow(QWidget *parent)
mCanvas = 0;
mTheme = 0;
// Add resource type to grafix
KGlobal::dirs()->addResourceType("lskattheme", "appdata", "grafix/");
#ifndef NDEBUG
#ifdef SRC_DIR
qCDebug(LSKAT_LOG) << "Found SRC_DIR =" << SRC_DIR;
KGlobal::dirs()->addResourceDir("lskattheme", QLatin1String(SRC_DIR) + QString("/grafix/"));
#endif
#endif
// Read theme files
QStringList themeList = KGlobal::dirs()->findAllResources("lskattheme", QLatin1String("*.desktop"), KStandardDirs::NoDuplicates);
QStringList themeList;
const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::DataLocation, "grafix", QStandardPaths::LocateDirectory);
for (const QString& dir : dirs) {
const QStringList fileNames = QDir(dir).entryList(QStringList() << QStringLiteral("*.desktop"));
for (const QString& file : fileNames) {
themeList.append(dir + '/' + file);
}
}
if (themeList.isEmpty())
{
KMessageBox::error(this, i18n("Installation error: No theme list found."));
......
......@@ -33,7 +33,6 @@
// KDE includes
#include <kxmlguiwindow.h>
#include <kconfig.h>
#include <kdialog.h>
// Local includes
#include "abstractinput.h"
......
......@@ -172,14 +172,14 @@ void ThemeManager::updateTheme(const QString &themefile)
mThemeFile = themefile;
// Process dirs
QString rcfile = KStandardDirs::locate("lskattheme", themefile);
QString rcfile = QStandardPaths::locate(QStandardPaths::DataLocation, "grafix/" + themefile);
if (global_debug > 0) qCDebug(LSKAT_LOG) << "ThemeManager LOAD with theme " << rcfile;
// Read config and SVG file for theme
delete mConfig;
mConfig = new KConfig(rcfile, KConfig::NoGlobals);
QString svgfile = config(QLatin1String("general")).readEntry("svgfile");
svgfile = KStandardDirs::locate("lskattheme", svgfile);
svgfile = QStandardPaths::locate(QStandardPaths::DataLocation, "grafix/" + svgfile);
if (global_debug > 0) qCDebug(LSKAT_LOG) << "Reading SVG master file =" << svgfile;
mAspectRatio = config(QLatin1String("general")).readEntry("aspect-ratio", 1.0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment