Put the shorter, simpler body into the if statement

parent b3d6b5f3
......@@ -80,7 +80,17 @@ bool ScanManager::start(const QUrl &url)
m_files = 0;
m_abort = false;
if (url.isLocalFile()) {
if (!url.isLocalFile()) {
QGuiApplication::changeOverrideCursor(QCursor(Qt::BusyCursor));
//will start listing straight away
Filelight::RemoteLister *remoteLister = new Filelight::RemoteLister(url, (QWidget*)parent(), this);
connect(remoteLister, SIGNAL(branchCompleted(Folder*,bool)), this, SLOT(cacheTree(Folder*,bool)), Qt::QueuedConnection);
remoteLister->setParent(this);
remoteLister->setObjectName(QLatin1String( "remote_lister" ));
remoteLister->openUrl(url);
return true;
}
QString path = url.toLocalFile();
if (!path.endsWith(QDir::separator())) path += QDir::separator();
......@@ -171,16 +181,6 @@ bool ScanManager::start(const QUrl &url)
connect(m_thread, SIGNAL(branchCompleted(Folder*,bool)), this, SLOT(cacheTree(Folder*,bool)), Qt::QueuedConnection);
m_thread->start();
return true;
}
QGuiApplication::changeOverrideCursor(QCursor(Qt::BusyCursor));
//will start listing straight away
Filelight::RemoteLister *remoteLister = new Filelight::RemoteLister(url, (QWidget*)parent(), this);
connect(remoteLister, SIGNAL(branchCompleted(Folder*,bool)), this, SLOT(cacheTree(Folder*,bool)), Qt::QueuedConnection);
remoteLister->setParent(this);
remoteLister->setObjectName(QLatin1String( "remote_lister" ));
remoteLister->openUrl(url);
return true;
}
......
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