Commit 29f83460 authored by Benjamin Port's avatar Benjamin Port
Browse files

Cleanup CursorThemeConfig remove uneeded ; and remove unused variable / method

Reviewers: #plasma, mart, ervin, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D24516
parent 8732fb80
......@@ -152,11 +152,6 @@ void CursorThemeConfig::setSelectedThemeRow(int row)
emit selectedThemeRowChanged();
updateSizeComboBox();
QModelIndex selected = selectedIndex();
if (selected.isValid()) {
const CursorTheme *theme = m_proxyModel->theme(selected);
}
setNeedsSave(m_originalSelectedThemeRow != m_selectedThemeRow || m_originalPreferredSize != m_preferredSize);
}
......@@ -256,7 +251,7 @@ void CursorThemeConfig::updateSizeComboBox()
item->setData(i);
m_sizesModel->appendRow(item);
comboBoxList << i;
};
}
// select an item
int selectItem = comboBoxList.indexOf(m_preferredSize);
......@@ -278,15 +273,15 @@ void CursorThemeConfig::updateSizeComboBox()
if (distance < smallestDistance || (distance == smallestDistance && j > m_preferredSize)) {
smallestDistance = distance;
selectItem = i;
};
}
}
};
}
if (selectItem < 0) {
selectItem = 0;
}
setSelectedSizeRow(selectItem);
};
};
}
}
// enable or disable the combobox
KConfig c("kcminputrc");
......@@ -295,7 +290,7 @@ void CursorThemeConfig::updateSizeComboBox()
setCanResize(false);
} else {
setCanResize(m_sizesModel->rowCount() > 0);
};
}
}
......@@ -367,7 +362,7 @@ void CursorThemeConfig::save()
KConfigGroup c(&config, "Mouse");
if (theme) {
c.writeEntry("cursorTheme", theme->name());
};
}
c.writeEntry("cursorSize", m_preferredSize);
c.sync();
......@@ -410,8 +405,6 @@ void CursorThemeConfig::load()
setCanInstall(false);
}
const CursorTheme *theme = m_proxyModel->theme(m_appliedIndex);
setSelectedThemeRow(m_appliedIndex.row());
m_originalSelectedThemeRow = m_selectedThemeRow;
......@@ -441,15 +434,6 @@ void CursorThemeConfig::defaults()
setNeedsSave(m_originalSelectedThemeRow != m_selectedThemeRow || m_originalPreferredSize != m_preferredSize);
}
void CursorThemeConfig::selectionChanged()
{
updateSizeComboBox();
setNeedsSave(m_originalSelectedThemeRow != m_selectedThemeRow || m_originalPreferredSize != m_preferredSize);
//setNeedsSave(m_appliedIndex != selectedIndex());
}
QModelIndex CursorThemeConfig::selectedIndex() const
{
return m_proxyModel->index(m_selectedThemeRow, 0);
......@@ -559,7 +543,7 @@ void CursorThemeConfig::installThemeFile(const QString &path)
if (!QDir().mkpath(destDir)) {
emit showErrorMessage(i18n("Failed to create 'icons' folder."));
return;
};
}
// Process each cursor theme in the archive
foreach (const QString &dirName, themeDirs) {
......
......@@ -95,7 +95,6 @@ public Q_SLOTS:
void removeTheme(int row);
private Q_SLOTS:
void selectionChanged();
/** Updates the size combo box. It loads the size list of the selected cursor
theme with the corresponding icons and chooses an appropriate entry. It
enables the combo box and the label if the theme provides more than one
......
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