Commit 51f0cb08 authored by Nikita Sirgienko's avatar Nikita Sirgienko
Browse files

Disable double opening files inside Cantor. Now, if user try to open...

Disable double opening files inside Cantor. Now, if user try to open worksheet, which already opened, Cantor just activate tab with the worksheet
parent 9d36066d
......@@ -97,6 +97,22 @@ CantorShell::~CantorShell()
void CantorShell::load(const QUrl &url)
{
// If the url already opened, then don't open the url in another tab, but
// just activate the already existed tab
for (int i = 0; i < m_parts.size(); i++)
{
KParts::ReadOnlyPart* part = m_parts[i];
if (part && part->url() == url)
{
if (m_tabWidget->currentIndex() != i)
activateWorksheet(i);
//else
// TODO message about that user try to open worksheet, which have been opened
// in Cantor and the user already see the worksheet, because it is active worksheet
return;
}
}
if (!m_part||!m_part->url().isEmpty() || m_part->isModified() )
{
addWorksheet(QString());
......
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