Commit 3aef056f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Initialize pointer. Remove check as we depend against qt5.14

parent 034d673f
......@@ -27,8 +27,8 @@ namespace Gwenview
struct AbstractContextManagerItemPrivate
{
ContextManager* mContextManager;
QWidget* mWidget;
ContextManager* mContextManager = nullptr;
QWidget* mWidget = nullptr;
};
AbstractContextManagerItem::AbstractContextManagerItem(ContextManager* manager)
......
......@@ -35,8 +35,8 @@ namespace Gwenview
DocumentInfoProvider::DocumentInfoProvider(SortedDirModel* model)
: AbstractDocumentInfoProvider(model)
, mDirModel(model)
{
mDirModel = model;
connect(DocumentFactory::instance(), &DocumentFactory::documentBusyStateChanged,
this, &AbstractDocumentInfoProvider::busyStateChanged);
connect(DocumentFactory::instance(), &DocumentFactory::documentChanged,
......
......@@ -46,7 +46,7 @@ public:
void thumbnailForDocument(const QUrl &url, ThumbnailGroup::Enum group, QPixmap* outPix, QSize* outFullSize) const override;
private:
SortedDirModel* mDirModel;
SortedDirModel *const mDirModel;
};
} // namespace
......
......@@ -69,7 +69,7 @@ protected:
{
QAbstractItemView::dragMoveEvent(event);
QModelIndex index = indexAt(event->pos());
const QModelIndex index = indexAt(event->pos());
// This code has been copied from Dolphin
// (panels/folders/paneltreeview.cpp)
......@@ -148,7 +148,7 @@ void FolderViewContextManagerItem::expandToSelectedUrl()
setupModel();
}
QModelIndex index = findClosestIndex(mExpandingIndex, mUrlToSelect);
const QModelIndex index = findClosestIndex(mExpandingIndex, mUrlToSelect);
if (!index.isValid()) {
return;
}
......@@ -252,11 +252,7 @@ QModelIndex FolderViewContextManagerItem::findClosestIndex(const QModelIndex& pa
QString relativePath = QDir(url.path()).relativeFilePath(wantedUrl.path());
QModelIndex lastFoundIndex = index;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
const QStringList relativePathList = relativePath.split(QDir::separator(), Qt::SkipEmptyParts);
#else
const QStringList relativePathList = relativePath.split(QDir::separator(), QString::SkipEmptyParts);
#endif
for (const QString & pathPart : relativePathList) {
bool found = false;
for (int row = 0; row < mModel->rowCount(lastFoundIndex); ++row) {
......
......@@ -640,11 +640,7 @@ void ViewMainPage::openUrls(const QList<QUrl>& allUrls, const QUrl &currentUrl)
{
DocumentView::Setup setup;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QSet<QUrl> urls(allUrls.begin(), allUrls.end());
#else
QSet<QUrl> urls = allUrls.toSet();
#endif
d->mCompareMode = urls.count() > 1;
typedef QMap<QUrl, DocumentView*> ViewForUrlMap;
......
......@@ -38,12 +38,10 @@ TagSet::TagSet()
TagSet::TagSet(const QSet<SemanticInfoTag>& set)
: QSet<QString>(set) {}
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
TagSet::TagSet(const QList<SemanticInfoTag>& list)
: QSet(list.begin(), list.end())
{
}
#endif
QVariant TagSet::toVariant() const
{
......@@ -59,11 +57,7 @@ TagSet TagSet::fromVariant(const QVariant& variant)
TagSet TagSet::fromList(const QList<SemanticInfoTag>& list)
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
return TagSet(list);
#else
return QSet<SemanticInfoTag>::fromList(lst);
#endif
}
AbstractSemanticInfoBackEnd::AbstractSemanticInfoBackEnd(QObject* parent)
......
......@@ -54,10 +54,8 @@ public:
static TagSet fromVariant(const QVariant&);
static TagSet fromList(const QList<SemanticInfoTag>&);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
private:
TagSet(const QList<SemanticInfoTag>&);
#endif
};
/**
......
......@@ -121,11 +121,7 @@ void PlaceTreeModelTest::testListPlaces()
{
PlaceTreeModel model(nullptr);
#if KIO_VERSION >= QT_VERSION_CHECK(5, 45, 0)
QCOMPARE(model.rowCount(), 8);
#else
QCOMPARE(model.rowCount(), 10);
#endif
QModelIndex index;
index = model.index(0, 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