Commit 5dfbfd2a authored by David Schulz's avatar David Schulz

Editor: Remove unused code from open editors window.

Change-Id: I830786192e5087d6bfdef9ce33fc67f441915136
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent 76f82916
......@@ -92,19 +92,6 @@ void OpenEditorsWindow::setVisible(bool visible)
setFocus();
}
bool OpenEditorsWindow::isCentering()
{
int internalMargin = m_editorList->viewport()->mapTo(m_editorList, QPoint(0,0)).y();
QRect rect0 = m_editorList->visualItemRect(m_editorList->topLevelItem(0));
QRect rect1 = m_editorList->visualItemRect(m_editorList->topLevelItem(m_editorList->topLevelItemCount()-1));
int height = rect1.y() + rect1.height() - rect0.y();
height += 2 * internalMargin;
if (height > HEIGHT)
return true;
return false;
}
bool OpenEditorsWindow::eventFilter(QObject *obj, QEvent *e)
{
if (obj == m_editorList) {
......@@ -176,24 +163,6 @@ void OpenEditorsWindow::selectNextEditor()
selectUpDown(true);
}
void OpenEditorsWindow::centerOnItem(int selectedIndex)
{
if (selectedIndex >= 0) {
QTreeWidgetItem *item;
int num = m_editorList->topLevelItemCount();
int rotate = selectedIndex-(num-1)/2;
for (int i = 0; i < rotate; ++i) {
item = m_editorList->takeTopLevelItem(0);
m_editorList->addTopLevelItem(item);
}
rotate = -rotate;
for (int i = 0; i < rotate; ++i) {
item = m_editorList->takeTopLevelItem(num-1);
m_editorList->insertTopLevelItem(0, item);
}
}
}
void OpenEditorsWindow::setEditors(const QList<EditLocation> &globalHistory, EditorView *view)
{
m_editorList->clear();
......
......@@ -78,8 +78,6 @@ private:
void addHistoryItems(const QList<EditLocation> &history, EditorView *view, QSet<IDocument*> &documentsDone);
void addRestoredItems();
void ensureCurrentVisible();
bool isCentering();
void centerOnItem(int selectedIndex);
void selectUpDown(bool up);
bool isSameFile(IEditor *editorA, IEditor *editorB) const;
......
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