Changeset View
Changeset View
Standalone View
Standalone View
src/filewidgets/kfilewidget.cpp
Show First 20 Lines • Show All 1551 Lines • ▼ Show 20 Line(s) | 1551 | if (ret != KMessageBox::Continue) { | |||
---|---|---|---|---|---|
1552 | return false; | 1552 | return false; | ||
1553 | } | 1553 | } | ||
1554 | return true; | 1554 | return true; | ||
1555 | } | 1555 | } | ||
1556 | 1556 | | |||
1557 | return true; | 1557 | return true; | ||
1558 | } | 1558 | } | ||
1559 | 1559 | | |||
1560 | #ifndef KIOFILEWIDGETS_NO_DEPRECATED | ||||
1560 | void KFileWidget::setSelection(const QString &url) | 1561 | void KFileWidget::setSelection(const QString &url) | ||
1561 | { | 1562 | { | ||
1562 | // qDebug() << "setSelection " << url; | 1563 | // qDebug() << "setSelection " << url; | ||
1563 | 1564 | | |||
1564 | if (url.isEmpty()) { | 1565 | if (url.isEmpty()) { | ||
1565 | return; | 1566 | return; | ||
1566 | } | 1567 | } | ||
1567 | 1568 | | |||
1568 | QUrl u = d->getCompleteUrl(url); | 1569 | QUrl u = d->getCompleteUrl(url); | ||
1569 | if (!u.isValid()) { // if it still is | 1570 | if (!u.isValid()) { // if it still is | ||
1570 | qWarning() << url << " is not a correct argument for setSelection!"; | 1571 | qWarning() << url << " is not a correct argument for setSelection!"; | ||
1571 | return; | 1572 | return; | ||
1572 | } | 1573 | } | ||
1573 | 1574 | | |||
1575 | setSelectedUrl(urlFromString(url)); | ||||
1576 | } | ||||
1577 | #endif | ||||
1578 | | ||||
1579 | void KFileWidget::setSelectedUrl(const QUrl &url) | ||||
1580 | { | ||||
1574 | // Honor protocols that do not support directory listing | 1581 | // Honor protocols that do not support directory listing | ||
1575 | if (!u.isRelative() && !KProtocolManager::supportsListing(u)) { | 1582 | if (!url.isRelative() && !KProtocolManager::supportsListing(url)) { | ||
1576 | return; | 1583 | return; | ||
1577 | } | 1584 | } | ||
1578 | 1585 | d->setLocationText(url); | |||
1579 | d->setLocationText(urlFromString(url)); | | |||
1580 | } | 1586 | } | ||
1581 | 1587 | | |||
1582 | void KFileWidgetPrivate::_k_slotLoadingFinished() | 1588 | void KFileWidgetPrivate::_k_slotLoadingFinished() | ||
1583 | { | 1589 | { | ||
1584 | if (locationEdit->currentText().isEmpty()) { | 1590 | if (locationEdit->currentText().isEmpty()) { | ||
1585 | return; | 1591 | return; | ||
1586 | } | 1592 | } | ||
1587 | 1593 | | |||
▲ Show 20 Lines • Show All 1256 Lines • Show Last 20 Lines |