Commit 4ffd2024 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to no deprecated QFileSystemModel

parent c14cfe1c
......@@ -24,7 +24,7 @@
#include "configview.h"
#include <QCompleter>
#include <QDirModel>
#include <QFileSystemModel>
#include <QFileDialog>
#include <QLayout>
#include <QPushButton>
......@@ -73,7 +73,9 @@ ConfigView::ConfigView(QWidget *parent, KTextEditor::MainWindow *mainWin)
m_executable = new QLineEdit();
QCompleter *completer1 = new QCompleter(this);
completer1->setModel(new QDirModel(QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name, this));
QFileSystemModel *model = new QFileSystemModel(this);
model->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);
completer1->setModel(model);
m_executable->setCompleter(completer1);
m_executable->setClearButtonEnabled(true);
m_browseExe = new QToolButton(this);
......@@ -81,7 +83,9 @@ ConfigView::ConfigView(QWidget *parent, KTextEditor::MainWindow *mainWin)
m_workingDirectory = new QLineEdit();
QCompleter *completer2 = new QCompleter(this);
completer2->setModel(new QDirModel(completer2));
QFileSystemModel *model2 = new QFileSystemModel(completer2);
completer2->setModel(model2);
m_workingDirectory->setCompleter(completer2);
m_workingDirectory->setClearButtonEnabled(true);
m_workDirLabel = new QLabel(i18n("Working Directory:"));
......
......@@ -23,7 +23,7 @@
#include <QAbstractTextDocumentLayout>
#include <QCompleter>
#include <QDirModel>
#include <QFileSystemModel>
#include <QLineEdit>
#include <QModelIndex>
#include <QPainter>
......@@ -119,7 +119,9 @@ QWidget *TargetHtmlDelegate::createEditor(QWidget *dparent, const QStyleOptionVi
} else {
QLineEdit *e = new QLineEdit(dparent);
QCompleter *completer = new QCompleter(e);
completer->setModel(new QDirModel(QStringList(), QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name, e));
QFileSystemModel *model = new QFileSystemModel(e);
model->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot);
completer->setModel(model);
e->setCompleter(completer);
editor = e;
}
......
......@@ -21,7 +21,7 @@
#include "UrlInserter.h"
#include <QCompleter>
#include <QDebug>
#include <QDirModel>
#include <QFileSystemModel>
#include <QFileDialog>
#include <QFileInfo>
#include <QHBoxLayout>
......@@ -35,7 +35,9 @@ UrlInserter::UrlInserter(const QUrl &startUrl, QWidget *parent)
{
m_lineEdit = new QLineEdit();
QCompleter *completer = new QCompleter(m_lineEdit);
completer->setModel(new QDirModel(QStringList(), QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Executable, QDir::Name, m_lineEdit));
QFileSystemModel *model = new QFileSystemModel(m_lineEdit);
model->setFilter(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Executable);
completer->setModel(model);
m_lineEdit->setCompleter(completer);
m_toolButton = new QToolButton();
......
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