this, SLOT(activeViewChanged(DolphinViewContainer*)));
connect(m_tabWidget, SIGNAL(tabCountChanged(int)),
this, SLOT(tabCountChanged(int)));
- connect(m_tabWidget, SIGNAL(currentUrlChanged(KUrl)),
- this, SLOT(setUrlAsCaption(KUrl)));
+ connect(m_tabWidget, SIGNAL(currentUrlChanged(QUrl)),
+ this, SLOT(setUrlAsCaption(QUrl)));
setCentralWidget(m_tabWidget);
setupActions();
m_activeViewContainer->view()->pasteIntoFolder();
}
-void DolphinMainWindow::changeUrl(const KUrl& url)
+void DolphinMainWindow::changeUrl(const QUrl &url)
{
if (!KProtocolManager::supportsListing(url)) {
// The URL navigator only checks for validity, not
emit urlChanged(url);
}
-void DolphinMainWindow::slotTerminalDirectoryChanged(const KUrl& url)
+void DolphinMainWindow::slotTerminalDirectoryChanged(const QUrl& url)
{
m_activeViewContainer->setAutoGrabFocus(false);
changeUrl(url);
void DolphinMainWindow::openNewMainWindow()
{
- KRun::run("dolphin %u", KUrl::List(), this);
+ KRun::run("dolphin %u", QList<QUrl>(), this);
}
void DolphinMainWindow::openNewActivatedTab()
m_tabWidget->openNewActivatedTab();
}
-void DolphinMainWindow::openNewTab(const KUrl& url)
+void DolphinMainWindow::openNewTab(const QUrl& url)
{
m_tabWidget->openNewTab(url);
}
-void DolphinMainWindow::openNewActivatedTab(const KUrl& url)
+void DolphinMainWindow::openNewActivatedTab(const QUrl& url)
{
m_tabWidget->openNewActivatedTab(url);
}
openNewTab(m_activeViewContainer->url());
} else {
foreach (const KFileItem& item, list) {
- const KUrl& url = DolphinView::openItemAsFolderUrl(item);
+ const QUrl& url = DolphinView::openItemAsFolderUrl(item);
if (!url.isEmpty()) {
openNewTab(url);
}
void DolphinMainWindow::openInNewWindow()
{
- KUrl newWindowUrl;
+ QUrl newWindowUrl;
const KFileItemList list = m_activeViewContainer->view()->selectedItems();
if (list.isEmpty()) {
{
// The default case (left button pressed) is handled in goUp().
if (buttons == Qt::MidButton) {
- openNewTab(activeViewContainer()->url().upUrl());
+ openNewTab(KIO::upUrl(activeViewContainer()->url()));
}
}
return;
}
- KUrl urlA = items.at(0).url();
- KUrl urlB = items.at(1).url();
+ QUrl urlA = items.at(0).url();
+ QUrl urlB = items.at(1).url();
QString command("kompare -c \"");
- command.append(urlA.pathOrUrl());
+ command.append(urlA.toDisplayString(QUrl::PreferLocalFile));
command.append("\" \"");
- command.append(urlB.pathOrUrl());
+ command.append(urlB.toDisplayString(QUrl::PreferLocalFile));
command.append('\"');
KRun::runCommand(command, "Kompare", "kompare", this);
}
// If the given directory is not local, it can still be the URL of an
// ioslave using UDS_LOCAL_PATH which to be converted first.
- KUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this);
+ QUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this);
//If the URL is local after the above conversion, set the directory.
if (url.isLocalFile()) {
DolphinViewContainer* container = activeViewContainer();
container->view()->writeSettings();
- const KUrl url = container->url();
+ const QUrl url = container->url();
DolphinSettingsDialog* settingsDialog = new DolphinSettingsDialog(url, this);
connect(settingsDialog, &DolphinSettingsDialog::settingsChanged, this, &DolphinMainWindow::refreshViews);
settingsDialog->setAttribute(Qt::WA_DeleteOnClose);
}
}
-void DolphinMainWindow::handleUrl(const KUrl& url)
+void DolphinMainWindow::handleUrl(const QUrl& url)
{
delete m_lastHandleUrlStatJob;
m_lastHandleUrlStatJob = 0;
{
m_lastHandleUrlStatJob = 0;
const KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult();
- const KUrl url = static_cast<KIO::StatJob*>(job)->url();
+ const QUrl url = static_cast<KIO::StatJob*>(job)->url();
if (entry.isDir()) {
activeViewContainer()->setUrl(url);
} else {
void DolphinMainWindow::openContextMenu(const QPoint& pos,
const KFileItem& item,
- const KUrl& url,
+ const QUrl& url,
const QList<QAction*>& customActions)
{
QWeakPointer<DolphinContextMenu> contextMenu = new DolphinContextMenu(this, pos, item, url);
activeViewContainer()->showMessage(error, DolphinViewContainer::Error);
}
-void DolphinMainWindow::slotPlaceActivated(const KUrl& url)
+void DolphinMainWindow::slotPlaceActivated(const QUrl& url)
{
DolphinViewContainer* view = activeViewContainer();
updateViewActions();
updateGoActions();
- const KUrl url = viewContainer->url();
+ const QUrl url = viewContainer->url();
emit urlChanged(url);
}
actionCollection()->action("activate_prev_tab")->setEnabled(enableTabActions);
}
-void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
+void DolphinMainWindow::setUrlAsCaption(const QUrl& url)
{
QString caption;
if (!url.isLocalFile()) {
- caption.append(url.protocol() + " - ");
- if (url.hasHost()) {
+ caption.append(url.scheme() + " - ");
+ if (!url.host().isEmpty()) {
caption.append(url.host() + " - ");
}
}
DolphinRecentTabsMenu* recentTabsMenu = new DolphinRecentTabsMenu(this);
actionCollection()->addAction("closed_tabs", recentTabsMenu);
- connect(m_tabWidget, SIGNAL(rememberClosedTab(KUrl,QByteArray)),
- recentTabsMenu, SLOT(rememberClosedTab(KUrl,QByteArray)));
+ connect(m_tabWidget, SIGNAL(rememberClosedTab(QUrl,QByteArray)),
+ recentTabsMenu, SLOT(rememberClosedTab(QUrl,QByteArray)));
connect(recentTabsMenu, SIGNAL(restoreClosedTab(QByteArray)),
m_tabWidget, SLOT(restoreClosedTab(QByteArray)));
connect(recentTabsMenu, SIGNAL(closedTabsCountChanged(uint)),
addDockWidget(Qt::LeftDockWidgetArea, placesDock);
connect(placesPanel, &PlacesPanel::placeActivated,
this, &DolphinMainWindow::slotPlaceActivated);
- connect(placesPanel, SIGNAL(placeMiddleClicked(KUrl)),
- this, SLOT(openNewTab(KUrl)));
+ connect(placesPanel, SIGNAL(placeMiddleClicked(QUrl)),
+ this, SLOT(openNewTab(QUrl)));
connect(placesPanel, &PlacesPanel::errorMessage,
this, &DolphinMainWindow::slotPanelErrorMessage);
connect(this, &DolphinMainWindow::urlChanged,
void DolphinMainWindow::updateGoActions()
{
QAction* goUpAction = actionCollection()->action(KStandardAction::name(KStandardAction::Up));
- const KUrl currentUrl = m_activeViewContainer->url();
- goUpAction->setEnabled(currentUrl.upUrl() != currentUrl);
+ const QUrl currentUrl = m_activeViewContainer->url();
+ goUpAction->setEnabled(KIO::upUrl(currentUrl) != currentUrl);
}
void DolphinMainWindow::createControlButton()