+ if (editOrBrowse) {
+ m_pathBox->setFocus();
+ }
+}
+
+void UrlNavigator::setActive(bool active)
+{
+ if (active != m_active) {
+ m_active = active;
+ update();
+ if (active) {
+ emit activated();
+ }
+ }
+}
+
+void UrlNavigator::dropUrls(const KUrl::List& urls,
+ const KUrl& destination)
+{
+ emit urlsDropped(urls, destination);
+}
+
+void UrlNavigator::setUrl(const KUrl& url)
+{
+ QString urlStr(url.pathOrUrl());
+ //kDebug() << "setUrl(" << url << ")" << endl;
+ if ( urlStr.length() > 0 && urlStr.at(0) == '~') {
+ // replace '~' by the home directory
+ urlStr.remove(0, 1);
+ urlStr.insert(0, QDir::home().path());
+ }
+
+ const KUrl transformedUrl(urlStr);
+
+ if (m_historyIndex > 0) {
+ // 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) {
+ goForward();
+// kDebug() << "goin' forward in history" << endl;
+ return;
+ }
+ }