Commit 26166788 authored by Filipe Saraiva's avatar Filipe Saraiva
Browse files

Uses file name instead file URL in title bar

parent 9c406fc5
......@@ -105,6 +105,8 @@ void CantorShell::load(const QUrl &url)
closeTab(m_tabWidget->currentIndex());
if (m_recentProjectsAction)
m_recentProjectsAction->addUrl(url);
updateWindowTitle(m_part->url().fileName());
}
void CantorShell::setupActions()
......@@ -397,6 +399,7 @@ void CantorShell::activateWorksheet(int index)
{
createGUI(m_part);
updateWindowTitle(m_part->url().fileName());
QObject* pluginHandler=m_part->findChild<QObject*>(QLatin1String("PanelPluginHandler"));
connect(pluginHandler, SIGNAL(pluginsChanged()), this, SLOT(updatePanel()));
updatePanel();
......@@ -418,6 +421,12 @@ void CantorShell::setTabCaption(const QString& caption, const QIcon& icon)
}
}
void CantorShell::updateWindowTitle(const QString& fileName)
{
QFileInfo info(fileName);
setWindowTitle(info.baseName());
}
void CantorShell::closeTab(int index)
{
if (!reallyClose(false))
......@@ -720,4 +729,6 @@ void CantorShell::onWorksheetSave(const QUrl& url)
{
if (m_recentProjectsAction)
m_recentProjectsAction->addUrl(url);
updateWindowTitle(m_part->url().fileName());
}
......@@ -105,6 +105,7 @@ private:
void setupActions();
void closeEvent(QCloseEvent*) override;
bool reallyClose(bool checkAllParts = true);
void updateWindowTitle(const QString& fileName);
KParts::ReadWritePart* findPart(QWidget* widget);
private:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment