┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/private
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2015-02-27 11:30:27 +0100
committerEmmanuel Pescosta <[email protected]>2015-02-27 11:30:27 +0100
commit9aee5d22513f0367febab54b38b3a7dc58d120bb (patch)
tree99cf391070ac5d4650a3f1b309c3ec2e814f1ac6 /src/kitemviews/private
parentf025aeb63aa2a38e91c43d99ba9955793d3adf1e (diff)
parentb701b7e4edefb628d6f8b14146b2e299bd0ce5fc (diff)
Merge branch 'frameworks'
Diffstat (limited to 'src/kitemviews/private')
-rw-r--r--src/kitemviews/private/kbaloorolesprovider.cpp19
-rw-r--r--src/kitemviews/private/kbaloorolesprovider.h7
-rw-r--r--src/kitemviews/private/kdirectorycontentscounter.cpp20
-rw-r--r--src/kitemviews/private/kdirectorycontentscounterworker.h1
-rw-r--r--src/kitemviews/private/kfileitemclipboard.cpp16
-rw-r--r--src/kitemviews/private/kfileitemclipboard.h12
-rw-r--r--src/kitemviews/private/kfileitemmodeldirlister.cpp5
-rw-r--r--src/kitemviews/private/kfileitemmodeldirlister.h7
-rw-r--r--src/kitemviews/private/kfileitemmodelfilter.h4
-rw-r--r--src/kitemviews/private/kfileitemmodelsortalgorithm.h2
-rw-r--r--src/kitemviews/private/kitemlistheaderwidget.cpp20
-rw-r--r--src/kitemviews/private/kitemlistheaderwidget.h4
-rw-r--r--src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp2
-rw-r--r--src/kitemviews/private/kitemlistkeyboardsearchmanager.h4
-rw-r--r--src/kitemviews/private/kitemlistroleeditor.cpp6
-rw-r--r--src/kitemviews/private/kitemlistroleeditor.h4
-rw-r--r--src/kitemviews/private/kitemlistrubberband.cpp1
-rw-r--r--src/kitemviews/private/kitemlistrubberband.h4
-rw-r--r--src/kitemviews/private/kitemlistselectiontoggle.cpp3
-rw-r--r--src/kitemviews/private/kitemlistselectiontoggle.h5
-rw-r--r--src/kitemviews/private/kitemlistsizehintresolver.h4
-rw-r--r--src/kitemviews/private/kitemlistsmoothscroller.cpp11
-rw-r--r--src/kitemviews/private/kitemlistsmoothscroller.h4
-rw-r--r--src/kitemviews/private/kitemlistviewanimation.cpp18
-rw-r--r--src/kitemviews/private/kitemlistviewanimation.h6
-rw-r--r--src/kitemviews/private/kitemlistviewlayouter.cpp5
-rw-r--r--src/kitemviews/private/kitemlistviewlayouter.h4
-rw-r--r--src/kitemviews/private/kpixmapmodifier.cpp1
-rw-r--r--src/kitemviews/private/kpixmapmodifier.h4
29 files changed, 87 insertions, 116 deletions
diff --git a/src/kitemviews/private/kbaloorolesprovider.cpp b/src/kitemviews/private/kbaloorolesprovider.cpp
index c0ae0c544..920ce0671 100644
--- a/src/kitemviews/private/kbaloorolesprovider.cpp
+++ b/src/kitemviews/private/kbaloorolesprovider.cpp
@@ -20,12 +20,12 @@
#include "kbaloorolesprovider.h"
-#include <KDebug>
-#include <KGlobal>
-#include <KLocale>
+#include <QDebug>
+#include <KLocalizedString>
-#include <baloo/file.h>
-#include <kfilemetadata/propertyinfo.h>
+#include <Baloo/File>
+#include <KFileMetaData/PropertyInfo>
+#include <KFileMetaData/UserMetaData>
#include <QTime>
#include <QMap>
@@ -34,7 +34,7 @@ struct KBalooRolesProviderSingleton
{
KBalooRolesProvider instance;
};
-K_GLOBAL_STATIC(KBalooRolesProviderSingleton, s_balooRolesProvider)
+Q_GLOBAL_STATIC(KBalooRolesProviderSingleton, s_balooRolesProvider)
KBalooRolesProvider& KBalooRolesProvider::instance()
@@ -99,14 +99,15 @@ QHash<QByteArray, QVariant> KBalooRolesProvider::roleValues(const Baloo::File& f
}
}
+ KFileMetaData::UserMetaData md(file.path());
if (roles.contains("tags")) {
- values.insert("tags", tagsFromValues(file.tags()));
+ values.insert("tags", tagsFromValues(md.tags()));
}
if (roles.contains("rating")) {
- values.insert("rating", QString::number(file.rating()));
+ values.insert("rating", QString::number(md.rating()));
}
if (roles.contains("comment")) {
- values.insert("comment", file.userComment());
+ values.insert("comment", md.userComment());
}
return values;
diff --git a/src/kitemviews/private/kbaloorolesprovider.h b/src/kitemviews/private/kbaloorolesprovider.h
index f1ad5c740..9673bff4f 100644
--- a/src/kitemviews/private/kbaloorolesprovider.h
+++ b/src/kitemviews/private/kbaloorolesprovider.h
@@ -21,12 +21,11 @@
#ifndef KBALOO_ROLESPROVIDER_H
#define KBALOO_ROLESPROVIDER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QHash>
#include <QSet>
-#include <QUrl>
-
+#include <QVariant>
namespace Baloo {
class File;
}
@@ -37,7 +36,7 @@ namespace Baloo {
* Is a helper class for KFileItemModelRolesUpdater to retrieve roles that
* are only accessible with Baloo.
*/
-class LIBDOLPHINPRIVATE_EXPORT KBalooRolesProvider
+class DOLPHIN_EXPORT KBalooRolesProvider
{
public:
static KBalooRolesProvider& instance();
diff --git a/src/kitemviews/private/kdirectorycontentscounter.cpp b/src/kitemviews/private/kdirectorycontentscounter.cpp
index 7d1e76999..af7312ad2 100644
--- a/src/kitemviews/private/kdirectorycontentscounter.cpp
+++ b/src/kitemviews/private/kdirectorycontentscounter.cpp
@@ -35,8 +35,8 @@ KDirectoryContentsCounter::KDirectoryContentsCounter(KFileItemModel* model, QObj
m_dirWatcher(0),
m_watchedDirs()
{
- connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
- this, SLOT(slotItemsRemoved()));
+ connect(m_model, &KFileItemModel::itemsRemoved,
+ this, &KDirectoryContentsCounter::slotItemsRemoved);
if (!m_workerThread) {
m_workerThread = new QThread();
@@ -47,13 +47,13 @@ KDirectoryContentsCounter::KDirectoryContentsCounter(KFileItemModel* model, QObj
m_worker->moveToThread(m_workerThread);
++m_workersCount;
- connect(this, SIGNAL(requestDirectoryContentsCount(QString,KDirectoryContentsCounterWorker::Options)),
- m_worker, SLOT(countDirectoryContents(QString,KDirectoryContentsCounterWorker::Options)));
- connect(m_worker, SIGNAL(result(QString,int)),
- this, SLOT(slotResult(QString,int)));
+ connect(this, &KDirectoryContentsCounter::requestDirectoryContentsCount,
+ m_worker, &KDirectoryContentsCounterWorker::countDirectoryContents);
+ connect(m_worker, &KDirectoryContentsCounterWorker::result,
+ this, &KDirectoryContentsCounter::slotResult);
m_dirWatcher = new KDirWatch(this);
- connect(m_dirWatcher, SIGNAL(dirty(QString)), this, SLOT(slotDirWatchDirty(QString)));
+ connect(m_dirWatcher, &KDirWatch::dirty, this, &KDirectoryContentsCounter::slotDirWatchDirty);
}
KDirectoryContentsCounter::~KDirectoryContentsCounter()
@@ -122,7 +122,7 @@ void KDirectoryContentsCounter::slotResult(const QString& path, int count)
void KDirectoryContentsCounter::slotDirWatchDirty(const QString& path)
{
- const int index = m_model->index(KUrl(path));
+ const int index = m_model->index(QUrl::fromLocalFile(path));
if (index >= 0) {
if (!m_model->fileItem(index).isDir()) {
// If INotify is used, KDirWatch issues the dirty() signal
@@ -151,7 +151,7 @@ void KDirectoryContentsCounter::slotItemsRemoved()
QMutableSetIterator<QString> it(m_watchedDirs);
while (it.hasNext()) {
const QString& path = it.next();
- if (m_model->index(KUrl(path)) < 0) {
+ if (m_model->index(QUrl::fromLocalFile(path)) < 0) {
m_dirWatcher->removeDir(path);
it.remove();
}
@@ -181,4 +181,4 @@ void KDirectoryContentsCounter::startWorker(const QString& path)
}
QThread* KDirectoryContentsCounter::m_workerThread = 0;
-int KDirectoryContentsCounter::m_workersCount = 0; \ No newline at end of file
+int KDirectoryContentsCounter::m_workersCount = 0;
diff --git a/src/kitemviews/private/kdirectorycontentscounterworker.h b/src/kitemviews/private/kdirectorycontentscounterworker.h
index 96831ef81..b2e31ef0f 100644
--- a/src/kitemviews/private/kdirectorycontentscounterworker.h
+++ b/src/kitemviews/private/kdirectorycontentscounterworker.h
@@ -20,7 +20,6 @@
#ifndef KDIRECTORYCONTENTENTSCOUNTERWORKER_H
#define KDIRECTORYCONTENTENTSCOUNTERWORKER_H
-#include <QFlags>
#include <QMetaType>
#include <QObject>
diff --git a/src/kitemviews/private/kfileitemclipboard.cpp b/src/kitemviews/private/kfileitemclipboard.cpp
index 0dcc81f4f..e12767853 100644
--- a/src/kitemviews/private/kfileitemclipboard.cpp
+++ b/src/kitemviews/private/kfileitemclipboard.cpp
@@ -19,17 +19,17 @@
#include "kfileitemclipboard.h"
-#include <KGlobal>
#include <QApplication>
#include <QClipboard>
#include <QMimeData>
+#include <KUrlMimeData>
class KFileItemClipboardSingleton
{
public:
KFileItemClipboard instance;
};
-K_GLOBAL_STATIC(KFileItemClipboardSingleton, s_KFileItemClipboard)
+Q_GLOBAL_STATIC(KFileItemClipboardSingleton, s_KFileItemClipboard)
@@ -38,12 +38,12 @@ KFileItemClipboard* KFileItemClipboard::instance()
return &s_KFileItemClipboard->instance;
}
-bool KFileItemClipboard::isCut(const KUrl& url) const
+bool KFileItemClipboard::isCut(const QUrl& url) const
{
return m_cutItems.contains(url);
}
-QList<KUrl> KFileItemClipboard::cutItems() const
+QList<QUrl> KFileItemClipboard::cutItems() const
{
return m_cutItems.toList();
}
@@ -66,7 +66,7 @@ void KFileItemClipboard::updateCutItems()
const QByteArray data = mimeData->data("application/x-kde-cutselection");
const bool isCutSelection = (!data.isEmpty() && data.at(0) == QLatin1Char('1'));
if (isCutSelection) {
- m_cutItems = KUrl::List::fromMimeData(mimeData).toSet();
+ m_cutItems = KUrlMimeData::urlsFromMimeData(mimeData).toSet();
} else {
m_cutItems.clear();
}
@@ -79,8 +79,6 @@ KFileItemClipboard::KFileItemClipboard() :
{
updateCutItems();
- connect(QApplication::clipboard(), SIGNAL(dataChanged()),
- this, SLOT(updateCutItems()));
+ connect(QApplication::clipboard(), &QClipboard::dataChanged,
+ this, &KFileItemClipboard::updateCutItems);
}
-
-#include "kfileitemclipboard.moc"
diff --git a/src/kitemviews/private/kfileitemclipboard.h b/src/kitemviews/private/kfileitemclipboard.h
index 86eb8e9fc..3ee50d661 100644
--- a/src/kitemviews/private/kfileitemclipboard.h
+++ b/src/kitemviews/private/kfileitemclipboard.h
@@ -20,27 +20,27 @@
#ifndef KFILEITEMCLIPBOARD_H
#define KFILEITEMCLIPBOARD_H
-#include <KUrl>
+#include <QUrl>
#include <QList>
#include <QSet>
#include <QObject>
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
/**
* @brief Wrapper for QClipboard to provide fast access for checking
* whether a KFileItem has been clipped.
*/
-class LIBDOLPHINPRIVATE_EXPORT KFileItemClipboard : public QObject
+class DOLPHIN_EXPORT KFileItemClipboard : public QObject
{
Q_OBJECT
public:
static KFileItemClipboard* instance();
- bool isCut(const KUrl& url) const;
+ bool isCut(const QUrl& url) const;
- QList<KUrl> cutItems() const;
+ QList<QUrl> cutItems() const;
signals:
void cutItemsChanged();
@@ -54,7 +54,7 @@ private slots:
private:
KFileItemClipboard();
- QSet<KUrl> m_cutItems;
+ QSet<QUrl> m_cutItems;
friend class KFileItemClipboardSingleton;
};
diff --git a/src/kitemviews/private/kfileitemmodeldirlister.cpp b/src/kitemviews/private/kfileitemmodeldirlister.cpp
index 3d36386a9..778625573 100644
--- a/src/kitemviews/private/kfileitemmodeldirlister.cpp
+++ b/src/kitemviews/private/kfileitemmodeldirlister.cpp
@@ -18,8 +18,8 @@
***************************************************************************/
#include "kfileitemmodeldirlister.h"
-#include <KLocale>
-#include <KIO/JobClasses>
+#include <KLocalizedString>
+#include <KIO/Job>
KFileItemModelDirLister::KFileItemModelDirLister(QObject* parent) :
KDirLister(parent)
@@ -45,4 +45,3 @@ void KFileItemModelDirLister::handleError(KIO::Job* job)
}
}
-#include "kfileitemmodeldirlister.moc"
diff --git a/src/kitemviews/private/kfileitemmodeldirlister.h b/src/kitemviews/private/kfileitemmodeldirlister.h
index 688ee9c5b..c2c621aed 100644
--- a/src/kitemviews/private/kfileitemmodeldirlister.h
+++ b/src/kitemviews/private/kfileitemmodeldirlister.h
@@ -20,15 +20,16 @@
#ifndef KFILEITEMMODELDIRLISTER_H
#define KFILEITEMMODELDIRLISTER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <KDirLister>
+#include <QUrl>
/**
* @brief Extends the class KDirLister by emitting a signal when an
* error occurred instead of showing an error dialog.
* KDirLister::autoErrorHandlingEnabled() is set to false.
*/
-class LIBDOLPHINPRIVATE_EXPORT KFileItemModelDirLister : public KDirLister
+class DOLPHIN_EXPORT KFileItemModelDirLister : public KDirLister
{
Q_OBJECT
@@ -44,7 +45,7 @@ signals:
* Is emitted when the URL of the directory lister represents a file.
* In this case no signal errorMessage() will be emitted.
*/
- void urlIsFileError(const KUrl& url);
+ void urlIsFileError(const QUrl& url);
protected:
virtual void handleError(KIO::Job* job);
diff --git a/src/kitemviews/private/kfileitemmodelfilter.h b/src/kitemviews/private/kfileitemmodelfilter.h
index e4fb0a2ee..67c1c280c 100644
--- a/src/kitemviews/private/kfileitemmodelfilter.h
+++ b/src/kitemviews/private/kfileitemmodelfilter.h
@@ -21,7 +21,7 @@
#ifndef KFILEITEMMODELFILTER_H
#define KFILEITEMMODELFILTER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QStringList>
class KFileItem;
@@ -35,7 +35,7 @@ class QRegExp;
* property of the KFileItem, but this might get extended in
* future.
*/
-class LIBDOLPHINPRIVATE_EXPORT KFileItemModelFilter
+class DOLPHIN_EXPORT KFileItemModelFilter
{
public:
diff --git a/src/kitemviews/private/kfileitemmodelsortalgorithm.h b/src/kitemviews/private/kfileitemmodelsortalgorithm.h
index 1d5689432..50db9900d 100644
--- a/src/kitemviews/private/kfileitemmodelsortalgorithm.h
+++ b/src/kitemviews/private/kfileitemmodelsortalgorithm.h
@@ -22,7 +22,7 @@
#ifndef KFILEITEMMODELSORTALGORITHM_H
#define KFILEITEMMODELSORTALGORITHM_H
-#include <QtCore>
+#include <QtConcurrent/QtConcurrent>
#include <algorithm>
diff --git a/src/kitemviews/private/kitemlistheaderwidget.cpp b/src/kitemviews/private/kitemlistheaderwidget.cpp
index 1f210ab5a..45ce4e759 100644
--- a/src/kitemviews/private/kitemlistheaderwidget.cpp
+++ b/src/kitemviews/private/kitemlistheaderwidget.cpp
@@ -19,8 +19,6 @@
#include "kitemlistheaderwidget.h"
-#include <KAction>
-#include <KMenu>
#include <kitemviews/kitemmodelbase.h>
#include <QApplication>
@@ -28,7 +26,6 @@
#include <QPainter>
#include <QStyleOptionHeader>
-#include <KDebug>
KItemListHeaderWidget::KItemListHeaderWidget(QGraphicsWidget* parent) :
QGraphicsWidget(parent),
@@ -62,19 +59,19 @@ void KItemListHeaderWidget::setModel(KItemModelBase* model)
}
if (m_model) {
- disconnect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
- disconnect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
+ disconnect(m_model, &KItemModelBase::sortRoleChanged,
+ this, &KItemListHeaderWidget::slotSortRoleChanged);
+ disconnect(m_model, &KItemModelBase::sortOrderChanged,
+ this, &KItemListHeaderWidget::slotSortOrderChanged);
}
m_model = model;
if (m_model) {
- connect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
- this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
- connect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
- this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
+ connect(m_model, &KItemModelBase::sortRoleChanged,
+ this, &KItemListHeaderWidget::slotSortRoleChanged);
+ connect(m_model, &KItemModelBase::sortOrderChanged,
+ this, &KItemListHeaderWidget::slotSortOrderChanged);
}
}
@@ -569,4 +566,3 @@ qreal KItemListHeaderWidget::roleXPosition(const QByteArray& role) const
return -1;
}
-#include "kitemlistheaderwidget.moc"
diff --git a/src/kitemviews/private/kitemlistheaderwidget.h b/src/kitemviews/private/kitemlistheaderwidget.h
index b99f45f35..307def74d 100644
--- a/src/kitemviews/private/kitemlistheaderwidget.h
+++ b/src/kitemviews/private/kitemlistheaderwidget.h
@@ -20,7 +20,7 @@
#ifndef KITEMLISTHEADERWIDGET_H
#define KITEMLISTHEADERWIDGET_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QGraphicsWidget>
#include <QHash>
#include <QList>
@@ -33,7 +33,7 @@ class KItemModelBase;
* The widget is an internal API, the user of KItemListView may only access the
* class KItemListHeader.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListHeaderWidget : public QGraphicsWidget
+class DOLPHIN_EXPORT KItemListHeaderWidget : public QGraphicsWidget
{
Q_OBJECT
diff --git a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp
index 3bd1b01f3..ffa92a1cf 100644
--- a/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp
+++ b/src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp
@@ -22,8 +22,6 @@
#include "kitemlistkeyboardsearchmanager.h"
-#include <QApplication>
-#include <QElapsedTimer>
KItemListKeyboardSearchManager::KItemListKeyboardSearchManager(QObject* parent) :
QObject(parent),
diff --git a/src/kitemviews/private/kitemlistkeyboardsearchmanager.h b/src/kitemviews/private/kitemlistkeyboardsearchmanager.h
index 661178db8..2a14ca470 100644
--- a/src/kitemviews/private/kitemlistkeyboardsearchmanager.h
+++ b/src/kitemviews/private/kitemlistkeyboardsearchmanager.h
@@ -23,7 +23,7 @@
#ifndef KITEMLISTKEYBOARDSEARCHMANAGER_H
#define KITEMLISTKEYBOARDSEARCHMANAGER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QObject>
#include <QString>
@@ -35,7 +35,7 @@
* @see KItemListController
* @see KItemModelBase
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListKeyboardSearchManager : public QObject
+class DOLPHIN_EXPORT KItemListKeyboardSearchManager : public QObject
{
Q_OBJECT
diff --git a/src/kitemviews/private/kitemlistroleeditor.cpp b/src/kitemviews/private/kitemlistroleeditor.cpp
index 0a48f1ba0..5ff013429 100644
--- a/src/kitemviews/private/kitemlistroleeditor.cpp
+++ b/src/kitemviews/private/kitemlistroleeditor.cpp
@@ -19,8 +19,7 @@
#include "kitemlistroleeditor.h"
-#include <KDebug>
-#include <kio/global.h>
+#include <KIO/Global>
#include <QKeyEvent>
KItemListRoleEditor::KItemListRoleEditor(QWidget *parent) :
@@ -38,7 +37,7 @@ KItemListRoleEditor::KItemListRoleEditor(QWidget *parent) :
parent->installEventFilter(this);
}
- connect(this, SIGNAL(textChanged()), this, SLOT(autoAdjustSize()));
+ connect(this, &KItemListRoleEditor::textChanged, this, &KItemListRoleEditor::autoAdjustSize);
}
KItemListRoleEditor::~KItemListRoleEditor()
@@ -148,4 +147,3 @@ void KItemListRoleEditor::emitRoleEditingFinished()
}
}
-#include "kitemlistroleeditor.moc"
diff --git a/src/kitemviews/private/kitemlistroleeditor.h b/src/kitemviews/private/kitemlistroleeditor.h
index 7c2b61e2d..3b8f96865 100644
--- a/src/kitemviews/private/kitemlistroleeditor.h
+++ b/src/kitemviews/private/kitemlistroleeditor.h
@@ -20,7 +20,7 @@
#ifndef KITEMLISTROLEEDITOR_H
#define KITEMLISTROLEEDITOR_H
-#include "libdolphin_export.h"
+#include "dolphin_export.h"
#include <KTextEdit>
@@ -33,7 +33,7 @@
*
* The size automatically gets increased if the text does not fit.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListRoleEditor : public KTextEdit
+class DOLPHIN_EXPORT KItemListRoleEditor : public KTextEdit
{
Q_OBJECT
diff --git a/src/kitemviews/private/kitemlistrubberband.cpp b/src/kitemviews/private/kitemlistrubberband.cpp
index 58567c460..702873126 100644
--- a/src/kitemviews/private/kitemlistrubberband.cpp
+++ b/src/kitemviews/private/kitemlistrubberband.cpp
@@ -88,4 +88,3 @@ bool KItemListRubberBand::isActive() const
return m_active;
}
-#include "kitemlistrubberband.moc"
diff --git a/src/kitemviews/private/kitemlistrubberband.h b/src/kitemviews/private/kitemlistrubberband.h
index aea58af46..b47c30c1f 100644
--- a/src/kitemviews/private/kitemlistrubberband.h
+++ b/src/kitemviews/private/kitemlistrubberband.h
@@ -20,14 +20,14 @@
#ifndef KITEMLISTRUBBERBAND_H
#define KITEMLISTRUBBERBAND_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QObject>
#include <QPointF>
/**
* @brief Manages the rubberband when selecting items.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListRubberBand : public QObject
+class DOLPHIN_EXPORT KItemListRubberBand : public QObject
{
Q_OBJECT
diff --git a/src/kitemviews/private/kitemlistselectiontoggle.cpp b/src/kitemviews/private/kitemlistselectiontoggle.cpp
index accbe5181..d4081a690 100644
--- a/src/kitemviews/private/kitemlistselectiontoggle.cpp
+++ b/src/kitemviews/private/kitemlistselectiontoggle.cpp
@@ -19,11 +19,9 @@
#include "kitemlistselectiontoggle.h"
-#include <KIconEffect>
#include <KIconLoader>
#include <QPainter>
-#include <KDebug>
KItemListSelectionToggle::KItemListSelectionToggle(QGraphicsItem* parent) :
QGraphicsWidget(parent, 0),
@@ -115,4 +113,3 @@ int KItemListSelectionToggle::iconSize() const
return iconSize;
}
-#include "kitemlistselectiontoggle.moc"
diff --git a/src/kitemviews/private/kitemlistselectiontoggle.h b/src/kitemviews/private/kitemlistselectiontoggle.h
index 758dc63bb..d058ee988 100644
--- a/src/kitemviews/private/kitemlistselectiontoggle.h
+++ b/src/kitemviews/private/kitemlistselectiontoggle.h
@@ -20,17 +20,16 @@
#ifndef KITEMLISTSELECTIONTOGGLE_H
#define KITEMLISTSELECTIONTOGGLE_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QGraphicsWidget>
#include <QPixmap>
-class QPropertyAnimation;
/**
* @brief Allows to toggle between the selected and unselected state of an item.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListSelectionToggle : public QGraphicsWidget
+class DOLPHIN_EXPORT KItemListSelectionToggle : public QGraphicsWidget
{
Q_OBJECT
diff --git a/src/kitemviews/private/kitemlistsizehintresolver.h b/src/kitemviews/private/kitemlistsizehintresolver.h
index a0ad033f3..ff17f2de2 100644
--- a/src/kitemviews/private/kitemlistsizehintresolver.h
+++ b/src/kitemviews/private/kitemlistsizehintresolver.h
@@ -20,7 +20,7 @@
#ifndef KITEMLISTSIZEHINTRESOLVER_H
#define KITEMLISTSIZEHINTRESOLVER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <kitemviews/kitemmodelbase.h>
#include <QSizeF>
@@ -31,7 +31,7 @@ class KItemListView;
/**
* @brief Calculates and caches the sizehints of items in KItemListView.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListSizeHintResolver
+class DOLPHIN_EXPORT KItemListSizeHintResolver
{
public:
KItemListSizeHintResolver(const KItemListView* itemListView);
diff --git a/src/kitemviews/private/kitemlistsmoothscroller.cpp b/src/kitemviews/private/kitemlistsmoothscroller.cpp
index 491461b80..e70f47890 100644
--- a/src/kitemviews/private/kitemlistsmoothscroller.cpp
+++ b/src/kitemviews/private/kitemlistsmoothscroller.cpp
@@ -19,13 +19,11 @@
#include "kitemlistsmoothscroller.h"
-#include <KGlobalSettings>
#include <QEvent>
#include <QPropertyAnimation>
#include <QScrollBar>
#include <QWheelEvent>
-
-#include <KDebug>
+#include <QStyle>
KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
QObject* parent) :
@@ -36,10 +34,10 @@ KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
m_animation(0)
{
m_animation = new QPropertyAnimation(this);
- const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 100;
+ const int duration = m_scrollBar->style()->styleHint(QStyle::SH_Widget_Animate, nullptr, m_scrollBar) ? 100 : 1;
m_animation->setDuration(duration);
- connect(m_animation, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)),
- this, SLOT(slotAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
+ connect(m_animation, &QPropertyAnimation::stateChanged,
+ this, &KItemListSmoothScroller::slotAnimationStateChanged);
m_scrollBar->installEventFilter(this);
}
@@ -209,4 +207,3 @@ void KItemListSmoothScroller::handleWheelEvent(QWheelEvent* event)
event->accept();
}
-#include "kitemlistsmoothscroller.moc"
diff --git a/src/kitemviews/private/kitemlistsmoothscroller.h b/src/kitemviews/private/kitemlistsmoothscroller.h
index ea5682208..fca4b0c53 100644
--- a/src/kitemviews/private/kitemlistsmoothscroller.h
+++ b/src/kitemviews/private/kitemlistsmoothscroller.h
@@ -20,7 +20,7 @@
#ifndef KITEMLISTSMOOTHSCROLLER_H
#define KITEMLISTSMOOTHSCROLLER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QAbstractAnimation>
#include <QObject>
@@ -33,7 +33,7 @@ class QWheelEvent;
* @brief Helper class for KItemListContainer to have a smooth
* scrolling when adjusting the scrollbars.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListSmoothScroller : public QObject
+class DOLPHIN_EXPORT KItemListSmoothScroller : public QObject
{
Q_OBJECT
diff --git a/src/kitemviews/private/kitemlistviewanimation.cpp b/src/kitemviews/private/kitemlistviewanimation.cpp
index 5a00c8c3a..67ad192c6 100644
--- a/src/kitemviews/private/kitemlistviewanimation.cpp
+++ b/src/kitemviews/private/kitemlistviewanimation.cpp
@@ -21,22 +21,16 @@
#include <kitemviews/kitemlistview.h>
-#include <KDebug>
-#include <KGlobalSettings>
#include <QGraphicsWidget>
#include <QPropertyAnimation>
KItemListViewAnimation::KItemListViewAnimation(QObject* parent) :
QObject(parent),
- m_animationDuration(200),
m_scrollOrientation(Qt::Vertical),
m_scrollOffset(0),
m_animation()
{
- if (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) {
- m_animationDuration = 1;
- }
}
KItemListViewAnimation::~KItemListViewAnimation()
@@ -123,6 +117,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
stop(widget, type);
QPropertyAnimation* propertyAnim = 0;
+ const int animationDuration = widget->style()->styleHint(QStyle::SH_Widget_Animate) ? 200 : 1;
switch (type) {
case MovingAnimation: {
@@ -132,7 +127,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
}
propertyAnim = new QPropertyAnimation(widget, "pos");
- propertyAnim->setDuration(m_animationDuration);
+ propertyAnim->setDuration(animationDuration);
propertyAnim->setEndValue(newPos);
break;
}
@@ -140,7 +135,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
case CreateAnimation: {
propertyAnim = new QPropertyAnimation(widget, "opacity");
propertyAnim->setEasingCurve(QEasingCurve::InQuart);
- propertyAnim->setDuration(m_animationDuration);
+ propertyAnim->setDuration(animationDuration);
propertyAnim->setStartValue(0.0);
propertyAnim->setEndValue(1.0);
break;
@@ -149,7 +144,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
case DeleteAnimation: {
propertyAnim = new QPropertyAnimation(widget, "opacity");
propertyAnim->setEasingCurve(QEasingCurve::OutQuart);
- propertyAnim->setDuration(m_animationDuration);
+ propertyAnim->setDuration(animationDuration);
propertyAnim->setStartValue(1.0);
propertyAnim->setEndValue(0.0);
break;
@@ -162,7 +157,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
}
propertyAnim = new QPropertyAnimation(widget, "size");
- propertyAnim->setDuration(m_animationDuration);
+ propertyAnim->setDuration(animationDuration);
propertyAnim->setEndValue(newSize);
break;
}
@@ -172,7 +167,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
}
Q_ASSERT(propertyAnim);
- connect(propertyAnim, SIGNAL(finished()), this, SLOT(slotFinished()));
+ connect(propertyAnim, &QPropertyAnimation::finished, this, &KItemListViewAnimation::slotFinished);
m_animation[type].insert(widget, propertyAnim);
propertyAnim->start();
@@ -242,4 +237,3 @@ void KItemListViewAnimation::slotFinished()
Q_ASSERT(false);
}
-#include "kitemlistviewanimation.moc"
diff --git a/src/kitemviews/private/kitemlistviewanimation.h b/src/kitemviews/private/kitemlistviewanimation.h
index a3aceb0f5..06c81c9b8 100644
--- a/src/kitemviews/private/kitemlistviewanimation.h
+++ b/src/kitemviews/private/kitemlistviewanimation.h
@@ -20,7 +20,7 @@
#ifndef KITEMLISTVIEWANIMATION_H
#define KITEMLISTVIEWANIMATION_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QHash>
#include <QObject>
@@ -28,7 +28,6 @@
class KItemListView;
class QGraphicsWidget;
-class QPointF;
class QPropertyAnimation;
/**
@@ -37,7 +36,7 @@ class QPropertyAnimation;
* Supports item animations for moving, creating, deleting and resizing
* an item. Several applications can be applied to one item in parallel.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListViewAnimation : public QObject
+class DOLPHIN_EXPORT KItemListViewAnimation : public QObject
{
Q_OBJECT
@@ -95,7 +94,6 @@ private slots:
private:
enum { AnimationTypeCount = 4 };
- int m_animationDuration;
Qt::Orientation m_scrollOrientation;
qreal m_scrollOffset;
QHash<QGraphicsWidget*, QPropertyAnimation*> m_animation[AnimationTypeCount];
diff --git a/src/kitemviews/private/kitemlistviewlayouter.cpp b/src/kitemviews/private/kitemlistviewlayouter.cpp
index 04325c7d0..d54457908 100644
--- a/src/kitemviews/private/kitemlistviewlayouter.cpp
+++ b/src/kitemviews/private/kitemlistviewlayouter.cpp
@@ -22,7 +22,7 @@
#include <kitemviews/kitemmodelbase.h>
#include "kitemlistsizehintresolver.h"
-#include <KDebug>
+#include "dolphindebug.h"
// #define KITEMLISTVIEWLAYOUTER_DEBUG
@@ -516,7 +516,7 @@ void KItemListViewLayouter::doLayout()
}
#ifdef KITEMLISTVIEWLAYOUTER_DEBUG
- kDebug() << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed();
+ qCDebug(DolphinDebug) << "[TIME] doLayout() for " << m_model->count() << "items:" << timer.elapsed();
#endif
m_dirty = false;
}
@@ -621,4 +621,3 @@ qreal KItemListViewLayouter::minimumGroupHeaderWidth() const
return 100;
}
-#include "kitemlistviewlayouter.moc"
diff --git a/src/kitemviews/private/kitemlistviewlayouter.h b/src/kitemviews/private/kitemlistviewlayouter.h
index 0efcab12b..3f1cf68d4 100644
--- a/src/kitemviews/private/kitemlistviewlayouter.h
+++ b/src/kitemviews/private/kitemlistviewlayouter.h
@@ -20,7 +20,7 @@
#ifndef KITEMLISTVIEWLAYOUTER_H
#define KITEMLISTVIEWLAYOUTER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
#include <QObject>
#include <QRectF>
@@ -45,7 +45,7 @@ class KItemListSizeHintResolver;
* changing properties of the layouter is not expensive, only the
* first read of a property can get expensive.
*/
-class LIBDOLPHINPRIVATE_EXPORT KItemListViewLayouter : public QObject
+class DOLPHIN_EXPORT KItemListViewLayouter : public QObject
{
Q_OBJECT
diff --git a/src/kitemviews/private/kpixmapmodifier.cpp b/src/kitemviews/private/kpixmapmodifier.cpp
index 29aceb66b..c564ecc30 100644
--- a/src/kitemviews/private/kpixmapmodifier.cpp
+++ b/src/kitemviews/private/kpixmapmodifier.cpp
@@ -39,7 +39,6 @@
#include <QPixmap>
#include <QSize>
-#include <KDebug>
#include <config-X11.h> // for HAVE_XRENDER
#if defined(Q_WS_X11) && defined(HAVE_XRENDER)
diff --git a/src/kitemviews/private/kpixmapmodifier.h b/src/kitemviews/private/kpixmapmodifier.h
index 4f863c349..e8ca11ac1 100644
--- a/src/kitemviews/private/kpixmapmodifier.h
+++ b/src/kitemviews/private/kpixmapmodifier.h
@@ -20,12 +20,12 @@
#ifndef KPIXMAPMODIFIER_H
#define KPIXMAPMODIFIER_H
-#include <libdolphin_export.h>
+#include "dolphin_export.h"
class QPixmap;
class QSize;
-class LIBDOLPHINPRIVATE_EXPORT KPixmapModifier
+class DOLPHIN_EXPORT KPixmapModifier
{
public:
static void scale(QPixmap& pixmap, const QSize& scaledSize);