summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 15:40:14 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-10-15 15:40:14 (GMT)
commit373b0c2a04ad71b96b571923b57051b294f2b627 (patch)
tree389487efa3b143f0158c84acfa12ce9497026a97
parent2d3a5775485ba84ad21c84523064708998aa6cac (diff)
Port away from KGlobalSettings
-rw-r--r--app/gvcore.cpp8
-rw-r--r--importer/importdialog.cpp1
-rw-r--r--lib/thumbnailview/previewitemdelegate.cpp4
3 files changed, 6 insertions, 7 deletions
diff --git a/app/gvcore.cpp b/app/gvcore.cpp
index db2d2bb..adf75f6 100644
--- a/app/gvcore.cpp
+++ b/app/gvcore.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// KDE
#include <KFileDialog>
-#include <KGlobalSettings>
+#include <KColorScheme>
#include <KImageIO>
#include <KIO/NetAccess>
#include <KLocalizedString>
@@ -113,7 +113,8 @@ struct GvCorePrivate
QColor fgColor = value > 128 ? Qt::black : Qt::white;
// Normal
- mPalettes[GvCore::NormalPalette] = KGlobalSettings::createApplicationPalette();
+ KSharedConfigPtr config = KSharedConfig::openConfig();
+ mPalettes[GvCore::NormalPalette] = KColorScheme::createApplicationPalette(config);
pal = mPalettes[GvCore::NormalPalette];
pal.setColor(QPalette::Base, QColor::fromHsv(0, 0, value));
@@ -121,7 +122,6 @@ struct GvCorePrivate
mPalettes[GvCore::NormalViewPalette] = pal;
// Fullscreen
- KSharedConfigPtr config;
QString name = GwenviewConfig::fullScreenColorScheme();
if (name.isEmpty()) {
// Default color scheme
@@ -134,7 +134,7 @@ struct GvCorePrivate
// Standard KDE color scheme
config = KSharedConfig::openConfig(QString("color-schemes/%1.colors").arg(name), KConfig::FullConfig, QStandardPaths::DataLocation);
}
- mPalettes[GvCore::FullScreenPalette] = KGlobalSettings::createApplicationPalette(config);
+ mPalettes[GvCore::FullScreenPalette] = KColorScheme::createApplicationPalette(config);
pal = mPalettes[GvCore::FullScreenPalette];
QString path = KStandardDirs::locate("data", "gwenview/images/background.png");
diff --git a/importer/importdialog.cpp b/importer/importdialog.cpp
index 2a4d468..2e63bae 100644
--- a/importer/importdialog.cpp
+++ b/importer/importdialog.cpp
@@ -28,7 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// KDE
#include <QDebug>
-#include <KGlobalSettings>
#include <KIO/DeleteJob>
#include <KIO/NetAccess>
#include <KLocale>
diff --git a/lib/thumbnailview/previewitemdelegate.cpp b/lib/thumbnailview/previewitemdelegate.cpp
index f2bb1d3..8e967b6 100644
--- a/lib/thumbnailview/previewitemdelegate.cpp
+++ b/lib/thumbnailview/previewitemdelegate.cpp
@@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
#include <config-gwenview.h>
// Qt
+#include <QApplication>
#include <QHash>
#include <QHBoxLayout>
#include <QPainter>
@@ -39,7 +40,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA
// KDE
#include <KDirModel>
-#include <KGlobalSettings>
#include <KIconLoader>
#ifndef GWENVIEW_SEMANTICINFO_BACKEND_NONE
@@ -194,7 +194,7 @@ struct PreviewItemDelegatePrivate
mIndexUnderCursor = index;
mView->update(oldIndex);
- if (KGlobalSettings::singleClick()) {
+ if (QApplication::style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, mView)) {
mView->setCursor(mIndexUnderCursor.isValid() ? Qt::PointingHandCursor : Qt::ArrowCursor);
}