-void URLNavigator::setURL(const KUrl& url)
-{
- QString urlStr(url.pathOrUrl());
- //kdDebug() << "setURL(" << url << ")" << endl;
- if (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.
- const KUrl& nextURL = m_history[m_historyIndex - 1].url();
- if (transformedURL == nextURL) {
- goForward();
-// kdDebug() << "goin' forward in history" << endl;
- return;
- }
- }
-
- const KUrl& currURL = m_history[m_historyIndex].url();
- if (currURL == transformedURL) {
- // don't insert duplicate history elements
-// kdDebug() << "currURL == transformedURL" << endl;
- return;
- }
-
- updateHistoryElem();
+ // Append a filler widget at the end, which automatically resizes to the
+ // maximum available width. This assures that the URL navigator uses the
+ // whole width, so that the clipboard content can be dropped.
+ m_filler = new QWidget();
+ m_filler->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);