summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Whiting <[email protected]>2015-02-23 21:24:47 -0700
committerJeremy Whiting <[email protected]>2015-02-23 21:24:47 -0700
commite0eb93b576bb1255262f9149a77888ab413e04e1 (patch)
treeed770c165ea2c675e01ccfa2bbc3b94949a17c3d
parent058ae22cfe95445298ba6413548357219ef7b6b3 (diff)
Change WordCompletionWidget K3ListView to QTableView and QStandardItemModel.
-rw-r--r--wordcompletion/wordcompletionui.ui207
-rw-r--r--wordcompletion/wordcompletionwidget.cpp229
-rw-r--r--wordcompletion/wordcompletionwidget.h7
3 files changed, 182 insertions, 261 deletions
diff --git a/wordcompletion/wordcompletionui.ui b/wordcompletion/wordcompletionui.ui
index 09fa62e..fdef3ba 100644
--- a/wordcompletion/wordcompletionui.ui
+++ b/wordcompletion/wordcompletionui.ui
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
<class>WordCompletionUI</class>
- <widget class="QWidget" name="WordCompletionUI" >
- <property name="geometry" >
+ <widget class="QWidget" name="WordCompletionUI">
+ <property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@@ -9,68 +10,69 @@
<height>300</height>
</rect>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="1" column="0" >
- <widget class="QGroupBox" name="selectedDictionaryDetails" >
- <property name="enabled" >
+ <item row="1" column="0">
+ <widget class="QGroupBox" name="selectedDictionaryDetails">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>5</vsizetype>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="title" >
+ <property name="title">
<string>&amp;Selected Dictionary</string>
</property>
- <layout class="QGridLayout" >
- <property name="margin" >
+ <layout class="QGridLayout">
+ <property name="margin">
<number>9</number>
</property>
- <property name="spacing" >
+ <property name="spacing">
<number>6</number>
</property>
- <item row="1" column="1" >
- <widget class="KLanguageButton" name="languageButton" />
+ <item row="1" column="1">
+ <widget class="KLanguageButton" name="languageButton" native="true"/>
</item>
- <item row="1" column="0" >
- <widget class="QLabel" name="languageLabel" >
- <property name="whatsThis" >
+ <item row="1" column="0">
+ <widget class="QLabel" name="languageLabel">
+ <property name="whatsThis">
<string>With this combo box you select the language associated with the selected dictionary.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Language:</string>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>languageButton</cstring>
</property>
</widget>
</item>
- <item row="0" column="0" >
- <widget class="QLabel" name="dictionaryNameLabel" >
- <property name="whatsThis" >
+ <item row="0" column="0">
+ <widget class="QLabel" name="dictionaryNameLabel">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="whatsThis">
<string>With this input field you specify the name of the selected dictionary.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Name:</string>
</property>
- <property name="buddy" >
+ <property name="buddy">
<cstring>dictionaryName</cstring>
</property>
</widget>
</item>
- <item row="0" column="1" >
- <widget class="KLineEdit" name="dictionaryName" >
- <property name="whatsThis" >
+ <item row="0" column="1">
+ <widget class="KLineEdit" name="dictionaryName">
+ <property name="whatsThis">
<string>With this input field you specify the name of the selected dictionary.</string>
</property>
</widget>
@@ -78,125 +80,115 @@
</layout>
</widget>
</item>
- <item rowspan="2" row="0" column="1" >
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
+ <item row="0" column="1" rowspan="2">
+ <layout class="QVBoxLayout">
+ <property name="spacing">
<number>6</number>
</property>
+ <property name="margin">
+ <number>0</number>
+ </property>
<item>
- <widget class="KPushButton" name="addButton" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
+ <widget class="KPushButton" name="addButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>With this button you can add a new dictionary to the list of available dictionaries.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Add D&amp;ictionary...</string>
</property>
</widget>
</item>
<item>
- <widget class="KPushButton" name="deleteButton" >
- <property name="enabled" >
+ <widget class="KPushButton" name="deleteButton">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>With this button you delete the selected dictionary.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Delete Dictionary</string>
</property>
</widget>
</item>
<item>
- <widget class="KPushButton" name="moveUpButton" >
- <property name="enabled" >
+ <widget class="KPushButton" name="moveUpButton">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>With this button you move the selected dictionary up.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>Move &amp;Up</string>
</property>
</widget>
</item>
<item>
- <widget class="KPushButton" name="moveDownButton" >
- <property name="enabled" >
+ <widget class="KPushButton" name="moveDownButton">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>With this button you move the selected dictionary down.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Move Down</string>
</property>
</widget>
</item>
<item>
- <widget class="KPushButton" name="exportButton" >
- <property name="enabled" >
+ <widget class="KPushButton" name="exportButton">
+ <property name="enabled">
<bool>false</bool>
</property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>0</vsizetype>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="whatsThis" >
+ <property name="whatsThis">
<string>With this button you export the selected dictionary to a file.</string>
</property>
- <property name="text" >
+ <property name="text">
<string>&amp;Export Dictionary...</string>
</property>
</widget>
</item>
<item>
<spacer>
- <property name="orientation" >
+ <property name="orientation">
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeType" >
+ <property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
- <property name="sizeHint" >
+ <property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>240</height>
@@ -206,60 +198,51 @@
</item>
</layout>
</item>
- <item row="0" column="0" >
- <widget class="K3ListView" name="dictionaryList" >
- <property name="whatsThis" >
+ <item row="0" column="0">
+ <widget class="QTableView" name="dictionaryView">
+ <property name="whatsThis">
<string>This list contains all available dictionaries for the word completion. KMouth will display a combo box next to the edit field in the main window if this list contains more than one dictionary. You can use this combo box in order to select the dictionary that actually gets used for the word completion.</string>
</property>
- <property name="allColumnsShowFocus" >
+ <property name="selectionMode">
+ <enum>QAbstractItemView::SingleSelection</enum>
+ </property>
+ <property name="selectionBehavior">
+ <enum>QAbstractItemView::SelectRows</enum>
+ </property>
+ <property name="allColumnsShowFocus" stdset="0">
<bool>true</bool>
</property>
- <column>
- <property name="text" >
- <string>Dictionary</string>
- </property>
- </column>
- <column>
- <property name="text" >
- <string>Language</string>
- </property>
- </column>
+ <attribute name="horizontalHeaderVisible">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="verticalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
</widget>
</item>
</layout>
</widget>
- <customwidgets>
+ <customwidgets>
<customwidget>
- <class>K3ListView</class>
- <extends>Q3ListView</extends>
- <header>k3listview.h</header>
- <container>0</container>
- <pixmap></pixmap>
+ <class>KLanguageButton</class>
+ <extends>QWidget</extends>
+ <header>klanguagebutton.h</header>
</customwidget>
<customwidget>
<class>KLineEdit</class>
<extends>QLineEdit</extends>
<header>klineedit.h</header>
- <container>0</container>
- <pixmap></pixmap>
- </customwidget>
- <customwidget>
- <class>KLanguageButton</class>
- <extends>QWidget</extends>
- <header>klanguagebutton.h</header>
- <container>0</container>
- <pixmap></pixmap>
</customwidget>
<customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
- <container>0</container>
- <pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
- <tabstop>dictionaryList</tabstop>
<tabstop>addButton</tabstop>
<tabstop>deleteButton</tabstop>
<tabstop>moveUpButton</tabstop>
diff --git a/wordcompletion/wordcompletionwidget.cpp b/wordcompletion/wordcompletionwidget.cpp
index d564ec6..032d6a0 100644
--- a/wordcompletion/wordcompletionwidget.cpp
+++ b/wordcompletion/wordcompletionwidget.cpp
@@ -23,8 +23,8 @@
#include <QtGui/QLabel>
#include <QtGui/QCheckBox>
#include <QtGui/QLineEdit>
+#include <QStandardItemModel>
-#include <k3listview.h>
#include <klineedit.h>
#include <kurlrequester.h>
#include <klocale.h>
@@ -36,65 +36,16 @@
#include <kmessagebox.h>
#include <klanguagebutton.h>
-class DictionaryListItem : public K3ListViewItem {
-public:
- DictionaryListItem (Q3ListView *parent, QString filename, QString name, QString language, QString languageCode)
- : K3ListViewItem (parent, name) {
- setFilename (filename);
- setLanguage (language, languageCode);
- }
- DictionaryListItem (Q3ListView *parent, QString filename, QString name, QString languageCode)
- : K3ListViewItem (parent, name) {
- setFilename (filename);
- setLanguage (languageCode);
- }
- DictionaryListItem (Q3ListView *parent, Q3ListViewItem *after, QString filename, QString name, QString languageCode)
- : K3ListViewItem (parent, after, name) {
- setFilename (filename);
- setLanguage (languageCode);
- }
- ~DictionaryListItem () {
- }
-
- QString filename() {
- return myFilename;
- }
-
- QString languageCode() {
- return myLanguageCode;
- }
-
- void setFilename(QString filename) {
- myFilename = filename;
- }
-
- void setLanguage (QString languageCode) {
- QString name = KGlobal::locale()->languageCodeToName(languageCode);
- if (name.isEmpty())
- {
- name = i18n("without name");
- }
- setLanguage (name + QLatin1String( " (" ) + languageCode + QLatin1Char( ')' ), languageCode);
- }
-
- void setLanguage (QString name, QString languageCode) {
- myLanguageCode = languageCode;
- setText (1, name);
- }
-
-private:
- QString myFilename;
- QString myLanguageCode;
-};
-
-/***************************************************************************/
-
WordCompletionWidget::WordCompletionWidget(QWidget *parent, const char *name)
: QWidget(parent)
{
setupUi(this);
setObjectName( QLatin1String( name ) );
- dictionaryList->setSorting (-1); // no sorted list
+ model = new QStandardItemModel(0, 2, this);
+ QStringList labels;
+ labels << i18n("Dictionary") << i18n("Language");
+ model->setHorizontalHeaderLabels(labels);
+ dictionaryView->setModel(model);
languageButton->showLanguageCodes(true);
languageButton->loadAllLanguages();
@@ -106,7 +57,8 @@ WordCompletionWidget::WordCompletionWidget(QWidget *parent, const char *name)
connect (moveDownButton, SIGNAL (clicked()), this, SLOT (moveDown()) );
connect (exportButton, SIGNAL (clicked()), this, SLOT (exportDictionary()) );
- connect (dictionaryList, SIGNAL (selectionChanged()), this, SLOT (selectionChanged()) );
+ connect (dictionaryView->selectionModel(), SIGNAL (selectionChanged(QItemSelection, QItemSelection)),
+ this, SLOT (selectionChanged()) );
connect (dictionaryName, SIGNAL (textChanged(QString)), this, SLOT (nameChanged(QString)) );
connect (languageButton, SIGNAL (activated(QString)), this, SLOT (languageSelected()) );
@@ -127,19 +79,22 @@ WordCompletionWidget::~WordCompletionWidget() {
/***************************************************************************/
void WordCompletionWidget::load() {
- dictionaryList->clear();
+ model->clear();
// Set the group general for the configuration of kttsd itself (no plug ins)
const QStringList groups = config->groupList();
- DictionaryListItem *last = 0;
for (QStringList::const_iterator it = groups.constBegin(); it != groups.constEnd(); ++it)
if ((*it).startsWith (QLatin1String("Dictionary "))) {
- KConfigGroup cg (config, *it);
+ KConfigGroup cg (config, *it);
+ QString filename = cg.readEntry("Filename");
QString languageTag = cg.readEntry("Language");
- last = new DictionaryListItem (dictionaryList, last,
- cg.readEntry("Filename"),
- cg.readEntry("Name"),
- languageTag);
+ QStandardItem *nameItem = new QStandardItem(cg.readEntry("Name"));
+ nameItem->setData(filename);
+ QStandardItem *languageItem = new QStandardItem(languageTag);
+ QList<QStandardItem*> items;
+ items.append(nameItem);
+ items.append(languageItem);
+ model->appendRow(items);
if (!languageButton->contains(languageTag))
languageButton->insertLanguage(languageTag, i18n("without name"));
}
@@ -159,18 +114,14 @@ void WordCompletionWidget::save() {
if ((*it).startsWith (QLatin1String("Dictionary ")))
config->deleteGroup (*it);
- int number = 0;
- Q3ListViewItemIterator it(dictionaryList);
- while (it.current()) {
- DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(it.current());
- if (item != 0) {
- KConfigGroup cg (config, QString(QLatin1String( "Dictionary %1" )).arg(number));
- cg.writeEntry ("Filename", item->filename());
- cg.writeEntry ("Name", item->text (0));
- cg.writeEntry ("Language", item->languageCode());
- number++;
- }
- ++it;
+ int row = 0;
+ for (int row = 0; row < model->rowCount(); ++row) {
+ const QStandardItem *nameItem = model->item(row, 0);
+ const QStandardItem *languageItem = model->item(row, 1);
+ KConfigGroup cg (config, QString(QLatin1String( "Dictionary %1" )).arg(row));
+ cg.writeEntry ("Filename", nameItem->data().toString());
+ cg.writeEntry ("Name", nameItem->text ());
+ cg.writeEntry ("Language", languageItem->text ());
}
config->sync();
@@ -189,15 +140,12 @@ void WordCompletionWidget::addDictionary() {
QStringList dictionaryNames;
QStringList dictionaryFiles;
QStringList dictionaryLanguages;
- Q3ListViewItemIterator it(dictionaryList);
- while (it.current()) {
- DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(it.current());
- if (item != 0) {
- dictionaryNames += item->text (0);
- dictionaryFiles += item->filename();
- dictionaryLanguages += item->languageCode();
- }
- ++it;
+ for (int row = 0; row < model->rowCount(); ++row) {
+ const QStandardItem *nameItem = model->item(row, 0);
+ const QStandardItem *languageItem = model->item(row, 1);
+ dictionaryNames += nameItem->text();
+ dictionaryFiles += nameItem->data().toString();
+ dictionaryLanguages += languageItem->text();
}
DictionaryCreationWizard *wizard = new DictionaryCreationWizard (this, "Dictionary creation wizard", dictionaryNames, dictionaryFiles, dictionaryLanguages);
if (wizard->exec() == QDialog::Accepted) {
@@ -207,50 +155,49 @@ void WordCompletionWidget::addDictionary() {
if (!languageButton->contains(languageTag)) {
languageButton->insertLanguage(languageTag, i18n("without name"));
}
- K3ListViewItem *item = new DictionaryListItem (dictionaryList,
- filename, wizard->name(), languageTag);
- dictionaryList->setSelected(item, true);
+ QStandardItem *nameItem = new QStandardItem(wizard->name());
+ nameItem->setData(filename);
+ QStandardItem *languageItem = new QStandardItem(languageTag);
+ QList<QStandardItem*> items;
+ items.append(nameItem);
+ items.append(languageItem);
+ model->appendRow(items);
}
delete wizard;
}
void WordCompletionWidget::deleteDictionary() {
- DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(dictionaryList->selectedItem ());
+ int row = dictionaryView->currentIndex().row();
+ const QStandardItem *nameItem = model->item(row, 0);
- if (item != 0) {
- removedDictionaryFiles += item->filename();
- delete item;
+ if (nameItem != 0) {
+ removedDictionaryFiles += nameItem->data().toString();
+ qDeleteAll(model->takeRow(row));
}
}
void WordCompletionWidget::moveUp() {
- Q3ListViewItem *item = dictionaryList->selectedItem ();
-
- if (item != 0) {
- Q3ListViewItem *above = item->itemAbove();
-
- if (above != 0) {
- above->moveItem (item);
- }
+ int row = dictionaryView->currentIndex().row();
+ if (row > 0) {
+ QList<QStandardItem*> items = model->takeRow(row);
+ model->insertRow(row - 1, items);
+ dictionaryView->setCurrentIndex(model->index(row - 1, 0));
}
}
void WordCompletionWidget::moveDown() {
- Q3ListViewItem *item = dictionaryList->selectedItem ();
-
- if (item != 0) {
- Q3ListViewItem *next = item->itemBelow();
-
- if (next != 0) {
- item->moveItem (next);
- }
+ int row = dictionaryView->currentIndex().row();
+ if (row < model->rowCount() - 1) {
+ QList<QStandardItem*> items = model->takeRow(row);
+ model->insertRow(row + 1, items);
+ dictionaryView->setCurrentIndex(model->index(row + 1, 0));
}
}
void WordCompletionWidget::exportDictionary() {
- DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(dictionaryList->selectedItem ());
+ const QStandardItem *nameItem = model->item(dictionaryView->currentIndex().row(), 0);
- if (item != 0) {
+ if (nameItem != 0) {
KUrl url = KFileDialog::getSaveUrl(QString(), QString(), this, i18n("Export Dictionary"));
if (url.isEmpty() || !url.isValid())
return;
@@ -262,65 +209,55 @@ void WordCompletionWidget::exportDictionary() {
}
}
KUrl src;
- src.setPath( KGlobal::dirs()->findResource ("appdata", item->filename()) );
+ src.setPath( KGlobal::dirs()->findResource ("appdata", nameItem->data().toString()) );
KIO::NetAccess::file_copy (src, url, this);
}
}
void WordCompletionWidget::selectionChanged() {
- DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(dictionaryList->selectedItem ());
-
- if (item != 0) {
- deleteButton->setEnabled(true);
- moveUpButton->setEnabled(true);
- moveDownButton->setEnabled(true);
- exportButton->setEnabled(true);
- selectedDictionaryDetails->setEnabled(true);
- languageLabel->setEnabled(true);
- dictionaryNameLabel->setEnabled(true);
- dictionaryName->setEnabled(true);
- languageButton->setEnabled(true);
-
- dictionaryName->setText(item->text(0));
- languageButton->setCurrentItem(item->languageCode());
- }
- else {
- deleteButton->setEnabled(false);
- moveUpButton->setEnabled(false);
- moveDownButton->setEnabled(false);
- exportButton->setEnabled(false);
- selectedDictionaryDetails->setEnabled(false);
- languageLabel->setEnabled(false);
- dictionaryNameLabel->setEnabled(false);
- dictionaryName->setEnabled(false);
- languageButton->setEnabled(false);
-
- dictionaryName->setText(QLatin1String( "" ));
+ QModelIndex current = dictionaryView->currentIndex();
+ deleteButton->setEnabled(current.isValid());
+ exportButton->setEnabled(current.isValid());
+ selectedDictionaryDetails->setEnabled(current.isValid());
+ moveUpButton->setEnabled(current.isValid() && current.row() > 0);
+ moveDownButton->setEnabled(current.isValid() && current.row() < model->rowCount() - 1);
+
+ if (current.isValid()) {
+ const QStandardItem *nameItem = model->item(current.row(), 0);
+ const QStandardItem *languageItem = model->item(current.row(), 1);
+
+ dictionaryName->setText(nameItem->text());
+ languageButton->setCurrentItem(languageItem->text());
+ } else {
+ dictionaryName->clear();
}
}
void WordCompletionWidget::nameChanged (const QString &text) {
- Q3ListViewItem *item = dictionaryList->selectedItem ();
+ const QStandardItem *nameItem = model->item(dictionaryView->currentIndex().row(), 0);
- if (item != 0) {
- QString old = item->text(0);
+ if (nameItem != 0) {
+ QString old = nameItem->text();
if (old != text) {
- item->setText(0, text);
+ QStandardItem *newItem = new QStandardItem(text);
+ newItem->setData(nameItem->data());
+ model->setItem(dictionaryView->currentIndex().row(), 0, newItem);
emit changed(true);
}
}
}
void WordCompletionWidget::languageSelected () {
- DictionaryListItem *item = dynamic_cast<DictionaryListItem*>(dictionaryList->selectedItem ());
+ const QStandardItem *languageItem = model->item(dictionaryView->currentIndex().row(), 1);
- if (item != 0) {
- QString old = item->text(1);
+ if (languageItem != 0) {
+ QString old = languageItem->text();
QString text = languageButton->current();
if (old != text) {
- item->setLanguage(languageButton->current(), text);
+ QStandardItem *newItem = new QStandardItem(text);
+ model->setItem(dictionaryView->currentIndex().row(), 1, newItem);
emit changed(true);
}
}
diff --git a/wordcompletion/wordcompletionwidget.h b/wordcompletion/wordcompletionwidget.h
index ec134f0..a8818b5 100644
--- a/wordcompletion/wordcompletionwidget.h
+++ b/wordcompletion/wordcompletionwidget.h
@@ -22,7 +22,7 @@
#include "ui_wordcompletionui.h"
-class WordCompletion;
+class QStandardItemModel;
/**
* This class represents a configuration widget for managing dictionaries.
@@ -41,7 +41,7 @@ public:
void load();
/**
- * This function gets called when the user wants to save the settings in
+ * This function gets called when the user wants to save the settings in
* the user interface, updating the config files.
*/
void save();
@@ -62,7 +62,7 @@ private slots:
/**
* This slot is used to emit the signal changed when any widget changes
- * the configuration
+ * the configuration
*/
void configChanged() {
emit changed(true);
@@ -75,6 +75,7 @@ private:
KConfig *config;
QStringList newDictionaryFiles;
QStringList removedDictionaryFiles;
+ QStandardItemModel *model;
};
#endif