svn path=/trunk/KDE/kdebase/apps/; revision=646813
void DolphinMainWindow::updateHistory()\r
{\r
int index = 0;\r
void DolphinMainWindow::updateHistory()\r
{\r
int index = 0;\r
- const QLinkedList<UrlNavigator::HistoryElem> list = m_activeView->urlHistory(index);\r
+ const QList<UrlNavigator::HistoryElem> list = m_activeView->urlHistory(index);\r
\r
QAction* backAction = actionCollection()->action("go_back");\r
if (backAction != 0) {\r
\r
QAction* backAction = actionCollection()->action("go_back");\r
if (backAction != 0) {\r
m_urlNavigator->editUrl(editable);
}
m_urlNavigator->editUrl(editable);
}
-const QLinkedList<UrlNavigator::HistoryElem> DolphinView::urlHistory(int& index) const
+const QList<UrlNavigator::HistoryElem> DolphinView::urlHistory(int& index) const
{
return m_urlNavigator->history(index);
}
{
return m_urlNavigator->history(index);
}
void DolphinView::restoreContentsPos()
{
int index = 0;
void DolphinView::restoreContentsPos()
{
int index = 0;
- const QLinkedList<UrlNavigator::HistoryElem> history = urlHistory(index);
+ const QList<UrlNavigator::HistoryElem> history = urlHistory(index);
if (!history.isEmpty()) {
QAbstractItemView* view = itemView();
// TODO: view->setCurrentItem(history[index].currentFileName());
if (!history.isEmpty()) {
QAbstractItemView* view = itemView();
// TODO: view->setCurrentItem(history[index].currentFileName());
- QLinkedList<UrlNavigator::HistoryElem>::const_iterator it = history.begin();
- it += index;
- view->horizontalScrollBar()->setValue((*it).contentsX());
- view->verticalScrollBar()->setValue((*it).contentsY());
+ const UrlNavigator::HistoryElem& it = history[index];
+ view->horizontalScrollBar()->setValue(it.contentsX());
+ view->verticalScrollBar()->setValue(it.contentsY());
* @param index Output parameter which indicates the current
* index of the location.
*/
* @param index Output parameter which indicates the current
* index of the location.
*/
- const QLinkedList<UrlNavigator::HistoryElem> urlHistory(int& index) const;
+ const QList<UrlNavigator::HistoryElem> urlHistory(int& index) const;
/** Returns true, if at least one item is selected. */
bool hasSelection() const;
/** Returns true, if at least one item is selected. */
bool hasSelection() const;
const KUrl& UrlNavigator::url() const
{
assert(!m_history.empty());
const KUrl& UrlNavigator::url() const
{
assert(!m_history.empty());
- QLinkedList<HistoryElem>::const_iterator it = m_history.begin();
- it += m_historyIndex;
- return (*it).url();
+ return m_history[m_historyIndex].url();
}
KUrl UrlNavigator::url(int index) const
}
KUrl UrlNavigator::url(int index) const
-const QLinkedList<UrlNavigator::HistoryElem>& UrlNavigator::history(int& index) const
+const QList<UrlNavigator::HistoryElem>& UrlNavigator::history(int& index) const
{
index = m_historyIndex;
return m_history;
{
index = m_historyIndex;
return m_history;
// Check whether the previous element of the history has the same Url.
// If yes, just go forward instead of inserting a duplicate history
// element.
// Check whether the previous element of the history has the same Url.
// If yes, just go forward instead of inserting a duplicate history
// element.
- QLinkedList<HistoryElem>::const_iterator it = m_history.begin();
- it += m_historyIndex - 1;
- const KUrl& nextUrl = (*it).url();
- if (transformedUrl == nextUrl) {
+ HistoryElem& prevHistoryElem = m_history[m_historyIndex - 1];
+ if (transformedUrl == prevHistoryElem.url()) {
goForward();
// kDebug() << "goin' forward in history" << endl;
return;
}
}
goForward();
// kDebug() << "goin' forward in history" << endl;
return;
}
}
- QLinkedList<HistoryElem>::iterator it = m_history.begin() + m_historyIndex;
- const KUrl& currUrl = (*it).url();
- if (currUrl == transformedUrl) {
+ if (this->url() == transformedUrl) {
// don't insert duplicate history elements
// don't insert duplicate history elements
-// kDebug() << "currUrl == transformedUrl" << endl;
+// kDebug() << "current url == transformedUrl" << endl;
return;
}
updateHistoryElem();
return;
}
updateHistoryElem();
- m_history.insert(it, HistoryElem(transformedUrl));
+ m_history.insert(m_historyIndex, HistoryElem(transformedUrl));
// Prevent an endless growing of the history: remembering
// the last 100 Urls should be enough...
if (m_historyIndex > 100) {
// Prevent an endless growing of the history: remembering
// the last 100 Urls should be enough...
if (m_historyIndex > 100) {
- m_history.erase(m_history.begin());
+ m_history.removeFirst();
void UrlNavigator::storeContentsPosition(int x, int y)
{
void UrlNavigator::storeContentsPosition(int x, int y)
{
- QLinkedList<HistoryElem>::iterator it = m_history.begin() + m_historyIndex;
- (*it).setContentsX(x);
- (*it).setContentsY(y);
+ HistoryElem& hist = m_history[m_historyIndex];
+ hist.setContentsX(x);
+ hist.setContentsY(y);
}
void UrlNavigator::keyReleaseEvent(QKeyEvent* event)
}
void UrlNavigator::keyReleaseEvent(QKeyEvent* event)
assert(m_historyIndex >= 0);
const KFileItem* item = 0; // TODO: m_dolphinView->currentFileItem();
if (item != 0) {
assert(m_historyIndex >= 0);
const KFileItem* item = 0; // TODO: m_dolphinView->currentFileItem();
if (item != 0) {
- QLinkedList<HistoryElem>::iterator it = m_history.begin() + m_historyIndex;
- (*it).setCurrentFileName(item->name());
+ HistoryElem& hist = m_history[m_historyIndex];
+ hist.setCurrentFileName(item->name());
#include <kurl.h>
#include <QWidget>
#include <kurl.h>
#include <QWidget>
#include <QLinkedList>
class QHBoxLayout;
#include <QLinkedList>
class QHBoxLayout;
* back and forward within this history.
*/
* back and forward within this history.
*/
-typedef QLinkedList<KUrl> UrlStack;
+//typedef QList<KUrl> UrlStack;
class UrlNavigator : public QWidget
{
class UrlNavigator : public QWidget
{
* @param index Output parameter which indicates the current
* index of the location.
*/
* @param index Output parameter which indicates the current
* index of the location.
*/
- const QLinkedList<HistoryElem>& history(int& index) const;
+ const QList<HistoryElem>& history(int& index) const;
/**
* Goes back one step in the URL history. The signals
/**
* Goes back one step in the URL history. The signals
- QLinkedList<HistoryElem> m_history;
+ QList<HistoryElem> m_history;
QToolButton* m_toggleButton;
BookmarkSelector* m_bookmarkSelector;
KUrlComboBox* m_pathBox;
QToolButton* m_toggleButton;
BookmarkSelector* m_bookmarkSelector;
KUrlComboBox* m_pathBox;