Commit 23cda609 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Convert from KUrlCompletion to QFileSystemModel + QCompleter

parent 8c6c87f3
......@@ -23,6 +23,8 @@
// Qt
#include <QtGui/QFontMetrics>
#include <QtCore/QFileInfo>
#include <QCompleter>
#include <QFileSystemModel>
// KDE
#include <KColorDialog>
......@@ -78,10 +80,13 @@ ColorSchemeEditor::ColorSchemeEditor(QWidget* aParent)
SLOT(setRandomizedBackgroundColor(bool)));
// wallpaper stuff
#pragma message("Look at this setCompletionObject again")
// KUrlCompletion* fileCompletion = new KUrlCompletion(KUrlCompletion::FileCompletion);
// fileCompletion->setParent(this);
// _ui->wallpaperPath->setCompletionObject(fileCompletion);
QFileSystemModel *dirModel = new QFileSystemModel(this);
dirModel->setFilter(QDir::AllEntries);
dirModel->setRootPath(QString('/'));
QCompleter *completer = new QCompleter(this);
completer->setModel(dirModel);
_ui->wallpaperPath->setCompleter(completer);
_ui->wallpaperPath->setClearButtonEnabled(true);
_ui->wallpaperSelectButton->setIcon(KIcon("image-x-generic"));
......
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