#include <KPluginLoader>
#include <KPluginFactory>
#include <KService>
-#include <kde_terminal_interface_v2.h>
-#include <KParts/Part>
+#include <kde_terminal_interface.h>
+#include <KParts/ReadOnlyPart>
#include <KShell>
#include <KIO/Job>
#include <KIO/JobUiDelegate>
+#include <KJobWidgets>
-#include <QBoxLayout>
#include <QDir>
#include <QShowEvent>
+#include <QVBoxLayout>
TerminalPanel::TerminalPanel(QWidget* parent) :
Panel(parent),
this, SLOT(slotKonsolePartCurrentDirectoryChanged(QString)));
// Make sure this terminal does not prevent unmounting any removable drives
- changeDir(KUrl::fromPath("/"));
+ changeDir(QUrl::fromLocalFile("/"));
// Because we have disconnected from the part's currentDirectoryChanged()
// signal, we have to update m_konsolePartCurrentDirectory manually. If this
}
m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0;
if (m_konsolePart) {
- connect(m_konsolePart, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));
+ connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
m_terminalWidget = m_konsolePart->widget();
m_layout->addWidget(m_terminalWidget);
- m_terminal = qobject_cast<TerminalInterfaceV2 *>(m_konsolePart);
+ m_terminal = qobject_cast<TerminalInterface*>(m_konsolePart);
}
}
if (m_terminal) {
Panel::showEvent(event);
}
-void TerminalPanel::changeDir(const KUrl& url)
+void TerminalPanel::changeDir(const QUrl& url)
{
delete m_mostLocalUrlJob;
m_mostLocalUrlJob = 0;
} else {
m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo);
if (m_mostLocalUrlJob->ui()) {
- m_mostLocalUrlJob->ui()->setWindow(this);
+ KJobWidgets::setWindow(m_mostLocalUrlJob, this);
}
- connect(m_mostLocalUrlJob, SIGNAL(result(KJob*)), this, SLOT(slotMostLocalUrlResult(KJob*)));
+ connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult);
}
}
void TerminalPanel::slotMostLocalUrlResult(KJob* job)
{
KIO::StatJob* statJob = static_cast<KIO::StatJob *>(job);
- const KUrl url = statJob->mostLocalUrl();
+ const QUrl url = statJob->mostLocalUrl();
if (url.isLocalFile()) {
sendCdToTerminal(url.toLocalFile());
}
}
}
- emit changeUrl(dir);
+ const QUrl url(QUrl::fromLocalFile(dir));
+ emit changeUrl(url);
}
-
-#include "terminalpanel.moc"